-
Notifications
You must be signed in to change notification settings - Fork 83
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
Android TV 13: RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO #97
Comments
Yes, I think there are some new permission issues with Android 13 (compared to Android 12 and earlier), which I haven't had time to take a closer look at yet. At least with Pixel 6, a reboot helps. You could try that with your device as well. I'm not quite sure what you mean with "system voice recognition feature". You could try to use that with with "Kõnele service" (https://github.com/Kaljurand/K6nele-service/releases), instead of Kõnele. |
Reboot didn't help. I'm now going to try the Kõnele service. Sorry for not being specific enough. By "system voice recognition feature" I meant the thing that happen after I click the voice input button on the tv remote control. The system then shows the Kõnele voice input window and should display the recognized text as I speak. If you guide me I can gather more data that may explain it better. |
I have uninstalled Kõnele and LocalSTT. Installed the Kõnele service using the apk fetched from the link you provided. After that android tv is unable to use voice search - it says that the application for this function is not installed. Next I installed Kõnele from F-droid and selected "Kõnele service" as the recognition service - it behaves exactly like the LocalSTT service. The Kõnele app window flickers and displays "[ insufficient permissions ]". I also tried after manualy giving all possible permissions through the system settings / applications - sound and music, files, pictures and the fetch url and run its content to Kõnele and checking that the Kõnele service has the permission to use the microphone. |
OK, thanks for these details! Make sure "Settings -> Privacy -> Microphone access" is enabled. You could also try to check a few things:
Otherwise I have no idea at the moment, as there are many components what can fail here: Android 13, LineageOS, Android TV, the remote control's voice input button, Kõnele, etc. It seems the voice input button launches the ASSIST intent, which is resolved to Kõnele's
At the first launch the activity asks for the RECORD_AUDIO permission or verifies that it has the permission. If it has the permission then it calls the RecognitionService (e.g. Kõnele service, or LocalSTT, or Google, whatever has been selected as the default in the Kõnele settings). The service must also have the permission, but in this case it does not (or perhaps the permission is blocked centrally).
|
I will of course try all the things, but currently I'm away from the androidtv device. In the mean time I have tried Kõnele + localstt with Samsung Galaxy Tab S8 with Android 13 One UI 5 (up to date stock fw, not rooted), behaviour is the same as on AndroidTV. I guess this mean that the issue is android 13 specific, not lineage or androidtv specific. I will also try Kõnele service on the tablet and let you know. I've checked Kõnele + LocalSTT on my PocoF1 with Lineage 17.1 (android 10) - works like a charm. |
Yes, Settings -> Privacy -> Mic access is enabled for app apps and services. There is also an entry to check apps with mic access. Both Kõnele and LocalSTT is on that list. No installed apps are forbidden to use the mic.
I selected "Kõnele speak & swipe" in Settings -> System -> Keyboard -> Current keyboard. Then I clicked on a text input so the keyboard would be raised up. After clicking the veeery lonely mic icon (the bottom panel is very big and that icon sits on the right, but the rest of the panel is empty) I get the same error message: "[ insufficient permissions ]" in the upper left corner of the app panel. No flickering though. (I get a striked text "K6_Y_BTN_MIC_LONGPRESS" or "K6_Y_BTN_MIC_DOUBLETAP" in the same place as the above error, when I do a long press or double tap of the OK button.)
When I click the Kõnele icon from the launchers app list I get a window titled "Speak a web search query". I get the flickering "[ insufficient permissions ]" error. When I try the voice input option for f.e. youtube I get the same error as when I clicked the icon from the launchers app list.
Yes! When I select select "Kõnele fast recognition" (with no language indication) as a recognition service I get some text output to the things I say. I guess it returns Estonian? I don't have GApps on this device. That's my whole point of using Kõnele :-).
Yes, all apps I tried are working fine with my mic. |
Thanks for testing! It's curious that "Kõnele (fast recognition)" works. (It's basically the same service as "Kõnele service", the only difference is that it's part of the Kõnele app itself.) One idea behind installing GApps, is that maybe it unlocks some features (or avoids some system bugs), and as a result things start working also in other apps. But I can understand that installing GApps is not an option for various reasons. So, at the moment I'm out of ideas. I'll open separate issues for things that I've noticed on Android 13, and try to fix these (although I cannot promise quick fixes), hoping that this issue will also go away as a result. |
Tbh it wouldn't be too much trouble to backup my pi's mmc, get rid of microg, flash gapps, test, report back and restore backup if you believe it's worth a shot. Sounds like a fun evening in the upcoming week. |
I have removed all traces of microg. Then I've installed the "basic" version of NikGapps from https://sourceforge.net/projects/nikgapps/files/Releases/NikGapps-T/08-Sep-2022/ . I also tried the same process with the "full" version. All of them are described here: https://nikgapps.com/downloads . They support Android 13 ("T"), but no notes if it's the same package for Android tv. The Installation process went well, with a couple of apps (Android Auto, Calendar, and some other, not related to speech or assistant) skipped, due to insufficient space on my device (root is only 2gb). The rest was installed fine, although the Play Store says my device is not supported. Contacts, calculator or gmail seems to work. After installing Gapps I tried Kõnele. The behaviour of the app is exactly the same as before with LocalSTT and "Kõnele fast recognition", both when using the assistant button on the remote or the android keyboard (AnySoftKeyboard) voice input feature. Then I Installed Google Speech Services apk and rebooted. There was no additional entry in Kõnele recognition services list. I guess I'm restoring my sdcard now. |
Thanks for testing! I'm out of ideas now, and don't have a similar setup to test myself. One hope is that fixing a related issue, e.g #99 will fix this issue as well. (However, it's unlikely that I'll have time in the coming months to work on this, beyond reviewing merge requests by others.) |
Small update: I've installed https://github.com/ewheelerinc/LocalSTT/releases/tag/2022-01-18-en-US on my Pixel 6 (Android 13, T2B2.221216.006), and set It does not work via Kõnele. Typically the Kõnele mic button turns grey and stays like this, and there is no Kõnele-level error message. Sometimes there is the system pop-up "LocalSTT keeps stopping". Perhaps the problem is with the service configuration:
One should add:
And at the manifest root level:
|
The newest LocalSTT fork seems to be https://github.com/parolteknologio/AndroidParolRekono I've tested the APK from https://github.com/parolteknologio/AndroidParolRekono/releases/tag/2022_julio and it works via Kõnele as well. :) Its Manifest does not export the service either, but it does contain the block:
so perhaps this is enough. |
Hi, I also have issues with Android 13 (but And offtopic, but for completeness: I was pointed to your app because I try to make an in-app-implementation of vosk available to the system-speech-recognition-provider. However, this issue occurs with both (konele and dicio/vosk) implementations. As a general question: Do you plan to support more languages / offline speech recognition? Since yours is already a well-working stand-alone-app for providing speech recognition, developing a complete new stand-alone app would not make much sense but would not be neccessary either :) |
@nebkrid, I assume you meant "on Samsung mobile hardware"? In any case, your issue does not seem to have anything to do with permissions (the topic of this thread) but the availability of system settings, which perhaps differ across vendor customizations of Android, e.g. on Pixel 6 / Android 13, I'm seeing both the Assistant and the speech input menus. Regarding support for more languages / offline services, the plan is to keep Kõnele just a UI app (the dark yellow boxes in the diagram in https://github.com/Kaljurand/K6nele/blob/master/README.md), that interacts with speech services via the SpeechRecognizer-interface. These services would be developed by other independent projects, and can be multi- or monolingual, cloud-based or offline (e.g. based on Vosk or Whisper). |
@Kaljurand thank you very much for your answer and sorry for my late reply. |
I'm trying to run K6nele 1.8.14 from F-Droid with LocalTTS rebuilt to include the Polish speech model on my Android TV 13 (Lineage) running on raspberry pi 4. LocalTTS runs fine and recognizes speech, but will not put recognized text in any text input field (out of scope of this issue). This is where K6nele comes in. LocalTTS is recognized in K6nele as Kaldi/Vosk Recognizer and I'm able to select it as the used recognition service. So far so good.
When I use the system voice recognition feature on any text field I get a weird behaviour of the K6nele voice input window - it goes into a some kind of a loop and displays "[ Insufficient permissions ]" while flickering.
Logcat contains:
What cought my attention is the line:
RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
. I checked both apps (K6nele, LocalTTS) in the Application settings for Mic permissions. I've also tried to manually grant the android.permission.RECORD_AUDIO to both packages, but no results. Any tips what to check or try?The text was updated successfully, but these errors were encountered: