unified volume?

163 views
Skip to first unread message

Dave C

unread,
Aug 11, 2014, 10:20:10 AM8/11/14
to Tasker Group
i want to unify volume control such that the volume buttons adjust all volumes for system & apps volume simultaneously, equally, and immediately.

has anyone done this? is this a straightforward thing (note absence of the term “easy”)?

suggestions welcome.

thanks,
Dave

Samsung Galaxy S3 L710.14
Android 4.4.2 KitKat
Stock ROM, no root


Jeremy Harris

unread,
Aug 11, 2014, 11:03:20 AM8/11/14
to tas...@googlegroups.com
There may be a simpler approach but my initial approach would be to install the free plugin, Persist. Then create several sound profiles that step down gradually. Then link a profile for hardware buttons to run a task that sets the next stepped down (or up) volume profile.

Jeremy Harris

unread,
Aug 11, 2014, 12:11:26 PM8/11/14
to tas...@googlegroups.com
Actually... Before you get to deep into this...I can't find any Volume button context for State or Event hardware profiles. It might be device specific, or there might be a plugin you can use... But for my S4, I don't think there's a way...

Maybe one of the pros here can give you better help...?

Brandon Horwath

unread,
Aug 11, 2014, 3:25:40 PM8/11/14
to tas...@googlegroups.com
i want to unify volume control such that the volume buttons adjust all volumes for system & apps volume simultaneously, equally, and immediately.

1) All volumes can be at different max levels, ie: media max is 15, alarm max is 7.

2) Apps can choose to ignore volume settings, including silent mode

3) Immediate might be relative. It would or could happen very quickly at least.

I made a task that remapped volume keys for other volume changes android wouldn't default to during use. The basic premise was monitoring changes in dynamic %VOL* variables, and the task applied a standard calculation to translate the changed volume into another inclremental change in volume. The downside was when android controlled media volume, and volume keys were tied to media, it took two volume presses to change the alarm level once (since media is in increments of 15, and alarm only 7).

Unfortunately, I don't have the task saved on my device any longer. I'd have to search for the thread mentioned or recreate it, and I have limited time at the moment. I'll check back when I have time later. Sorry...

Dave C

unread,
Aug 12, 2014, 1:58:38 PM8/12/14
to Tasker Group
I can’t imagine that there is no way to accomplish unifying the volumes in to one control, either via a stand-alone app or Tasker. 

Really? 

Dave

-=-=-=-

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.



Tasker 4.3u4 
Sam GS3 L710.14 

Marta Hintz

unread,
Aug 12, 2014, 2:16:52 PM8/12/14
to tas...@googlegroups.com
it depends on the phone, and the ROM.  The older ones worked, but the later ones you will have to try it and see. 

Dave C

unread,
Aug 12, 2014, 2:37:50 PM8/12/14
to Tasker Group
How? 

Thanks,
Dave

Tasker 4.3u4 
Sam GS3 L710.14 
Android 4.4.2 KitKat
Stock ROM, no root

-=-=-=-

nanobrain

unread,
Aug 12, 2014, 3:16:09 PM8/12/14
to tas...@googlegroups.com
Caveat: not tried out.

On my phone %VOLR/%VOLN/%VOLS and %VOLD are linked already, but I would start with this (there might be a better way):

Multiple profiles:

Event > Variable Set > %VOLR -> Task Audio > Media Volume = 2* %VOLR (because ringer volume goes 0-7, media 0-15), Audio > Notification Volume = %VOLR, etc.
Event > Variable Set > %VOLN -> Task Audio > Media Volume = 2* %VOLN, etc.
Event > Variable Set > %VOLM -> Task Audio > Ringer Volume = int(%VOLN/2), etc.
Event > Variable Set > %VOLS -> etc.

wash, rinse, repeat.

Jacob Klein

unread,
Aug 12, 2014, 3:19:36 PM8/12/14
to tas...@googlegroups.com
We all have said it can be done. So try it. See if you can set it up how you want, and of course make it how you like. That is what Tasker is for user customization and automation to the users lifestyle. Now that you know it is possible, make it happen.

Bob Hansen

unread,
Aug 12, 2014, 4:05:10 PM8/12/14
to tas...@googlegroups.com
The problem is that there is no direct access to the volume button activity in an android system. Only the effect of a volume change can be detect. To further complicate things, the volume change is directed to different volume settings depending upon what app and app state is currently in focus within android. For example, when on the Home screen, normally the Ringer volume would be controlled by the volume buttons. However, if an audio player is running in the background, then the Media volume is controlled by the volume buttons. If an alarm is going off then the alarm volume is controlled by the buttons.

All of these states need to be handled to devise a control that would monitor and then adjust the various volumes to the correct level. To further add to the confusion, in Tasker the only way volumes can be monitored is by looking for changes in the volume levels using the Variable Set context. So you need to monitor all the various volumes. If you detect a change in a volume and then start changing other volumes to match that change. The contexts that monitor the volumes will see the change and start making their own changes unless you disable all of the other profile contexts before making changes.

I created a couple of profiles to monitor Ringer and Media volumes and tasks to set the other volume settings to track the change thus unifying the volumes. 

Below are the two profiles. It should at least give you an idea of how to try to do this. 

Profile: VolR (405)
Event: Variable Set [ Variable:%VOLR Value:* ]
Enter: VolR (404)
A1: Profile Status [ Name:VolM Set:Off ] 
A2: System Volume [ Level:%VOLR Display:Off Sound:Off ] 
A3: Alarm Volume [ Level:%VOLR Display:Off Sound:Off ] 
A4: In-Call Volume [ Level:%VOLR Display:Off Sound:Off ] 
A5: Notification Volume [ Level:%VOLR Display:Off Sound:Off ] 
A6: Variable Set [ Name:%volr To:%VOLR*2 Do Maths:On Append:Off ] 
A7: Media Volume [ Level:%volr Display:Off Sound:Off ] 
A8: Profile Status [ Name:VolM Set:On ] 
A9: Flash [ Text:%VOLS
%VOLR
%VOLN
%VOLM
%VOLA Long:Off ] 

Profile: VolM (413)
Event: Variable Set [ Variable:%VOLM Value:* ]
Enter: VolM (409)
A1: Profile Status [ Name:VolR Set:Off ] 
A2: Variable Set [ Name:%vol To:floor(%VOLM/2) Do Maths:On Append:Off ] 
A3: Flash [ Text:%VOLM
%vol Long:Off ] 
A4: System Volume [ Level:%vol Display:Off Sound:Off ] 
A5: Alarm Volume [ Level:%vol Display:Off Sound:Off ] 
A6: In-Call Volume [ Level:%vol Display:Off Sound:Off ] 
A7: Notification Volume [ Level:%vol Display:Off Sound:Off ] 
A8: Ringer Volume [ Level:%vol Display:Off Sound:Off ] 
A9: Profile Status [ Name:VolR Set:On ] 
A10: [X] Flash [ Text:%VOLS
%VOLR
%VOLN
%VOLM
%VOLA Long:Off ] 

Rich D

unread,
Aug 12, 2014, 4:54:14 PM8/12/14
to Tasker Google Groups Post


>
> I created a couple of profiles to monitor Ringer and Media volumes and tasks to set the other volume settings to track the change thus unifying the volumes. 
>
> Below are the two profiles. It should at least give you an idea of how to try to do this. 
>

Nice idea Bob. Just to put in my 2¢... I think I would try use Bobs idea only use just one profile and 1 task with a event / variable set / : %VOLR/%VOLM ect

Then within the task use the %evtprm to figure out which volume was set and act accordingly. You will need to set the task collision setting to ' abort existing' in the task properties.

Untested.... Just a thought..... 

Rich D

unread,
Aug 12, 2014, 5:02:12 PM8/12/14
to Tasker Google Groups Post


> Nice idea Bob. Just to put in my 2¢... I think I would try use Bobs idea only use just one profile and 1 task with a event / variable set / : %VOLR/%VOLM ect
>
> Then within the task use the %evtprm to figure out which volume was set and act accordingly. You will need to set the task collision setting to ' abort existing' in the task properties.
>
> Untested.... Just a thought..... 

Forgot to mention, if you use the above approach you will not need to disable and enable the profile... :) 

Bob Hansen

unread,
Aug 12, 2014, 5:11:47 PM8/12/14
to tas...@googlegroups.com
I didn't know you could put multiple variable names in a Variable Set context!

Thanks Rich!!!

Bob Hansen

unread,
Aug 12, 2014, 5:56:17 PM8/12/14
to tas...@googlegroups.com
Thanks to Rich's insight, this turned out to be much simpler than I thought! :-)

Here is a working Vol_Unified profile.
Note: So changes may be needed depending upon the device's volume ranges. Also, I used %VOL* to match all the various volume settings, but this would also match and other variable that began with %VOL... so you might want to changes this to %VOLA/%VOLS, etc. to avoid unexpected matches.

Profile: Vol_Unified (405)
        Event: Variable Set [ Variable:%VOL* Value:* ]
Enter: Vol_Unified (404)
        Run Both Together
        A1: [X] Flash [ Text:%evtprm() Long:Off ]
        A2: Variable Set [ Name:%vol To:%evtprm(2) Do Maths:Off Append:Off ]
        A3: Variable Set [ Name:%volm To:%vol*2 Do Maths:Off Append:Off ] If [ %evtprm(1) !~ VOLM ]
        A4: Variable Set [ Name:%vol To:%evtprm(2)/2 Do Maths:On Append:Off ] If [ %evtprm(1) ~ VOLM ]
        A5: System Volume [ Level:%vol Display:Off Sound:Off ]
        A6: Alarm Volume [ Level:%vol Display:Off Sound:Off ]
        A7: In-Call Volume [ Level:%vol Display:Off Sound:Off ]
        A8: Notification Volume [ Level:%vol Display:Off Sound:Off ]
        A9: Media Volume [ Level:%volm Display:Off Sound:Off ]
        A10: [X] Flash [ Text:%VOLS
%VOLR
%VOLN
%VOLM
%VOLA Long:Off ]

Rich D

unread,
Aug 12, 2014, 6:13:33 PM8/12/14
to Tasker Google Groups Post

> Profile: Vol_Unified (405)
>         Event: Variable Set [ Variable:%VOL* Value:* ]
> Enter: Vol_Unified (404)
>         Run Both Together
>

If you have the task collision set to ' run both together'  and the tasks alternate actions is it not possible you could be setting the volumes to different values?

I would have thought the ' abort existing task'  would be the way to go...

Bob Hansen

unread,
Aug 12, 2014, 6:18:33 PM8/12/14
to tas...@googlegroups.com
I found that if  you abort existing task then it would abort after having set some of the volumes. By selecting "run both together" the tasks always complete and the volumes don't get out of sync.

Jeremy Harris

unread,
Aug 12, 2014, 6:22:53 PM8/12/14
to tas...@googlegroups.com

Impressive! Does anyone know what the plural of genius is??? This forum is full of them!!

--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/CU8gL34Qkvg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.

Matt R

unread,
Aug 12, 2014, 6:23:12 PM8/12/14
to tas...@googlegroups.com
If the media volume is changed, %volm will be unset which probably causes an error in A9, though the task should still work (since you don't care about changing the media volume if that's what triggered the profile!).

Matt

Bob Hansen

unread,
Aug 12, 2014, 6:33:12 PM8/12/14
to tas...@googlegroups.com
Thanks Matt.
Your right Matt as you always are;-)

So here it is fixed.

Profile: Vol_Unified (405)
        Event: Variable Set [ Variable:%VOL* Value:* ]
Enter: Vol_Unified (404)
        Run Both Together
        A1: [X] Flash [ Text:%evtprm() Long:Off ]
        A2: Variable Set [ Name:%vol To:%evtprm(2) Do Maths:Off Append:Off ]
        A3: Variable Set [ Name:%volm To:%vol*2 Do Maths:Off Append:Off ] If [ %evtprm(1) !~ VOLM ]
        A4: Variable Set [ Name:%vol To:%evtprm(2)/2 Do Maths:On Append:Off ] If [ %evtprm(1) ~ VOLM ]
        A5: System Volume [ Level:%vol Display:Off Sound:Off ]
        A6: Alarm Volume [ Level:%vol Display:Off Sound:Off ]
        A7: In-Call Volume [ Level:%vol Display:Off Sound:Off ]
        A8: Notification Volume [ Level:%vol Display:Off Sound:Off ]
        A9: Media Volume [ Level:%volm Display:Off Sound:Off ] If [ %volm Is Set ]
        A10: [X] Flash [ Text:%VOLS
%VOLR
%VOLN
%VOLM
%VOLA Long:Off ]

Rich D

unread,
Aug 12, 2014, 6:50:35 PM8/12/14
to Tasker Google Groups Post


> I found that if  you abort existing task then it would abort after having set some of the volumes.

Correct. But don't all the volumes get set again with the new task iteration so you end up with the correct settings?

By selecting "run both together" the tasks always complete and the volumes don't get out of sync.
>

If it is working I would stick with it.. :)  I never really figured out when tasks that run together actually "alternate actions". If there is a wait involved then at that point they will definitely alternate but I have found if there is no delay  then the first iteration  seems to  complete before the next iteration runs...

Bob Hansen

unread,
Aug 12, 2014, 7:01:31 PM8/12/14
to tas...@googlegroups.com
Correct. But don't all the volumes get set again with the new task iteration so you end up with the correct settings?

I would think so too, but that is not what I found. No idea why.

I didn't fully test this as it was supposed to be a suggested approach. With your help it turned into a much better approach :-)

easiuser

unread,
Aug 13, 2014, 9:47:02 AM8/13/14
to tas...@googlegroups.com
Is there a trick to using pattern matching or multiple variables in a profile context.  I can get a profile to trigger with Variable Set %VOLM or %VOLR but not %VOL* or %VOLR/%VOLM

Bob Hansen

unread,
Aug 13, 2014, 10:33:04 AM8/13/14
to tas...@googlegroups.com
I am confused. Yesterday I swear this was working. Today I re-tried it and it doesn't work. I installed the latest Tasker between when it seemed to work yesterday and when I tried it again today. I am so confused!

Rich D

unread,
Aug 13, 2014, 2:14:30 PM8/13/14
to Tasker Google Groups Post


> Is there a trick to using pattern matching or multiple variables in a profile context.  I can get a profile to trigger with Variable Set %VOLM or %VOLR but not %VOL* or %VOLR/%VOLM
>

Both %VOL*   and %VOLR/%VOLM/%VOLA.   Work on my device.  What does not work is if I try to set these volumes with tasker it will not fire the profile. But if I set them with another app or in android settings then the profile fires and I get the correct values in %evtprm.

I have a rooted Motorola Droid 4 / Stock ROM   / Tasker  / Version:  4.4u2m  Android version 4.1.2

nanobrain

unread,
Aug 13, 2014, 2:22:50 PM8/13/14
to tas...@googlegroups.com
I tried both Variable Set %VOL* and %VOLR/%VOLM/%VOLS/etc before I answered OP and that would not fire using the volume buttons. That's why I suggested the one-profile-per-%VOL route.

rooted Nexus 5 / stock ROM 4.4.4 / Tasker 4.4u2m

Bob Hansen

unread,
Aug 13, 2014, 2:31:44 PM8/13/14
to tas...@googlegroups.com
I started out thinking exactly the same as you, nanobrain and easiuser. When Rich suggested to use the OR in a Variable Set I was skeptical but I tried it and it worked. I was pleasantly surprised that it did work! It would seem that something has changed. It sure made the construct of the profile much simpler when it did work.

Rich D

unread,
Aug 13, 2014, 2:33:22 PM8/13/14
to Tasker Google Groups Post


> I tried both Variable Set %VOL* and %VOLR/%VOLM/%VOLS/etc before I answered OP and that would not fire using the volume buttons.

Strange....   I have tried this now several times and different ways and it definitely works on my device. Not sure why it would be different on other devices????

Bob Hansen

unread,
Aug 13, 2014, 2:42:12 PM8/13/14
to tas...@googlegroups.com
I'm glad you said that it works on your device! I was beginning to think I was going nuts because I was so sure that it worked yesterday and it doesn't work today. The main thing I changed was going from Tasker 4.4u3 special build for Steve to 4.4u3 Pent released earlier today. But I reverted back to the "Steve" build and it still didn't work. Weird!

Rich D

unread,
Aug 13, 2014, 2:46:34 PM8/13/14
to Tasker Google Groups Post


> Strange....   I have tried this now several times and different ways and it definitely works on my device. Not sure why it would be different on other devices????

Just curious, does a context like this work when the variable %Test1234 is changed??

Profile: Volume Test (554)
Event: Variable Set [ Variable:%VOLR/%VOLM/%Test1234 Value:* ]
Enter: Volume Test (549)
A1: Flash [ Text:%evtprm(:) Long:On ]

This works for me as well...

nanobrain

unread,
Aug 13, 2014, 3:26:00 PM8/13/14
to tas...@googlegroups.com
The profile triggers for me if I change %Test1234 in the variable tab. Nothing happens for volume buttons or if I change volumes in settings.

easiuser

unread,
Aug 13, 2014, 3:30:14 PM8/13/14
to tas...@googlegroups.com
Interesting.  After testing further, Variable Set %VOLR (or any other volume) will not fire the profile if changed in tasker.  I was probably by design to prevent a profile from looping back if the user tried to increment or decrement the value that triggered it.
 
Problem solved by setting up separate profiles for each volume but using the same entry task.  %evtprm still gets the correct variable that triggered the event and the other volumes can be set accordingly.  No need to acivate or deactivate profiles.
 
Still concerned why you are able to use pattern matching in the event and I am not.
 
I have a rooted Galaxy S4 / Stock ROM / Tasker version 4.4u2 (direct) / Android Version 4.2.2

Rich D

unread,
Aug 17, 2014, 9:29:50 AM8/17/14
to Tasker Google Groups Post

Bump @ Pent.....

Could you comment on this issue. It seems like a bug?

The issue seems to be that on my device I can make a
Profile like this

Profile: Volume Test (554)
Event: Variable Set [ Variable:%VOLR/%VOLM/%Test1234 Value:* ]
Enter: Volume Test (549)
A1: Flash [ Text:%evtprm(:) Long:On ]

And if I change ringer volume or media volume either with a app (other then tasker) or with the android setting this profile will fire.  This will not work on the other users devices.  They can get it to work if there is only one volume specified in the context but it will not work with multiple volume variables "or'd" together. Hopefully there is enough information in this post for you to comment on.

Thanks,   Rich..

Reply all
Reply to author
Forward
0 new messages