WAI
Status Update
Comments
dn...@google.com <dn...@google.com>
dn...@google.com <dn...@google.com> #2
Thank you for reporting this issue. For us to further investigate this issue, please provide the following additional information:
Android bug report
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method:
After reproducing the issue, navigate to developer settings, ensure ‘USB debugging’ is enabled, then enable ‘Bug report shortcut’. To take bug report, hold the power button and select the ‘Take bug report’ option.
Android bug report
After reproducing the issue, press the volume up, volume down, and power button simultaneously. This will capture a bug report on your device in the “bug reports” directory. Attach the bug report file to this issue.
Alternate method:
After reproducing the issue, navigate to developer settings, ensure ‘USB debugging’ is enabled, then enable ‘Bug report shortcut’. To take bug report, hold the power button and select the ‘Take bug report’ option.
gr...@kochaniak.com <gr...@kochaniak.com> #3
I have no idea why do you need this for an issue so clearly described, reproducible 100%, and with sample app with source code to demo it. But here it is.
dn...@google.com <dn...@google.com> #4
We have passed this to the development team and will update this issue with more information as it becomes available.
gr...@kochaniak.com <gr...@kochaniak.com> #5
Tested on OTA system update that came to my Nexus 6P yesterday evening, now the build number is OPR.170623.019 - still no progress on this issue, still broken.
ja...@google.com <ja...@google.com> #6
Hi,
Could you explain more about the use case for a TTS app to handle the media key events?
How would the TTS work together with the media keys such as play and pause?
While the app is in the foreground, you can use MediaControllerCompat.setMediaController() / Activity.setMediaController()
or override Activity.onKeyDown()/onKeyUp() directly.
Do you want to receive media key events while the TTS app is in the background?
Could you explain more about the use case for a TTS app to handle the media key events?
How would the TTS work together with the media keys such as play and pause?
While the app is in the foreground, you can use MediaControllerCompat.setMediaController() / Activity.setMediaController()
or override Activity.onKeyDown()/onKeyUp() directly.
Do you want to receive media key events while the TTS app is in the background?
gr...@kochaniak.com <gr...@kochaniak.com> #7
Of course my app needs media keys when in background or with screen turned off. Many people (over 30,000 active users daily) use @Voice Aloud Reader to listen to long lists of saved articles or ebooks, PDF files, manuals, academic texts etc., while excercising, walking, driving, doing manual chores or even lying down in the dark due to migrenes... Visually impaired users also use it that way. Some users also listen in the background, while they continue to browse or play a game on the phone. Please read the app description and user comments, or even install and try yourself:
https://play.google.com/store/apps/details?id=com.hyperionics.avar
It all works fine in all older versions of Android, until you broke it in Oreo...
Greg
It all works fine in all older versions of Android, until you broke it in Oreo...
Greg
gr...@kochaniak.com <gr...@kochaniak.com> #8
Forgot to add, if you try the app on Oreo, it will work with media buttons too, but this is due to a hack I had to employ to make this work: create MediaPlayer object and make it play a very brief and silent media file, before starting speech, to get media button focus... But why force us to use such silly hacks?
ja...@google.com <ja...@google.com> #9
It's working as intended, and what you've done is the right way to receive media keys in the background for a TTS app.
As it's written in thehttps://developer.android.com/guide/topics/media-apps/mediabuttons.html#finding-a-media-session ,
system tries to find the last app with a MediaSession that played audio locally,
but TTS sound come from the Android's TTS package (com.google.android.tts) so it mess up with the finding MediaSession to dispatch media key events.
The decision was made because too many apps misuse MediaSession's active state and PlaybackState
so they're taking key events even before the app is launched.
In Oreo, the behavior will remain the same, but it will be improved in P.
As it's written in the
system tries to find the last app with a MediaSession that played audio locally,
but TTS sound come from the Android's TTS package (com.google.android.tts) so it mess up with the finding MediaSession to dispatch media key events.
The decision was made because too many apps misuse MediaSession's active state and PlaybackState
so they're taking key events even before the app is launched.
In Oreo, the behavior will remain the same, but it will be improved in P.
gr...@kochaniak.com <gr...@kochaniak.com> #10
This response is very disappointing and indicates a serious lack of imagination on the part of Google decision makers here. In your scenario, even a simple game like a solitare or sudoku, with sound effects, will get media buttons focus - even though it has no interest in them at all, while an app like mine is using TTS is neglected. I'm just very sorry to read this response.
ja...@google.com <ja...@google.com> #11
Media keys wouldn't sent to the apps without MediaSession (e.g. games),
and simple sound effects are ignored when the framework is pick MediaSession for handling media key events.
So TTS apps are the only problematic case if they want to handle media keys in the background.
Decision was made to prevent mistakes from lots of media apps (40% of the apps with the MediaSession at the Play store's front page), and I'm sorry for your inconvenience caused by the changes in Oreo.
and simple sound effects are ignored when the framework is pick MediaSession for handling media key events.
So TTS apps are the only problematic case if they want to handle media keys in the background.
Decision was made to prevent mistakes from lots of media apps (40% of the apps with the MediaSession at the Play store's front page), and I'm sorry for your inconvenience caused by the changes in Oreo.
he...@googlemail.com <he...@googlemail.com> #12
Voice aloud reader is not the only affected app. Other examples are the Fbreader Tts+ Plugin (https://play.google.com/store/apps/details?id=com.hyperionics.fbreader.plugin.tts_plus ) or Voice Dream Reader (https://play.google.com/store/apps/details?id=voicedream.reader ). As a blind android user, I use these apps daily to listen to books. All these apps can not be controlled with my headset media buttons any more since my BQ Aquaris Pro received Oreo (8.1) last week. Not only reader apps are affected, also navigation apps like Nownav (https://play.google.com/store/apps/details?id=com.smithson.nownav ) which uses the headset button to trigger e.g. reannouncement of moving directions via text-to-speech.
Please consider text-to-speech in your media button restrictions.
Please consider text-to-speech in your media button restrictions.
me...@gmail.com <me...@gmail.com> #13
hey google team right now i am getting same issue. i have one blue tooth device which is connect to phone and play next previous and paus it working fine below oreo version but in oreo not any receving any event on oreo how it work in oreo is there any other way to work for that ?
please help me in this issue .
Thanks & Regard
Mehul Tank
please help me in this issue .
Thanks & Regard
Mehul Tank
ry...@ryanheise.com <ry...@ryanheise.com> #14
If anyone is still interested in this issue, it has been marked as "Won't Fix (Intended behavior)" which means Google probably won't be reading further comments.
I have opened a new issue athttps://issuetracker.google.com/issues/120951632 to request better documentation to support developers of TTS apps that need to listen to the media buttons. Please consider starring it if you agree that the documentation could be improved in this respect.
Thanks to Greg (of @Voice Aloud Reader) for sharing with us the workaround.
I have opened a new issue at
Thanks to Greg (of @Voice Aloud Reader) for sharing with us the workaround.
jo...@gmail.com <jo...@gmail.com> #15
I understand Google's rational, for most things that do tts, but they are handful of us that are reading documents, I see somebody already give a list (surprised when I read the log here to see somebody already mentioned mine). For those of us that have a real use case for this, it would be nice if we can send a flag. I would've thought setting everything up for MediaSessionCapat would kinda have a hint. Otherwise we have resort to hackery. Like playing something short (and probably non-audible) just to register ourselves for the bluetooth controls.
xi...@gmail.com <xi...@gmail.com> #16
I have some issue. Playing a silent sound can fix the issue, but I still think it is a workaround. For a code base, it is terrible weird with bad smell.
no...@gmail.com <no...@gmail.com> #17
Project https://github.com/gedoor/MyBookshelf got the same issue, upgrade user devices to Android 8.0+, Bluetooth Play/Pause button stop working when listen TTS novel.
Description
The device I'm testing on is Nexus 6P, purchased directly from Google Play. The Android 8 build number that I currently have is OPR6.170623.013. Same issue was observed before on beta test build starting with OPP.
Steps to reproduce:
Build and install the trivial sample from
While sample is running, connect a Bluetooth or wired headset with media buttons (Play/Pause button is tested in the sample).
Press the "Play TTS Sample" button in the app, you'll hear some speech. Now after pressing media buttons on the headset you should see text output in the app and LogCat, indicating the pressed button. This works on Android 5.x - 7.x, but fails on 8 Oreo. No output appears, instead the last used Music Player starts/stops.
Enable "Use MediaPlayer hack!" option at the bottom and press "Play TTS Sample" button again. Then press buttons on your headset. Now you will see output when media buttons are pressed, because the app played some "media sound". The fact that playing sound via TTS does not activate media buttons is simply wrong and breaks many existing apps, unless they employ this stupid hack for Oreo.
Disable the "hack" button - we still get media buttons, but use any Media Player and we're dead again.
Frequency: 100%
Expected output: KEYCODE_MEDIA_PLAY output in LogCat window (with "MPS" log tag) and in the app Text box, every time the headset "Play/Pause" button is pressed. This works on Android 5 to 7 inclusive, fails on Android 8.
Current output: nothing on Android 8, if the hack was not used.