Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wake-word service does not give microphone control to other apps #245

Open
pixincreate opened this issue Oct 8, 2024 · 7 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed tts&stt Speech-to-text, text-to-speech and wakeword requests or bugs, including Vosk

Comments

@pixincreate
Copy link

Description

Once Dicio installed and the service has been started, your input always goes to the app even if it is asleep (not running in foreground).

I receive a call, the caller on the other end will not hear anything until Dicio is stopped completely (force stop) on my phone.

Specs

Device: Bluejay [GrapheneOS]
Android: 14
Dicio: v2.0 (All features including Wake word was enabled)

@Stypox
Copy link
Owner

Stypox commented Feb 26, 2025

It is true that Dicio keeps the microphone active, however the system should automatically take care of giving microphone control to other apps that request it. That's what happens on my phone and on emulators, so it might be a bug of your OS. I don't think there is a way to fix this, I couldn't find any documentation online for audio recording focus (but only for playing audio focus). If anyone finds something please let me know, but be aware that AudioManager.OnAudioFocusChangeListener only refers to playing audio, not recording audio.

@Stypox Stypox changed the title [BUG] Calls seems to be getting intercepted Wake-word service does not give microphone control to other apps Feb 26, 2025
@Stypox Stypox added bug Something isn't working help wanted Extra attention is needed tts&stt Speech-to-text, text-to-speech and wakeword requests or bugs, including Vosk labels Feb 26, 2025
@pixincreate
Copy link
Author

I'm not that into Android OS these days. @thestinger might have some info this?

@thestinger
Copy link

It's definitely not a GrapheneOS issue which doesn't make any changes to how this works. It will almost certainly happen on the stock Pixel OS. The app needs to be tested on devices using Android 15 QPR1 or the upcoming QPR2. Non-Pixel devices don't have the latest Android releases. Android 15 isn't the latest.

@Stypox
Copy link
Owner

Stypox commented Feb 26, 2025

I just tested on an Android emulator with API 35 (without Google APIs) and as soon as I start a call, Android gives control to the phone app (as shown in the image below) and takes it away from Dicio (making the wakeword not work anymore), but when the call finishes Dicio is again able to react to wakewords. I also tested with this audio recording app and observed the same behavior.

Image

However, these results are quite inconsistent. Sometimes Dicio when opens on the emulator, it captures audio focus only for a brief instant and then only gets values of 0 from the AudioRecord object. When that happens, the phone app and the audio recording app do acquire the microphone focus, but they also always receive values of 0. This clearly seems like a bug in the OS, or in the layer that emulates the microphone in the OS, so I don't know if it's related to the various issues related to the wake word like this one.

@Stypox
Copy link
Owner

Stypox commented Feb 26, 2025

@pixincreate could you collect logs from this APK? https://github.com/Stypox/testing-apks/releases/tag/10
It will log when the wakeword service starts receiving only 0s and when it does not. Also include logs from other apps since they may contain some useful information on why the focus is not transferred correctly.

@pixincreate
Copy link
Author

pixincreate commented Feb 27, 2025

I need some time for this. Will update with logs. adb logcat should be fine, right?

@Stypox
Copy link
Owner

Stypox commented Feb 27, 2025

Yes, thanks :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed tts&stt Speech-to-text, text-to-speech and wakeword requests or bugs, including Vosk
Projects
None yet
Development

No branches or pull requests

3 participants