Macro: Notification, Ringer, Alarm, Etc. volumes = {Music volume} + 20 %

cristalcommons

New member
Hello,

Thank you all, devs and supporters, for developing Macrodroid and creating this community.
I will soon buy Premium because it helps me so much with accesibility and it just costs 5 bucks. I am very grateful to Macrodroid devs for offering one-time payment to purchase Premium, but also the options of watching ads or sharing technical data. Having options helps a lot.



I am new in the macro creation and automation scene. I have been trying to create a macro for volume adjustment, and thanks to lurking info in Reddit, I could set part of it, but I didn't set it right.
I don't know which words to use to search for examples of this kind of macro: "link volumes"?, "sync volumes?", "volume auto-control"? Sorry, my English is not very good.


Macro description
- If there is a change in the device (not just user-input, but system or app driven too) that lowers or raises the Music volume...
- Then, the other volumes (Notification, Ringer, Alarm) will lower or raise themselves automatically to have a volume equivalent to: Music volume + 20 % more.


Text version
Trigger

- System Setting Change: {vol_music}

Actions
- Set Variable: (Music Volume) +20: {vol_music}+20.
- Volume Change: Alarm = (Music Volume) +20 | Notification = (Music Volume) +20 | Ringer = (Music Volume) +20.


Constraints
None.



Screenshots
dy61Y5s.png
9EjuFLS.png
TDDiREd.png




I think the mistake is in the Action 'Set Variable', or maybe in the way of adding '20' to the Variable Integer 'Music Volume'.
Could you tell me how to fix it, please?

Thank you and have a nice day.
 
Last edited:

cristalcommons

New member
The system setting change isn't a trigger for change for magic text. Try using the volume changed trigger.
Hey, thank you so much, it worked!

I thought the Volume change trigger was just for volume changes by using hardware buttons.
But it also allows you to choose the option of system volume changes, which is really nice.

In the Reddit threads I read, as they were a bit old, probably that option didn't exist back then.
I will buy Macrodroid now just for adding that option, yay!

Thank you pal. Have a great day!
 

cristalcommons

New member
Hey, hello again.

I already paid for MacroDroid Pro, and I am so happy because you can do *everything* with this app. Functions I would like to request for other apps... I can make them here.
Thank you all for developing and supporting Macrodroid ^^

But I am having a problem with this Volume Adjustment macro.


PROBLEM
When this Macro is active, Android thinks Volume buttons are some kind of keyboard.

If I press Volume Up or Volume Down buttons, the volumes change as I wanted, but also trigger makes the following unintended actions:
- apps reload or refresh its content,
- videos on fullscreen mode restart playing from the beginning, in picture-in-picture mode.

The behaviour pattern here seems to be some kind of:
When Media volume changes close current app + open same app again/reload content in picture-in-picture mode.


CURRENT MACRO SETTING
TRIGGERS
- Volume Up: Monitor Volume Changes + Volume Up/Down + Update Volume.
- Volume Down: Monitor Volume Changes + Volume Up/Down + Update Volume.

VARIABLES
- Variable 'Volume Adapt': Global, Integer Expression, {vol_media}+20

ACTIONS
- Set Variable: 'Volume Adapt' (name), Global, Integer Expression, {vol_media}+20
- Volume Change: Set volume in foreground ON, change Alarm, Notification and Ringer volumes, with the Variable 'Volume Adapt'

Conflicts?
Maybe there is a conflict between:
- Macrodroid's Accessibility VS Android's Accessibility options
- Macrodroid VS other Accessibility-relying apps (e.g. StayFree, Bitwarden)
- The Macro or Macrodroid itself VS Android Keyboard Input system


IMAGES
iMcK6Bf.png



VIDEO



If you already have an idea of what is happening or what I could try, could you please tell me?

Thank you and have a nice day.
 

Attachments

  • Screenshot_20231201-092202_MacroDroid.png
    Screenshot_20231201-092202_MacroDroid.png
    153 KB · Views: 5
Last edited:

cristalcommons

New member
Also...

If I ask the Change Volume action to change Accessibity volume too, will TTS voice sound louder? Because I would want it to do so.

There is an app called Routinery what has TTS voice support which I think it's set as Media/Music.
I wanted to make its volume 20 percent points higher than music apps like Spotify.
But I suppose it only could work if TTS for both apps are Media/Music Independent one of another, not both system dependent.

I don't know, it's nice to learn about macros but it's driving me crazy at the same time haha

Have a nice day.
 
Last edited:

cristalcommons

New member
Hello pals!

I show you another video to show the second problem of using this Macro:
I want to make Accesibility TTS Voice Volume to raise too when I raise Media Volume, but when I do it, all the controls get buggy.

I think the reason is LineageOS having messy control volumes for Media and Accessibility. Probably Xiaomi phones with MIUI 13 and above shouldn't have this problem, as they have separated volume sources for each app, and TTS Voice/Accessibility Volume would not get mixed with Media Volume.
But I'm just guessing, I am just a basic user with no specialist knowledge about tech.

 
Last edited:

mapriex

Active member
hi,

as i see, you use +30 louder soundsettings. when you do the test, you never went below the +30 difference. so it looks like its not changing.

i am not used to tts and accessibility functions, i can just say what i can see on the video so far.

maybe try a new macro with the slider on full. do the macro interfere then aswell, so you get the same problem?
 

cristalcommons

New member
hi,

as i see, you use +30 louder soundsettings. when you do the test, you never went below the +30 difference. so it looks like its not changing.

i am not used to tts and accessibility functions, i can just say what i can see on the video so far.

maybe try a new macro with the slider on full. do the macro interfere then aswell, so you get the same problem?
Hello, thank you so much for taking your time to reply! 🤗


Aah, you are so right when you say I never went below the +30 difference! The volumes can't change if the difference is less than x% (the variable being "{vol_music}+x").

But it's funny, because that's what's happening: I simply cannot do any change that does not end in Media volume being 100 %.

In that video example I posted in #8, I *cannot* lower the volume if Accessibility is enabled in Volume control action.
The Media volume will get automatically re-raised to 100 % all the time in steps of x% based on the Variable "{vol_music}+x".
This means Media volume will indefinitely gradually re-raise to 100%, and Alarm/Notification/Ringer will follow.

That's why you cannot see me make a 30 % volume change difference: I just can't haha.
I explain a bit more about it below, in the section "First Issue: Accessibility volume change messing all volumes".

Also, sorry, but what do you mean when you suggest me to "try a new macro with the slider on full"? On full? With 'on full' you mean doing a 100 % change? For which volume control? Accessibility?



First issue: Accessibility volume change messing all volumes

Explanation

  • If I raise the volume up or down, I will trigger the macro.
  • Accessibility volume will presumably get to 100 % automatically somehow, and will cause Media volume to raise to 100 % gradually in steps of x% (as in the Variable "{vol_music}+x"), anytime I make any change in volume.
  • If I press Volume Down, Media volume will lower in a normal 10% step, but will re-raise to 100 % immediately, probably because Accessibility volume is still 100 %, and Media volume is now synced to it. So I don't have a chance to lower any of any volume down.
  • Accessibility volume slider is not accessible for the user to change (ironic) so I won't be able to change any value anymore, unless I disable the macro.
  • Media volume being forced to 100%, this will make Alarm/Notification/Ringer volumes to raise inevitably up in steps of 'x' %, depending on the "{vol_music}+x" variable, until they get 100 % too, because the Macro makes them have to be +30% louder than Media (30% louder than 100 % will still be 100 %).
  • But this will also make Accessibility raise too, even if it's already on 100 %, until it reaches a value equivalent or **over** 100%.
  • Both Accessibility and Media volumes will get stuck there and not raise anymore: Accessibility over or equal to 100%, Media equal to 100%, Alarm/Notification/Ringer equal to 100%.

Different tests I did
  • A macro varying the different options for the triggers Volume Up and Volume Down: Use Accesibility Service/Monitor Volume Changes and Retain Previous Volume/Update Volume.
    • Result: Nah, using Accessibility Service instead of Monitor Volume Changes does not seem to solve Accessibility bug, and Using Retaining Previous Volume instead Update Volume won't prevent Media Volume to be forced to 100 % anyway, because even if the Trigger asks Media Volume to stay as it is, the Volume Change Action will make it raise to 100 anyway.

  • A macro that raises other volumes from the Volume change action: System Sounds, Voice Call, Bluetooth Volume
    • Result: Nah, enabling System Sounds, Voice Call and Bluetooth Volume for Volume Change does not cause any issues. Only Accessibility volume is causing trouble.

  • A macro that makes Accessibility, Alarm, Notification and Ringer volumes to raise up to an absolute Slider volume value, not based in any variable, e.g. 40 %.
    • Result: Nah, Accessibility volume will raise to 100 % no matter if I ask it to change with Slider or Variable. Each time I change volume again, Media will raise up to 100 % by steps of x%, being x% the x in "{vol_music}+x" Variable, and Alarm, Notification and Ringer volumes

Second Issue: Alarm volume will be a bit lower than Notification and Ringer

Explanation
  • By triggering this Macro, Alarm volume always will be a bit lower than Notification and Ringer volumes. This is more visible when Notification and Ringer volumes have been lowered many times, and are near 0%, because the difference between them will be "accumulate".
  • Note: In my LineageOS, Alarm, Notification and Ringer volumes have the same number of steps: 7. And Alarm does not seem to be dependant on Notification and Ringer.


I just realized...
  • Any volume change, no matter if it's Media, Alarm, Notification, Ringer, etc. will trigger all volumes to fulfill {vol_music}+30 variable.
    This is not a bug, as Volume Up/Volume Down triggers are not specific to Media volume. They will detect any volume change: Alarm, Notification, Media... So Macrodroid is working perfectly here.
  • I guess I will have to find a way to create a Macro that is triggered by selective Media volume changes, like a macro with a System Setting Change trigger with an expression similar to {vol_music}+/-(any number), that triggers the Volume Change actions.
  • Maybe we could ask MacroDroid devs to update the Volume Up/Volume Down trigger so it lets the user specify which volume changes will trigger: Media, Alarm, Notification, Ringer, Accessibility, etc.

Could anybody test the macro?

Could I ask any of you who may be reading to try recreate this macro and tell me if you face any of these issues?



Thank you so much.
Have a great day! ☀️
 
Top