Cannot change volume: "set volume failed - the macro was null"

Magegamer

New member
IMG_20220813_192606.jpg
Here is my macro. I want priority mode to turn on when I start the music app, but keep the same media volume.

Running the action ends in everything being successful, except for the volume change, which the log tells me: "set volume failed - the macro was null"

Testing the change volume on its own works fine.
 

Endercraft

Moderator (& bug finder :D)
View attachment 3204
Here is my macro. I want priority mode to turn on when I start the music app, but keep the same media volume.

Running the action ends in everything being successful, except for the volume change, which the log tells me: "set volume failed - the macro was null"

Testing the change volume on its own works fine.
Maybe it's because Allow priority notifications sets media / music volume to 0.
 

Qarboz

Well-known member
Try to insert "Wait Before Next Action" action (time=1 second) between "Priority Mode / Do Not Disturb" and "Volume Change"
 

Endercraft

Moderator (& bug finder :D)
View attachment 3204
Here is my macro. I want priority mode to turn on when I start the music app, but keep the same media volume.

Running the action ends in everything being successful, except for the volume change, which the log tells me: "set volume failed - the macro was null"

Testing the change volume on its own works fine.
Try to insert "Wait Before Next Action" action (time=1 second) between "Priority Mode / Do Not Disturb" and "Volume Change"
Maybe it doesn't have time to take the volume ?
 

Qarboz

Well-known member
After "Volume Change" action insert a "Popup Message" actionScreenshot_20220813-230407.png
to verify the actual volume level

***

Alternatively, you may want to do the opposite of what you did. Store the values of all volumes, except Media/Music, in global variables and set them to zero when you listen to music, then restore them when you have stopped listening
 

MacroDroidDev

Administrator
Staff member
Looking at the code, I think this error message is coming out when it really shouldn't be (ie. when the macro is not null it can still be printed).

Can you please use report a bug in troubleshooting on this macro and I will try and rectify whatever is going on here.
 

iwally

Member
Looking at the code, I think this error message is coming out when it really shouldn't be (ie. when the macro is not null it can still be printed).

Can you please use report a bug in troubleshooting on this macro and I will try and rectify whatever is going on here.
Hello,
I think I have a very similar issue. Basically I'm using some action blocks to:

1. increase volume to a given global variable value
2. play sound / TTS
3. revert the volume back to previous value

Sound TTS is played correctly, but the volume is not set back to the original value.
This is the log I had testing one of my actions blocks.


12-02-23 14:02:07 - Testing Action Block: TTS TTS
12-02-23 14:02:07 - A: If (no_ring = False)
12-02-23 14:02:07 - A: Set Variable (vol_ring_before: {vol_music})
12-02-23 14:02:07 - Updated value from 0 to 100
12-02-23 14:02:07 - A: Volume Change (Media / Music = vol_ring_high)
12-02-23 14:02:07 - A: Wait 20 ms
12-02-23 14:02:07 - Set volume failed - the macro was null
12-02-23 14:02:07 - A: Speak Text (test message)
12-02-23 14:02:09 - A: Wait 20 ms
12-02-23 14:02:09 - A: Volume Change (Media / Music = vol_ring_before)
12-02-23 14:02:09 - Set volume failed - the macro was null

The strange thing is:
first time the volume is increased
second time volume is not changed to the original value

Could it be related or is it a different problem, depending on the "action block"?
Thanks
 

MacroDroidDev

Administrator
Staff member
This error message looks suspiciously like something I fixed the other day not related to the set volume action. If anyone who is seeing this problem could use the report a bug feature in troubleshooting and select the relevant macro I can give it a test.
 

iwally

Member
Hello,
I have reported the bug: forgot to say I'm on vers 5.30
Feel free to contact me for any test / clarification I may have not given!

I have copied all actions from action block (which gives the error message in log and does not reset volume) to a sample macro.
Guess what?
The macro works, no error in log and volume is re-set

This is the non working action block

IMG_20230218_093420_716.jpg

This is the sample macro

IMG_20230218_093456_666.jpg

Thanks
 

Attachments

  • IMG_20230218_093456_666.jpg
    IMG_20230218_093456_666.jpg
    48.1 KB · Views: 0
Last edited:
Top