Status Update
Comments
ve...@google.com <ve...@google.com>
ve...@google.com <ve...@google.com> #2
Please provide complete bugreport.
Other affected users who have starred the issue are also welcome to share the bugreport to take it forward.
Android bug report (to be captured after reproducing the issue)
For steps to capture a bug report, please refer:
Alternate method
Navigate to “Developer options”, ensure “USB debugging” is enabled, then enable “Bug report shortcut”. Capture bug report by holding the power button and selecting the “Take bug report” option.
Note: Please upload the files to google drive and share the folder to android-bugreport@google.com, then share the link here.
ar...@gmail.com <ar...@gmail.com> #3
Please find the complete bugreport here:
Steps to reproduce:
- Open Spotify app and start casting to another device (Google Home Mini in my example).
- Click Home Button (Spotify app is backgrounded, system launcher is visible).
- Click the Volume Button (up or down) - the system adjusts the local music stream volume and does not pass the information to the Spotify app (actually to its
VolumeProviderCompat
configured forMediaSessionCompat
). - Turn off the screen.
- Click the Volume Button (up or down) - the system skips the event and does not pass the information to the Spotify app.
So the issue happens both when the screen is on and off.
Following the same steps on Android 11 was resulting in a different behavior - the volume button click events were passed to the Spotify app. Please see the "Android_11_logcat.txt" attached to the previous comment.
Android 11:
D/MediaSessionService: Adjusting com.spotify.music/spotify-media-session (userId=0) by 0. flags=4116, suggestedStream=-2147483648, preferSuggestedStream=false
Android 12 beta 5:
D/MediaSessionService: Adjusting suggestedStream=-2147483648 by 0. flags=4116, preferSuggestedStream=false, session=null
ve...@google.com <ve...@google.com>
pr...@google.com <pr...@google.com> #4
Please let me know if you need help reproducing or testing this issue
ar...@gmail.com <ar...@gmail.com> #5
I can also offer my help by creating a Github repo with a project that reproduces the issue. Please let me know if this is needed.
This is a very important feature for users of my app and since it is a regression in Android 12, it will be kind of inconvenient to explain them that it is the platform issue and not the app issue which I can fix.
Please let me know if there is anything else I can provide to help you solving the problem.
su...@google.com <su...@google.com> #6
We will re-enable it in SC V2.
so...@gmail.com <so...@gmail.com> #7
ar...@gmail.com <ar...@gmail.com> #8
+1 to above questions. Is there any workaround for receiving volume key events on Android 12? (that we could use until the Android 12.1 with the fix is released)
pu...@gmail.com <pu...@gmail.com> #9
Is it fixed in Android 12 final ?
su...@google.com <su...@google.com> #10
I don't think there is an workaround in Android 12, and still working on it.
Once it is fixed, this bug would be closed.
pu...@gmail.com <pu...@gmail.com> #11
Has it something to do with legal regulations regarding (high) volume levels somehow ?
In any case, it is an annoying issue since (among other things) it breaks on Android 12 the ability to perform Chromecast volume control when the casting app is not in the foreground, including when screen is off.
jo...@gmail.com <jo...@gmail.com> #12
ja...@gmail.com <ja...@gmail.com> #13
ab...@gmail.com <ab...@gmail.com> #14
Pixel 3, Android 12 public release (SP1A.210812.015)
ar...@gmail.com <ar...@gmail.com> #15
Would it be possible to increase the priority of this ticket? It seems like the amount of irritated users will be increasing rapidly as of now, since people have already started upgrading their devices to Android 12.
Also, please consider reopening the following issue:
It is related to the same thing.
ka...@gmail.com <ka...@gmail.com> #16
When casting, go to the system settings and audio. There's listed slider for casting but it is disabled and you cannot change the volume.
mb...@gmail.com <mb...@gmail.com> #17
THIS IS A FEATURE I INTERACT WITH ALL DAY EVERY DAY.
It's a severe-enough pain point that I am regretting the update to 12 entirely.
What can be done??
pu...@gmail.com <pu...@gmail.com> #18
Nothing can be done until it is eventually fixed in Android 12.1
ya...@gmail.com <ya...@gmail.com> #19
jb...@gmail.com <jb...@gmail.com> #20
vi...@gmail.com <vi...@gmail.com> #21
ha...@gmail.com <ha...@gmail.com> #22
Using Spotify on Google Nest Home and Mini Gen 2.
es...@gmail.com <es...@gmail.com> #23
si...@gmail.com <si...@gmail.com> #24
sc...@gmail.com <sc...@gmail.com> #25
ad...@gmail.com <ad...@gmail.com> #26
Google support is clueless
Google is clueless
It's surprising they let this through to final build
sc...@gmail.com <sc...@gmail.com> #27
By far Android 12 is the worst OS upgrade I've ever done, and I've been around since FroYo.
co...@alexjdolan.com <co...@alexjdolan.com> #28
Currently (Android 12) if I cast something, not only does the volume rocker not change the cast volume, but cast volume is missing from the volume side menu and full system settings.
For quite a while before 12 though, the volume rocker wouldn't default to cast volume either, but at least it was available in the volume side menu. I'm not sure exactly how long it was like this, but I remember it working as expected until maybe a year or two ago.
co...@alexjdolan.com <co...@alexjdolan.com> #29
pt...@gmail.com <pt...@gmail.com> #30
Pixel 5. Android 12. Build number: SP1A.210812.015
pi...@gmail.com <pi...@gmail.com> #31
kk...@gmail.com <kk...@gmail.com> #32
al...@gmail.com <al...@gmail.com> #33
to...@gmail.com <to...@gmail.com> #34
jc...@gmail.com <jc...@gmail.com> #35
bn...@gmail.com <bn...@gmail.com> #36
we...@gmail.com <we...@gmail.com> #37
Hopefully this gets resolved soon considering Google, Inc has known about this issue since the 3rd beta release.
to...@gmail.com <to...@gmail.com> #38
sa...@gmail.com <sa...@gmail.com> #39
The issue seems to happen with Spotify, pocket casts, youtube, Netflix and Amazon prime, so every app I have tried.
ja...@gmail.com <ja...@gmail.com> #40
ak...@gmail.com <ak...@gmail.com> #41
This actually was identified and a ticket was opened for it, but it was not prioritized. The original ticket was marked as "working as designed" citing "legal issues." Not sure what that means, but we have not been given any indication that this is going to be fixed by Google any time soon. The google rep indicated that it would be addressed in "SC V2" which, I believe is going to be the next major, mid-cycle release between android 12 and 13 (e.g. version 12.1). Link to article about this:
This is disappointing, but there must be some bigger thing at work for this not to be addressed through all of the betas and the final release of Android 12.
ke...@gmail.com <ke...@gmail.com> #42
Please fix asap, it is really annoying.
lu...@gmail.com <lu...@gmail.com> #43
cc...@gmail.com <cc...@gmail.com> #44
jl...@gmail.com <jl...@gmail.com> #45
a....@gmail.com <a....@gmail.com> #46
do...@gmail.com <do...@gmail.com> #47
la...@gmail.com <la...@gmail.com> #48
ph...@googlemail.com <ph...@googlemail.com> #49
dp...@gmail.com <dp...@gmail.com> #50
So should users downgrade back to android 11, or should the pixel users expect an update to fix the issue?
js...@gmail.com <js...@gmail.com> #51
Build Number: SD1A.210817.019.C2
dp...@gmail.com <dp...@gmail.com> #52
This got me bothered and thinking more about the root issue here.
It's obviously not a technical bug, but a legal one. Sadly google can't tell us tho.
However, if we find the explanation and share it here I don't think Google has a legal obligation to censor that.
With that in mind, I believe I found the root of the legal issue here - granted you need to take this with a grain of salt.
I am not legal professional in any manner - so you have been warned this is not authoritative, just putting the puzzle together.
As of August of 2021 a judge ruled that Google infringed on Sonos' patents.
See here:
I believe that it is not mere coincidence that the initial Volume control issue and the judges ruling both came out around August 13th.
Especially when you look into what the "Asserted Patents" are for and what they cover.
The main one I feel broke this feature is: "Method and apparatus for adjusting volume levels in a multi-zone system"
So unfortunately this doesn't appear to be a technical issue at all. Rather a legal issue and one that's very dumb.
sk...@gmail.com <sk...@gmail.com> #53
he...@gmail.com <he...@gmail.com> #54
This is one of the most important things with my phone. Yeah, I admit, I watch a lot of youtube etc via chromecast. But having to have the casting app open, i.e. Youtube, while adjusting the volume, is extremely annoying! Not even if I have the app open, as long as the screen is off/sleeps, I lose volume control. I have to wake phone! AND I have to be IN the youtube app?!?
This is a SERIOUS inconvenience! Chromecast just got extremely less usable. Is this specific to chromecast, or will other equivalent devices be under the same limitation? I mean, there are other devices that work like chromecast and displays youtube..
tr...@trinition.org <tr...@trinition.org> #55
st...@gmail.com <st...@gmail.com> #56
That's not acceptable, between all google devices
su...@google.com <su...@google.com> #57
We didn't want to make such a bad change but we had to do to address a legal issue.
We have been working on a solution to mitigate the situation, and it will be included in 12.1.
an...@gmail.com <an...@gmail.com> #58
cg...@gmail.com <cg...@gmail.com> #59
This means the Pixel 3a is out of luck.
he...@gmail.com <he...@gmail.com> #60
an...@googlemail.com <an...@googlemail.com> #61
sz...@gmail.com <sz...@gmail.com> #62
sa...@gmail.com <sa...@gmail.com> #63
vi...@gmail.com <vi...@gmail.com> #64
ak...@gmail.com <ak...@gmail.com> #65
Spot on analysis. This lines up exactly with what we are seeing. I'm surprised the removal of this feature hasn't been noted upon by any media sources that I've seen regarding upgrading to Android 12. Here's hoping that the lawyers figure it out between Google and Sonos and get it re-enabled tout suite.
I'm not pretending to be an expert, but it seems like if they removed it from Android 12 and are "working to resolve on 12.1" then that means they are conceding the merit of the lawsuit and are likely havingcontract discussions for use of the Sonos patents. Either way, it would be nice if someone took notice of this missing feature and the likely reason for it so we don't have to guess based on internet sleuthing on a gosh darn google bug tracker.
bb...@gmail.com <bb...@gmail.com> #66
ho...@gmail.com <ho...@gmail.com> #67
I only use Chromecast on my TVs and I use my phone to control music on my Google homes and minis.
Completely unable to use volume controls any more unless I go into the Google Home app and do it manually.
Angry and surprised that this has been released despite a pretty fundamental bug in Google's own system
sn...@gmail.com <sn...@gmail.com> #68
lu...@gmail.com <lu...@gmail.com> #69
I'm hoping this is resolved soon and an update pushed to patch.
aa...@gmail.com <aa...@gmail.com> #70
ms...@gmail.com <ms...@gmail.com> #71
mj...@gmail.com <mj...@gmail.com> #72
wo...@gmail.com <wo...@gmail.com> #73
fr...@elitists.org <fr...@elitists.org> #74
al...@gmail.com <al...@gmail.com> #75
ja...@gmail.com <ja...@gmail.com> #76
av...@gmail.com <av...@gmail.com> #77
ta...@gmail.com <ta...@gmail.com> #78
This is an embarrassing regression!
mi...@gmail.com <mi...@gmail.com> #79
ju...@gmail.com <ju...@gmail.com> #80
el...@gmail.com <el...@gmail.com> #81
da...@gmail.com <da...@gmail.com> #82
It's a shame google doesn't alert of this kind of bugs. I would have definitely waited for it to resolve before updating the system. I mean, I only got uglier UI and a bug which doesn't let me control the volume. 0 pros.
If the update is half baked either don't release it or let people know what's missing.
ph...@gmail.com <ph...@gmail.com> #83
Ican however adjust volume via the Google Home app, so this seems like a possible workaround
jr...@gmail.com <jr...@gmail.com> #84
ju...@gmail.com <ju...@gmail.com> #85
ha...@gmail.com <ha...@gmail.com> #86
Like everyone else here, I use the volume feature every time I cast.
ze...@gmail.com <ze...@gmail.com> #87
ma...@gmail.com <ma...@gmail.com> #88
ad...@gmail.com <ad...@gmail.com> #89
si...@gmail.com <si...@gmail.com> #90
For those arriving here now, the current best temporary strategy is to open the Google Home application, hit Media, and use the slider there. Annoying but at least you have that control back.
si...@gmail.com <si...@gmail.com> #91
me...@gmail.com <me...@gmail.com> #92
No idea how legal trouble with Sonos can cause a feature like this to just be disabled, listening to buttons while the screen is off is a basic feature of any OS
ph...@hotmail.com <ph...@hotmail.com> #93
tc...@gmail.com <tc...@gmail.com> #94
ad...@gmail.com <ad...@gmail.com> #95
ha...@gmail.com <ha...@gmail.com> #96
Cannot adjust the volume when casting without having to go to the Google home app. Please fix this!
wo...@gmail.com <wo...@gmail.com> #97
mi...@gmail.com <mi...@gmail.com> #98
ch...@gmail.com <ch...@gmail.com> #99
ka...@gmail.com <ka...@gmail.com> #100
Sorry for the inconvenience.
We didn't want to make such a bad change but we had to do to address a legal issue.
We have been working on a solution to mitigate the situation, and it will be included in 12.1.
ca...@gmail.com <ca...@gmail.com> #101
The most embarrassing update I've ever seen come from Android.
ph...@hotmail.com <ph...@hotmail.com> #102
pa...@gmail.com <pa...@gmail.com> #103
ra...@gmail.com <ra...@gmail.com> #104
de...@gmail.com <de...@gmail.com> #105
he...@gmail.com <he...@gmail.com> #106
th...@gmail.com <th...@gmail.com> #107
I don't want to moan for moaning's sake, but this is the most useless and backward iteration of the OS I've ever experienced in 10 or so years of the platform. The new UI is gross and overcomplicated and mostly not a reflection of how normal people use their phones day to day.
BRING BACK THE FEATURE THAT ALLOWS US TO CONTROL CHROMECAST'S VOLUME FROM THE DEVICE'S VOLUME CONTROL!
to...@gmail.com <to...@gmail.com> #108
What I fear the most here is they say we will mitigate in 12.1 and as always they will forget all the other use cases than their Chromecast. Some app cast to many other things setPlaybacktoremote is vital for those.If the legal issue is about Chromecast leave it for the others.
sv...@jacobsen.se <sv...@jacobsen.se> #109
si...@gmail.com <si...@gmail.com> #110
ar...@gmail.com <ar...@gmail.com> #111
we...@gmail.com <we...@gmail.com> #112
ry...@gmail.com <ry...@gmail.com> #113
ma...@gmail.com <ma...@gmail.com> #114
ca...@gmail.com <ca...@gmail.com> #115
ja...@dieboldnixdorf.com <ja...@dieboldnixdorf.com> #116
ie...@gmail.com <ie...@gmail.com> #117
ti...@gmail.com <ti...@gmail.com> #118
ec...@gmail.com <ec...@gmail.com> #119
z0...@gmail.com <z0...@gmail.com> #120
^^ Look at fancy pants up here with their "universal remote", self-righteously implying 118 Android developers and enthusiasts above off-kilter in their desire for the return of a method of device interaction that has existed for at least 7 years. Elementary usage scenarios as per aforementioned benefit least from the disconnected deactivated functionality described in this issue.
ti...@gmail.com <ti...@gmail.com> #121
Now if you have a fabulous 53.4 surround system then you might be reluctant to do this right now. Then again if you are such an audiophile, then you're probably just fine locking the phone volume to max to max out audio quality.
mi...@gmail.com <mi...@gmail.com> #122
Changing the Surround sound mode
from the default of Auto
to Stereo
has no effect from what I see. This setting looks like it only exists on Chromecast device settings, and not other cast devices such as Home speakers, or the Home Hub displays.
I have only found a few ways to control volume. None of which allow control with the screen off.
- Screen has to be on to control volume
- Volume control from casting app itself while active (eg: YouTube, Spotify)
- Two locations in the Google Home app
- While
Media
tab page is active - Select device itself, while volume dial is
Connected
and only on that screen
- While
Switching away from any screen listed above will detach control of the volume.
This is very annoying when one YouTube video is much louder than the previous. If it's late at night I want to be able to quickly turn down the volume. In the past I could quickly turn it down with the volume rockers on the side of the phone. Didn't have to wake or unlock.
Now I rush over to the main amplifier volume knob to turn it down! Either that, or I have to [quickly] get to one of the app locations listed above to gain control.
ge...@gmail.com <ge...@gmail.com> #123
s....@gmail.com <s....@gmail.com> #124
su...@google.com <su...@google.com>
ak...@gmail.com <ak...@gmail.com> #125
Does this mean there's a legal resolution and we might get this functionality put back in?
po...@gmail.com <po...@gmail.com> #126
mi...@gmail.com <mi...@gmail.com> #127
cs...@gmail.com <cs...@gmail.com> #128
This is a massive feature loss! I understand this is a legal issue etc, but bottom line is that very important functionality is lost.
Please bring forward that bugfix ASAP outside the normal upgrade cycle!
ru...@gmail.com <ru...@gmail.com> #129
Using Pixel 6, but having to use my OnePlus 6 as my "remote" now which is surely a hassle.
mi...@gmail.com <mi...@gmail.com> #130
Somewhat of a workaround is to wipe the dust off that older phone. Then get it connected to the same cast session.
My main phone is a Pixel 4XL. My old phone is a Pixel 2XL. I keep it around because it still has a great camera. It also works great to control the cast volume when the screen is off.
mi...@gmail.com <mi...@gmail.com> #131
In the future, Android updates should include a disclaimer related to feature loss without parity. I absolutely would not have upgraded had I know this was an issue.
ch...@gmail.com <ch...@gmail.com> #132
si...@gmail.com <si...@gmail.com> #133
to...@gmail.com <to...@gmail.com> #134
What was the mistake is 0 communication to users and devs for something that was known with large UX impact.
You can't imagine the number of mails and bad rating received from users no more able to control their volume when casting from well casting apps (not all apps are about Chromecast).
1 line in Android 12 app behavior change was all that was necessary for devs to prepare for the wave and warn users.
To this day, there's still 0 note on Android 12 page changes and still devs loosing time after being assaulted by users to understand what is going on until they find out this issue.
pa...@gmail.com <pa...@gmail.com> #135
Doesn't seem to be the "volume bar greyed out" issue, although I can see the Casting Volume bar is indeed greyed out on this phone; instead, there is no sound at all being streamed.
he...@gmail.com <he...@gmail.com> #136
th...@gmail.com <th...@gmail.com> #137
me...@gmail.com <me...@gmail.com> #138
j....@gmail.com <j....@gmail.com> #139
an...@gmail.com <an...@gmail.com> #140
jo...@contreras.com.co <jo...@contreras.com.co> #141
Correct action should be to fix this on all devices, Googlers deliberately put a bug, ethical move is to fix it for everyone.
I say this as a user, we don't pay for a Pixel with monopoly money. However what we get is rude Googlers who don't care about users.
ka...@gmail.com <ka...@gmail.com> #142
ar...@gmail.com <ar...@gmail.com> #143
To everyone who comes here just to write abusing comments: please stop it. I did NOT create this thread to abuse or blame anyone. This is not the way the community should act.
I am sure that all the people who subscribed to this thread don't want to read such comments. People prefer to receive valuable emails with status updates. If you are affected, please star the issue.
Regarding the issue itself: it is very serious to me, since it affects the core functionally of my app and I have to face hundreds (soon thousands) of irritated users.
To Google Team: is there any timeline on when you are planning to tackle the issue? I would like to know what should I communicate to users of my app. Thank you in advance.
sp...@gmail.com <sp...@gmail.com> #144
According to Mishaal Rahman (Senior Editor on XDA) on Twitter, looks like there is a workaround included in the 12L beta release today. Can't control volume with the physical volume buttons, but the cast volume level is now included and enabled on the volume panel pop-up.
se...@gmail.com <se...@gmail.com> #145
ar...@gmail.com <ar...@gmail.com> #146
In response to
I have just tested this on S2B1.211112.006
build and the issue is still present. Volume button click events are still NOT provided to VolumeProviderCompat
when a remote MediaSessionCompat
is registered. Therefore, the behavior is still inconsistent with the documentation.
Repeating my previous question to the Google Team: is there any timeline on when you are planning to tackle the issue? I would like to know what should I communicate to users of my app, since they are becoming more and more irritated :(
me...@gmail.com <me...@gmail.com> #147
Not every usecase is related to media.
Accessibility for some users that previously used the buttons for other actions other than volume controls is also impacted.
ol...@google.com <ol...@google.com> #148
I hope to be able to provide a more general update shortly. In the meantime, some specific notes for the attention of the original reporter:
I have just tested this on S2B1.211112.006 build and the issue is still present. Volume button click events are still NOT provided to VolumeProviderCompat when a remote MediaSessionCompat is registered. Therefore, the behavior is still inconsistent with the documentation.
Are you sure about this? I flashed the same build and tried the reproduction steps exactly as specified at the top of this thread. Volume adjustment with the hardware keys worked for me, with the app backgrounded and with the display both on and off.
According to Mishaal Rahman (Senior Editor on XDA) on Twitter, looks like there is a workaround included in the 12L beta release today. Can't control volume with the physical volume buttons, but the cast volume level is now included and enabled on the volume panel pop-up.
Mishaal appears to have been testing with YouTube Music. Confusingly, volume adjustment when backgrounded doesn't appear to be enabled for YouTube Music at all, on any device or Android version. The YouTube Music team are looking into this. For the purpose of testing the underlying platform behavior, please test with other apps that support Cast.
ka...@gmail.com <ka...@gmail.com> #149
ka...@gmail.com <ka...@gmail.com> #150
an...@gmail.com <an...@gmail.com> #151
Is there a timeline when to expect the fix/work around to be release to Pixel 3 or Newer Pixel's in Prod build?
ar...@gmail.com <ar...@gmail.com> #152
Replying to
Are you sure about this? I flashed the same build and tried the reproduction steps exactly as specified at the top of this thread. Volume adjustment with the hardware keys worked for me, with the app backgrounded and with the display both on and off.
I tested it again on S2B1.211112.006
and I observed that the behavior is inconsistent. Initially, when I started casting music, it was not working - after backgrounding the app I was pressing hardware buttons and the device was changing the volume of its local music stream (despite the fact that the music was playing on the remote device I was casting to).
Then I stopped casting, entered the app, started casting again, backgrounded the app and it was working (!) both when screen was on and off. When I was pressing volume buttons, the volume on Google Home Mini was adjusted (great!). The volume popup with the slider was not showing up after pressing the button (on Android 11 it was visible, with a casting icon). However it stopped working itself after a while (a few minutes) - the casting session was active all the time.
Then another restart of the casting session, but it didn't work. After multiple tries of starting and stopping casting, it worked again. And this time it was working until I stopped casting (around 5 - 8 minutes).
Then another restart of the casting session, but I didn't manage to make it working again.
I tried to find some pattern on when it starts/stops working, but I couldn't. It seems to happen randomly now. And I think that comment
I recorded a bug report, maybe it will help with finding the root cause.
Here is the link:
Please let me know if there is anything else I can test.
te...@gmail.com <te...@gmail.com> #153
ak...@gmail.com <ak...@gmail.com> #154
ar...@gmail.com <ar...@gmail.com> #155
Yet another reply to
I have created a
Basically VolumeProviderCompat
still does not get information about volume button clicks. I have tested it on S2B1.211112.006
build (Android 12).
On Android 11 the example app works fine.
To Google Team - please have a look at the above example. Are you able to reproduce the problem now?
ol...@google.com <ol...@google.com> #156
I think it's important to decouple:
- Adjusting the volume when casting from many popular applications, which is what most of the posts on this issue are referring to.
- The more technical question of volume button clicks being delivered to
VolumeProviderCompat
.
(1) should be enabled in Android 12L for the vast majority of use cases, although there are a couple of exceptions that are confusing things somewhat (e.g., YouTube Music, as discussed above). I am following up on these exceptions.
You are correct that for direct use of MediaSession
as implemented in your demo app, (2) is not enabled, and I am able to reproduce this. The way we've enabled (1) is that when there's a media session using remote volume control functionality, we look at properties of the corresponding media routes that are selected by the process. Cast integrates with MediaRouteProvider
/MediaRouter
, and so the underlying framework is able to query the selected media routes. Your demo app does not do this, and therefore volume button clicks are still not routed as you'd expect. For Cast-like use cases (but using some other non-Cast protocol, for example DIAL), we would still expect apps to integrate with MediaRouteProvider
/MediaRouter
, which should be sufficient for volume button clicks to be delivered.
I appreciate that (2) is not as documented, and is something that we'll continue to look at resolving. I also wonder whether you have a use case that requires direct MediaSession
integration but where integration with MediaRouteProvider
/MediaRouter
is not appropriate, or whether you've just done it this way in your demo to provide a minimal example. It's somewhat unclear what the initial motivation was for filing the issue, since the initial description contained both a description of (2) and reproduction steps that fall under (1). If you have such a use case, it would be interesting to understand it in more detail. Thanks!
to...@gmail.com <to...@gmail.com> #157
Exactly what I feared when they said workaround :)
My app can play and cast media to Upnp devices, Roku devices, Fire TV devices, Kodi and a few more, my users expect volume control when screen off to work in all those cases and not just when casting to Chromecast (that I support too).
VolumeProviderCompat was the only proper way to achieve that properly, including proper description if the devices supported discrete volume values or only +/- commands.
How are we supposed to do that with MediaRouteProvider/MediaRouter? (Considering too that MediaRouter currently force embedding AppCompat/Recyclerview/ ... and is unwanted in a pure compose world see
ol...@google.com <ol...@google.com> #158
Re #157, I think your use case falls exactly under:
For Cast-like use cases (but using some other non-Cast protocol, for example DIAL), we would still expect apps to integrate with
MediaRouteProvider
/MediaRouter
, which should be sufficient for volume button clicks to be delivered.
If the underlying framework can query the selected media routes for your process, then I think volume button clicks will be delivered to your VolumeProviderCompat
as you expect. For Cast-like use cases such as the ones you describe, we generally expect apps (or the SDKs that they're using) to integrate with MediaRouteProvider
/MediaRouter
, like the Cast SDK does, which is sufficient to allow the underlying framework to do this and therefore for volume button clicks to be delivered. My understanding is that some other apps that use DIAL also do things this way, which is again similar to your use case.
How are we supposed to do that with MediaRouteProvider/MediaRouter? (Considering too that MediaRouter currently force embedding AppCompat/Recyclerview/ ... and is unwanted in a pure compose world see
) https://issuetracker.google.com/issues/210099272
I think you should be able to do the same thing that the Cast SDK does. Implement a MediaRouteProvider
to inform the platform about available non-Cast routes, and integrate with MediaRouter
so that the platform knows which route is selected.
The issue you link to seems to be at best tangentially related. I'd also note that if you support Cast then you're probably depending on play-services-cast-framework
, in which case I think you'll already be pulling in androidx.mediarouter:mediarouter
as a transitive dependency as per the
ar...@gmail.com <ar...@gmail.com> #159
Replying to
Thanks for the detailed explanation. Answering to your question:
I also wonder whether you have a use case that requires direct MediaSession integration but where integration with MediaRouteProvider/MediaRouter is not appropriate, or whether you've just done it this way in your demo to provide a minimal example.
The use case of my app is that it needs to receive events about button clicks (also when the screen is off) in order to interpret them and execute some actions if needed. By actions I mean e.g. integration with other apps via MediaController
objects queried from MediaSessionManager
in order to e.g. control the playback.
So technically my app doesn't need to use MediaRouteProvider
/MediaRouter
, it just needs to be notified when a volume button is clicked (both when pressed and released).
In the ticket description the reproduction steps I described were referring to (1), as I believed that it be easier to understand that way. Right now I think that we can treat the example app and the "Steps to reproduce" from its README file as a reference.
to...@gmail.com <to...@gmail.com> #160
I disable transitive, have my own copy of media router and the gain is more than 1 MB in total so nearly 40% gain ... Same reason I don't update to cast 20.x+ as it add 350Kb and there's nowhere to report that. So if we are now forced to use that lib to control volume it's kinda related even if only by side effect. Even if easy maintaining a copy of media router is evitable pain is it's splitted.
About mediarouterprovider those routes should not be selectable by other apps at all. I don't think that it's possible to have them private to the app or media session, or it's not documented.
ol...@google.com <ol...@google.com> #161
Re #160:
Same reason I don't update to cast 20.x+ as it add 350Kb and there's nowhere to report that
It looks like you can report issues with the Cast SDK here:
About mediarouterprovider those routes should not be selectable by other apps at all. I don't think that it's possible to have them private to the app or media session, or it's not documented.
According to the MediaRouteProvider
documentation
A media route provider may be used privately within the scope of a single application process by calling MediaRouter.addProvider to add it to the local MediaRouter. A media route provider may also be made available globally to all applications by registering a MediaRouteProviderService in the provider's manifest. When the media route provider is registered as a service, all applications that use the media router API will be able to discover and used the provider's routes without having to install anything else.
I'm not sure, but it may also be possible to use MediaRouteProviderService
with android:exported="false"
.
to...@gmail.com <to...@gmail.com> #162
Nice to see Cast is now on the tracker, will report the size issue.
And thanks for the doc pointer, I always stopped at
Since migrating to that still wont solve Android 12 issue and it's quite some work, can you confirm the meaning of "I appreciate that (2) is not as documented, and is something that we'll continue to look at resolving." Does it means the docs will be updated to explains it won't work in the future, or that there's still hope something is done for 12L or for a future later release?
pu...@gmail.com <pu...@gmail.com> #163
On Android 11 (not sure about 12L, since I did not test), it is very well possible to receive VolumeProviderCompat events (hardware volume buttons changes when app is playing in the background, with screen eventually off) outside of any route management with:
mediaSession.setPlaybackToRemote(volumeProvider); mediaRouter.setMediaSessionCompat(null); // for volume control by VolumeProviderCompat rather than a route
I hope this functionality will still work on 12L.
ar...@gmail.com <ar...@gmail.com> #164
On Android 11 (not sure about 12L, since I did not test), it is very well possible to receive VolumeProviderCompat events (hardware volume buttons changes when app is playing in the background, with screen eventually off)
Unfortunately it still doesn't work that way on 12L (at least yet).
MediaSessionCompat
and VolumeProviderCompat
, without the need to implement MediaRouteProvider
/MediaRouter
.
I also hope that we will get this functionality back, otherwise my app will be useless (reacting for volume button clicks is part of its core feature).
pu...@gmail.com <pu...@gmail.com> #165
Yup confirming it's not working (using MediaSessionCompat + VolumeProviderCompat) on 12L with my app. Though Chromecast volume backed by a Route is working. I also hope that it will be fixed to work like it did prior to Android 12, so a Route is not required. My app handle playback (and volume control) to external devices without the complexity of using a Route. I also notice that in 12L, the media notification always mention "Other device" in the top-right corner, even when a Chromecast is made active by setting its route current.
ar...@gmail.com <ar...@gmail.com> #167
Thanks for sharing the news.
I think that now I understand what was the reasoning behind disabling the volume control while casting to external devices. It looks like controlling the volume for multiple cast devices at the same time violates the Sonos's patent (at least this is what Sonos claims), so e.g. controlling the volume of Speaker Groups had to be disabled. I don't have a full context so please correct me if I'm wrong.
I've also made some research in the recent Android source code changes and it looks like now the system verifies whether there is more than 1 route active for a process and if so, prevents adjusting the volume to not infringe the patent. Moreover, Android also requires that the process (app) with active MediaSession
I understand that to meet the current legal requirements, the system has to prevent delivering volume button click events if an app has many selected routes.
However, I wonder if it would be possible for the system not to require apps to have 1 selected routing session in order to receive volume button click events. This way app developers can still deliver features that allow users to control the currently played media (also played only locally) with volume buttons without the need to turn on the screen. By controlling the media, I mean not only changing the volume but also performing custom actions like "skip to next" or "skip to previous" (so the user is able to skip a track by long pressing the physical volume button). For that the app needs to listen for volume button clicks without adding a media route.
Such system behaviour would be also consistent with the behaviour of previous Android versions (pre 12).
To Google Team: I really appreciate the effort you put into resolving this issue. Do you think it would be still possible to make such change?
ar...@gmail.com <ar...@gmail.com> #168
Hi! Are there any updates on this issue?
Please let me know if you need any further information from my side.
ph...@hotmail.com <ph...@hotmail.com> #169
pu...@gmail.com <pu...@gmail.com> #170
And it still also works when an app control volume using a Route. No way to just use VolumeProviderCompat + MediaSession like it was possible pre Android 12 (see #163, #164).
pu...@gmail.com <pu...@gmail.com> #171
Still not working (#170, #163, #164) with 12L beta 3. I have little hope that VolumeProviderCompat will ever work again if not handled by a Route... That would be really unfortunate.
ar...@gmail.com <ar...@gmail.com> #172
ol...@google.com <ol...@google.com> #173
We don't have any further update. Post #156 above is still accurate.
However, I wonder if it would be possible for the system not to require apps to have 1 selected routing session in order to receive volume button click events.
We looked into this when we made the changes for Android 12L (which were also included in the Pixel January update), but unfortunately it wasn't a feasible approach.
ar...@gmail.com <ar...@gmail.com> #174
Ok, so by saying:
I appreciate that (2) is not as documented, and is something that we'll continue to look at resolving.
do you mean that volume button clicks will be delivered to VolumeProviderCompat
in a future Android release? Or if there are no chances that we will get this behaviour back?
In case there are no plans to restore this functionally, do we have any alternative way of listening volume button clicks when the screen is off?
an...@gmail.com <an...@gmail.com> #175
I am joining question #174.
Being able to receive volume button clicks is an essential feature of my app.
It would be great if an alternative was offered to get button presses.
Thank you very much for your help.
ma...@gmail.com <ma...@gmail.com> #176
My app uses physical buttons to initiate communication messages between users - and the inability to detect the volume buttons from sleep is an absolute killer. Answer #156 claims that there's still a path to detecting volume events, but saying it "should be sufficient" is a far cry from this basic functionality that was readily accessible in Android 11.
So I guess I join #174 and #175 and plea for an explicit path to access the physical buttons!
an...@gmail.com <an...@gmail.com> #177
Hi Google Team
Are there any updates on this issue?
My app uses physical buttons in order to trigger emergency alarms. The volume buttons were the only reliable physical buttons (available on all devices) for this purpose. As #176 said, the inability to detect the volume buttons from sleep is an absolute killer also for my app.
It is extremely frustrating, that Android does not allow apps simply to receive clicks on physical buttons (even when running in the background). I can not understand why is this so complicated or perhaps security-relevant.
Your help would be greatly appreciated
ol...@gmail.com <ol...@gmail.com> #178
I agree with the other users about monitoring the volume buttons even when the screen is off. I use the volume buttons to let the user interact with my app even when the screen is off - actually having nothing to do with media playback. My vote is for an addition to the API that allows for direct monitoring of the volume buttons (albeit it should also work if you are using the volume buttons on a connected device (e.g., Bluetooth headset)).
In any case, until this gets solved by Google, I figured out a way to achieve equivalent functionality based on the BroadcastReceiver class and have published a demo app at
ar...@gmail.com <ar...@gmail.com> #179
I have tested the above demo app, but unfortunately I cannot not say it provides an equivalent functionality. The main 3 reasons are:
- The broadcast receiver is invoked only when the volume changes. So if the volume reaches its max/min level, we do not receive events informing that the user pressed a physical volume button.
- The app has to play music (silence?) and keep
PARTIAL_WAKE_LOCK
to receive these events while the screen is off. Such solution drains the device's battery because it prevents the device from entering lower power states (please have a look at ). This is not acceptable in a production app.the documentation - Such approach does not provide information when the physical button is released, so it is impossible to detect long press of the volume button (and actually the
onLongPress()
method from the demo app is never called for me).
All the above drawbacks did not exist in the original approach with VolumeProviderCompat
. To sum up - I cannot implement the proposed workaround in my app. Due to (2) problem mentioned above, I would not recommend anyone to implement it in their apps as well.
ol...@gmail.com <ol...@gmail.com> #180
@#179: I agree that this is not an ideal solution, but it is the only one I could find until this gets fixed by Google. If you know another way, please share it with the community.
- On my Samsung Galaxy S20 with Android 12 installed,
BroadcastReceiver
gets invoked even when the volume is at max/min level. There may be different implementations by different manufacturers. I have some ideas for a workaround, but that's beyond the scope of this forum. - In my example, I used
PARTIAL_WAKE_LOCK
to keep the app running in the background. Since my fitness app already usesPARTIAL_WAKE_LOCK
, this is not an issue for me. There are other methods to achieve that (e.g.WorkManager
). - My
VolumeButtonHelper
class does provide the equivalent of releasing the physical button. If that's not working for you and you would like me to look into this, please create an "Issue" at .github.com/oliverClimbs/VolumeButtonDemo
ar...@gmail.com <ar...@gmail.com> #181
I tried to add the support for media routing to the
Here is
I added a "Cast" menu item, which allows to select the target device. I also implemented a custom MediaRouteProvider
(called Demo Cast
) - it should be always available (even if the device has no WiFi connection). The Demo Cast
is visible in the Cast selector dialog and the app successfully selects its route. However, even when the Demo Cast
is selected, volume button events are note delivered to the VolumeProviderCompat
.
Steps to reproduce:
- Build the example app from
branch and run on a device with Android SC V2 (12.1).cast-integration - Click the "Cast" button in the top-right corner.
- Select the "Demo Cast" device.
- You should now see "Demo Cast" name in the main app screen (under "Start Service" button).
- Click the "Start Service" button.
- Click the physical volume button.
Expected result:
The button click event should be delivered to the VolumeProviderCompat
- it should be confirmed by a toast message.
Actual result:
Events are not delivered to the VolumeProviderCompat
and no toast is shown.
If we select another target device (e.g. Chromecast), the events are delivered properly.
Do you know what am I doing wrong? Is there something missing in the custom MediaRouteProvider
? Why does not Android detect that the example app has an active route selected?
I have tested it on SP2A.220305.013.A3 build.
to...@gmail.com <to...@gmail.com> #182
For the record to gain time for others setPlaybackToRemote is not compatible with Android Auto, will half crash then badly reconnect and fails AA validation process. Tried for years to pass the level one to demonstrate the issue on AA team so they fix...
ja...@gmail.com <ja...@gmail.com> #184
Look forward to some progress!
J
pu...@gmail.com <pu...@gmail.com> #185
It's clear to me at this point that Google isn't interested in provide pre-Android 12 behavior, and it's just about providing volume control (screen off or app not in foreground) for Chromecast devices or any other device providing a Route...
ja...@gmail.com <ja...@gmail.com> #186
ja...@gmail.com <ja...@gmail.com> #187
pu...@gmail.com <pu...@gmail.com> #188
Spotify probably implemented a custom MediaRoute associated to whatever external device they control the volume.
so...@gmail.com <so...@gmail.com> #189
he...@googlemail.com <he...@googlemail.com> #190
ar...@gmail.com <ar...@gmail.com> #191
Hi Google Team!
Is there any update on this issue?
sv...@jacobsen.se <sv...@jacobsen.se> #192
1. Few apps works still - even YouTube only works when the app is actually open (for me anyway).
2. The apps that somewhat works (like Spotify) now always take precedence over other streaming media on the phone (I used to be able to Cast video/music but still, if I watched another video on the phone at the same time, the volume was instead adjusted locally).
So, a perfectly working solution on Android 11 still broken in Android 12.
fa...@wirelesszt.com <fa...@wirelesszt.com> #193
We don't use Cast at all in our application, so it does not make sense for us to use MediaRouteProvider.
Our users can configure the volume buttons to perform some actions of our app when in the background or with the screen off. This a demand of our users who don't understand how it does not work since Android 12.
Our app basically uses the VolumeProvider as indicated in example:
It is clear that this use case is not solved even in Android 12.1.
Are you still looking at a solution to this?
Introducing the MediaRouteProvider, as demonstrated by #181, is not working in Android 12.1.
The only possible workaround seems to be #178, which causes a drain to the battery and is not a general solution for all phones.
ar...@gmail.com <ar...@gmail.com> #194
Hi Google Team! Are there any updates on this issue? I would really appreciate any information. It's crucial for my project.
BTW I accidentally got removed from the CC list, could you please add me back?
ol...@google.com <ol...@google.com>
an...@gmail.com <an...@gmail.com> #195
Hello Google team,
It is really astonishing that apps can't easily get events that inform when hardware keys are pressed.
Would it be possible to make such events accessible via BroadcastReceiver? Even if the app is in the background. This would make the development work of many apps much easier.
I can't imagine that the notification that a hardware key has been pressed, released, or held could be a security problem.
Performance problems can't be either, because such keys are not pressed very often.
Please, help us developers
sv...@jacobsen.se <sv...@jacobsen.se> #196
Hope this will stick!!!
I'm just a user having had to put up with buggy volume buttons across multiple apps since the day Android 12 landed. It has been a rough couple of months. It's really something worth changing OS for - a real mess actually!
fa...@wirelesszt.com <fa...@wirelesszt.com> #197
For those of you that need a workaround for Android 12, I'll let you know my findings:
* I added an AccessibilityService overriding the onKeyEvent method. This way you get the key presses even when your app is in the background. However, this only works when screen is on. Also, the AccessibilityService won't work for apps that are installed in the work profile.
* Not ideal, but users can be instructed to first press the Power button to light up the screen and then press the volume key they want. Still, if your use case is to press & hold the volume key, this won't work because the screen will power off automatically while holding the volume key. I tried to set some screen lock, but this is not working in some phones like Samsung.
* If users are instructed to do the above, another option I found was to show your app in the locked screen using setTurnScreenOn and setShowWhenLocked. This will show your app in foreground after pressing the Power button, only if the user left your app in foreground when powering off the screen, and then you will receive the KeyEvents.
Hope this is useful to someone.
ar...@gmail.com <ar...@gmail.com> #198
I am not entirely sure what the previous commenters mean by "it's working again", because I have just tested this on Android 13 (Pixel 6 as well, build no. TP1A.220624.021) and the VolumeProvider
still doesn't work as on pre Android 12 versions.
For tests I was using
The behaviour on Android 13 is still the same as on Android 12 - volume button events are not delivered to VolumeProviderCompat
.
I'm adding +1 to the comment
I will appreciate any feedback from Google.
ar...@gmail.com <ar...@gmail.com> #201
Hi! Are there any updates on this issue?
ba...@gmail.com <ba...@gmail.com> #202
pi...@gmail.com <pi...@gmail.com> #203
The only way I've found to adjust media volume is to go into Settings app, and adjust the slider there. I wonder if there's an option in the Google Home app (or could one be added?!) which toggles device volume control for each device. I think that would resolve this and many other issues.
en...@gmail.com <en...@gmail.com> #204
an...@gmail.com <an...@gmail.com> #205
I agree with the previous post. It is an indictment of Google to leave developers hanging like this. I can't believe that Google can not adapt Android to send physical button events to registered app services. That would open up many possibilities for apps. Developers would appreciate an explanation if this is a security or other issue.
pu...@gmail.com <pu...@gmail.com> #206
Google clearly does not want developers to be able to handle volume changes outside of Media routes. That's sad, especially since it was possible prior to Android 12.
vi...@gmail.com <vi...@gmail.com> #207
ar...@gmail.com <ar...@gmail.com> #208
How is it possible that the issue with 319 pluses, S2 severity and P2 priority cannot get a comment from a Google team member for almost a year?
The Android community members have already added over 200 comments, asking for a help with restoring the functionality which has been removed in Android 12 without prior warning.
Also, several use cases have been provided, justifying why such a problem is crucial, both for developers and users who love Android.
Can we escalate it somehow?
ak...@gmail.com <ak...@gmail.com> #209
At this point, it's pretty clear that nothing is going to be done short of someone inside Google sticking their neck out to pay to address the issue from a pretty high level as the workarounds that Google was working on were deemed to not be legally viable. I think the silence from Google speaks volumes here and we 'have our decision.'
jm...@gmail.com <jm...@gmail.com> #210
ja...@gmail.com <ja...@gmail.com> #211
ma...@gmail.com <ma...@gmail.com> #212
in...@issend.de <in...@issend.de> #213
But now with the current and previous beta-update it's again not working anymore?
Can someone confirm this?
sa...@gmail.com <sa...@gmail.com> #214
We really need to know if this feature of getting callbacks into VolumeProviderCompat is going to be fixed or not?
he...@googlemail.com <he...@googlemail.com> #215
I thought I've read a news last year saying the patent issues were resolved, so in case this is true, why hasn't the functionality been restored with recent updates? And if there is a new method for controlling the volume for remote streams, why does nearly no app adopt it? Maybe the API change wasn't emphasized sufficiently in the documentation?
Description
Are you an Android developer?" (Y/N)
Yes
Which Android Developer Preview or Betabuild are you using? See Settings > About phone > Build number (for example RPP1.200123.000).
SPB5.210812.003
Is this a regression from Android 11 to 12?
Yes
What device are you using?
Android Emulator (created with Android Studio): sdk_gphone64_x86_64-userdebug SPB5.210812.003 7673742 dev-keys CPU/ABI: Google APIs Intel Atom (x86_64) Target: google_apis [Google APIs] (API level 31)
Affected apps
Any app that casts audio to external device (e.g. com.spotify.music).
What are the steps to reproduce the problem?
Volume button clicks events are not delivered to VolumeProviderCompat . After configuring setPlaybackToRemote(VolumeProviderCompat volumeProvider) , the media session does not receive volume button events. This results in a situation that a user cannot adjust the volume of the media when the device is casting audio.
MediaSessionCompat
by callingThe behavior is inconsistent with the documentation which clearly says that calling
setPlaybackToRemote
method "configures this session to use remote volume handling. This must be called to receive volume button events, otherwise the system will adjust the current stream volume for this session."Steps to reproduce:
Issue Category
Framework (platform)
What was the expected result?
The
VolumeProviderCompat
should receive events when volume buttons are clicked. The app which creates the MediaSessionCompat is able to react for these events and adjust the volume of audio stream that the device is currently casting.Documentation link that describes the expected behaviour
What was the actual result?
The
VolumeProviderCompat
does not receive volume button events. This makes the user unable to control the volume of the media that are being casted. The behavior is also inconsistent with the documentation and confusing for Android developers.Relevant logcat output
Logcat output attached below. There are 2 files attached. One contains the logcat output from Android 11 and the other one from Android 12. Both logcats were recorder by following the same steps provided above in "Steps to reproduce" section.