Kaljurand / K6nele

An Android app that offers speech-to-text user interfaces to other apps
http://kaljurand.github.io/K6nele/
Apache License 2.0
275 stars 83 forks source link

Android TV 13: RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO #97

Open r0d0dendr0n opened 1 year ago

r0d0dendr0n commented 1 year ago

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:

01-03 19:32:36.222  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.261  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.305  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.316   555  2523 I ActivityTaskManager: START u0 {act=android.intent.action.ASSIST flg=0x13200000 cmp=ee.ioc.phon.android.speak/.activity.SpeechActionActivity (has extras)} from uid 10034
01-03 19:32:36.326   555  2523 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:36.337   555  2523 V SplashScreenExceptionList: SplashScreen checking exception for package ee.ioc.phon.android.speak (target sdk:32) -> false
01-03 19:32:36.349   555   584 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10087; state: DISABLED
01-03 19:32:36.349   555   584 D CompatibilityChangeReporter: Compat change id reported: 177438394; UID 10087; state: DISABLED
01-03 19:32:36.349   555   584 D CompatibilityChangeReporter: Compat change id reported: 135772972; UID 10087; state: DISABLED
01-03 19:32:36.349   555   584 D CompatibilityChangeReporter: Compat change id reported: 135754954; UID 10087; state: ENABLED
01-03 19:32:36.354   555   591 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10087; state: ENABLED
01-03 19:32:36.387   348   348 D Zygote  : Forked child process 6926
01-03 19:32:36.389   555   591 I ActivityManager: Start proc 6926:ee.ioc.phon.android.speak/u0a87 for next-top-activity {ee.ioc.phon.android.speak/ee.ioc.phon.android.speak.activity.SpeechActionActivity}
01-03 19:32:36.414  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.466  6926  6926 I Zygote  : seccomp disabled by setenforce 0
01-03 19:32:36.502  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.522  4372  4380 I adbd    : jdwp connection from 6926
01-03 19:32:36.560  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.586  6926  6926 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10087; state: ENABLED
01-03 19:32:36.585   555   555 I android.ui: type=1400 audit(0.0:1075): avc: denied { call } for scontext=u:r:system_server:s0 tcontext=u:r:zygote:s0 tclass=binder permissive=1
01-03 19:32:36.640  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.654  6926  6926 V GraphicsEnvironment: ANGLE Developer option for 'ee.ioc.phon.android.speak' set to: 'default'
01-03 19:32:36.654  6926  6926 V GraphicsEnvironment: ANGLE GameManagerService for ee.ioc.phon.android.speak: false
01-03 19:32:36.655  6926  6926 V GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
01-03 19:32:36.661  6926  6926 D NetworkSecurityConfig: No Network Security Config specified, using platform default
01-03 19:32:36.673  6926  6926 D NetworkSecurityConfig: No Network Security Config specified, using platform default
01-03 19:32:36.691  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.748  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.799  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.806  6926  6926 D CompatibilityChangeReporter: Compat change id reported: 210923482; UID 10087; state: DISABLED
01-03 19:32:36.806  6926  6926 D CompatibilityChangeReporter: Compat change id reported: 37756858; UID 10087; state: ENABLED
01-03 19:32:36.850  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.902  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.924   555  2523 D CoreBackPreview: Window{a1a6803 u0 ee.ioc.phon.android.speak/ee.ioc.phon.android.speak.activity.SpeechActionActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@3288db9, mPriority=0}
01-03 19:32:36.965  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:36.989  6926  6943 I DMABUFHEAPS: Using : Non-legacy ION heaps
01-03 19:32:37.001  6926  6943 I MESA    : Using IMapper v4 API
01-03 19:32:37.031  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:37.062   198   198 I hwservicemanager: getTransport: Cannot find entry android.hardware.configstore@1.0::ISurfaceFlingerConfigs/default in either framework or device VINTF manifest.
01-03 19:32:37.063  6926  6943 W OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
01-03 19:32:37.063  6926  6943 E OpenGLRenderer: Device claims wide gamut support, cannot find matching config, error = EGL_SUCCESS
01-03 19:32:37.063  6926  6943 W OpenGLRenderer: Failed to initialize 101010-2 format, error = EGL_SUCCESS
01-03 19:32:37.086   323   414 D SurfaceFlinger: display resolution: 1920x1080, density: 240.000000
01-03 19:32:37.087  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:37.095   197   197 I servicemanager: Could not find android.hardware.graphics.allocator.IAllocator/default in the VINTF manifest.
01-03 19:32:37.096  6926  6948 I Gralloc4: Adding additional valid usage bits: 0x0
01-03 19:32:37.099   307  3976 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 648x455, stride: 2592, map_stride: 0
01-03 19:32:37.102   307  3976 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 648x455, stride: 2592, map_stride: 0
01-03 19:32:37.107   307  3976 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 648x455, stride: 2592, map_stride: 0
01-03 19:32:37.138  3610  3610 E RippleDrawable: The RippleDrawable.STYLE_PATTERNED animation is not supported for a non-hardware accelerated Canvas. Skipping animation.
01-03 19:32:37.200  6926  6943 W Parcel  : Expecting binder but got null!
01-03 19:32:37.217   555   581 I ActivityTaskManager: Displayed ee.ioc.phon.android.speak/.activity.SpeechActionActivity: +888ms
01-03 19:32:37.236   555  2523 W ActivityTaskManager: Finishing task with all activities already finished
01-03 19:32:37.236   555  2523 W ActivityTaskManager: Duplicate finish request for r=ActivityRecord{aa97aa8 u0 android/com.android.internal.app.ResolverActivity} t523 f}}
01-03 19:32:37.268   555   918 W InputManager-JNI: Input channel object '9d402ab android/com.android.internal.app.ResolverActivity (client)' was disposed without first being removed with the input manager!
01-03 19:32:37.282   555  4747 D CompatibilityChangeReporter: Compat change id reported: 214016041; UID 10087; state: DISABLED
01-03 19:32:37.285  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:37.286   555  2612 W WindowManager: Failed looking up window session=Session{a814d64 3610:1000} callers=com.android.server.wm.WindowManagerService.windowForClientLocked:5901 com.android.server.wm.Session.setOnBackInvokedCallbackInfo:943 android.view.IWindowSession$Stub.onTransact:1200 
01-03 19:32:37.286   555  2612 E WindowManager: setOnBackInvokedCallback(): No window state for package:android
01-03 19:32:37.291   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8eab0
01-03 19:32:37.292   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc90b50
01-03 19:32:37.294   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc85ff0
01-03 19:32:37.302   555   918 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:37.304   555   918 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:37.331   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8c590
01-03 19:32:37.347   555   918 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8276879)
01-03 19:32:37.418   555  2523 D CoreBackPreview: Window{28c2955 u0 com.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@2002c5b, mPriority=0}
01-03 19:32:37.471   307  3976 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1848x1, stride: 7392, map_stride: 0
01-03 19:32:37.473   307  3976 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1848x1, stride: 7392, map_stride: 0
01-03 19:32:37.474   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1848x1, stride: 7392, map_stride: 0
01-03 19:32:37.498   555   581 I ActivityTaskManager: Displayed com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity: +184ms
01-03 19:32:37.538   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:37.566  6926  6926 D CompatibilityChangeReporter: Compat change id reported: 78294732; UID 10087; state: ENABLED
01-03 19:32:37.639  6926  6951 D CompatibilityChangeReporter: Compat change id reported: 150939131; UID 10087; state: ENABLED
01-03 19:32:37.667  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:37.685   555  4747 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:37.687   555  4747 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:37.719   555  4747 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8307813)
01-03 19:32:37.834   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:37.880   555  4747 D CoreBackPreview: Window{28c2955 u0 com.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity}: Setting back callback null
01-03 19:32:37.882   555  2523 W InputManager-JNI: Input channel object '28c2955 com.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity (client)' was disposed without first being removed with the input manager!
01-03 19:32:37.892   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc84a90
01-03 19:32:37.895   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8bc90
01-03 19:32:37.895   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8bc90
01-03 19:32:37.895   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc89290
01-03 19:32:37.895   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc84a90
01-03 19:32:37.926   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8c4d0
01-03 19:32:37.966   753   775 W System  : A resource failed to call release. 
01-03 19:32:37.967   753   775 W System  : A resource failed to call release. 
01-03 19:32:37.969   753   775 W System  : A resource failed to call release. 
01-03 19:32:37.970   753   775 W System  : A resource failed to call release. 
01-03 19:32:38.004  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:38.011   555   918 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:38.012   555   918 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:38.023   555  1129 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8308187)
01-03 19:32:38.027   323   417 W TransactionTracing: Could not find layer id -1
01-03 19:32:38.103   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:38.147   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8b3f0
01-03 19:32:38.214  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:38.222   555  2523 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:38.225   555  2523 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:38.252   555  1129 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8308491)
01-03 19:32:38.338   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:38.382   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8bc90
01-03 19:32:38.455  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:38.470   555  2523 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:38.475   555  2523 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:38.510   555  2523 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8308725)
01-03 19:32:38.594   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:38.601   555  1129 I WindowManager: Queue is too deep! Purged item with taskid=524
01-03 19:32:38.610   323   417 W TransactionTracing: Could not find layer id -1
01-03 19:32:38.627   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8bed0
01-03 19:32:38.688  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:38.703   555  2523 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:38.706   555  2523 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:38.729   555  2523 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8308982)
01-03 19:32:38.801   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:38.844   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc87d90
01-03 19:32:38.921  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:38.935   555  2523 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:38.938   555  2523 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:38.982   555  4747 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8309195)
01-03 19:32:39.079   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:39.088   555  4747 I WindowManager: Queue is too deep! Purged item with taskid=524
01-03 19:32:39.143   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc88e70
01-03 19:32:39.212  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:39.215   555  2523 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:39.217   555  2523 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:39.243   555  2523 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8309452)
01-03 19:32:39.304   555   572 I system_server: NativeAlloc concurrent copying GC freed 76933(4764KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 18MB/37MB, paused 411us,631us total 496.310ms
01-03 19:32:39.319   555   574 W System  : A resource failed to call HardwareBuffer.close. 
01-03 19:32:39.324   555   574 W System  : A resource failed to call HardwareBuffer.close. 
01-03 19:32:39.329   555   574 W System  : A resource failed to call HardwareBuffer.close. 
01-03 19:32:39.330   555   574 W System  : A resource failed to call release. 
01-03 19:32:39.330   555   574 W System  : A resource failed to call release. 
01-03 19:32:39.332   555   574 W System  : A resource failed to call HardwareBuffer.close. 
01-03 19:32:39.366   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:39.374   555  1129 I WindowManager: Queue is too deep! Purged item with taskid=524
01-03 19:32:39.410   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8bc90
01-03 19:32:39.450  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:39.467   555  1129 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:39.468   555  1129 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:39.499   555   918 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8309717)
01-03 19:32:39.583   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:39.628   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc89290
01-03 19:32:39.685  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:39.698   555   918 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:39.702   555   918 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:39.746   555   918 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8309966)
01-03 19:32:39.819   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:39.833   555  4747 I WindowManager: Queue is too deep! Purged item with taskid=524
01-03 19:32:39.877   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc854b0
01-03 19:32:39.879   323   417 W TransactionTracing: Could not find layer id -1
01-03 19:32:39.929  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:39.938   555  2523 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:39.944   555  2523 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:39.965   323   417 W TransactionTracing: Could not find layer id -1
01-03 19:32:39.972   555  4747 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8310215)
01-03 19:32:40.049   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:40.056   555   918 I WindowManager: Queue is too deep! Purged item with taskid=524
01-03 19:32:40.160  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:40.171   555   918 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:40.173   555   918 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:40.202   555  2612 W ActivityTaskManager: Tried to set launchTime (0) < mLastActivityLaunchTime (8310438)
01-03 19:32:40.224   323   417 W TransactionTracing: Could not find layer handle 0xb400006fcbc8d310
01-03 19:32:40.233   323   417 W TransactionTracing: Could not find layer id -1
01-03 19:32:40.271   555  2612 D CoreBackPreview: Window{194d36c u0 com.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity}: Setting back callback OnBackInvokedCallbackInfo{mCallback=android.window.IOnBackInvokedCallback$Stub$Proxy@36dc5ca, mPriority=0}
01-03 19:32:40.332   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1848x1, stride: 7392, map_stride: 0
01-03 19:32:40.337   307  3976 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1848x1, stride: 7392, map_stride: 0
01-03 19:32:40.342   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1848x1, stride: 7392, map_stride: 0
01-03 19:32:40.384   555   581 I ActivityTaskManager: Displayed com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity: +186ms
01-03 19:32:40.404  5292  5302 I ssioncontroller: Background concurrent copying GC freed 40233(1915KB) AllocSpace objects, 0(0B) LOS objects, 49% free, 4809KB/9618KB, paused 209us,52us total 130.576ms
01-03 19:32:40.431   307   340 V [minigbm:gbm_mesa_internals.cpp(425)]: Allocated: 1920x1080, stride: 7680, map_stride: 7680
01-03 19:32:40.544  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
01-03 19:32:40.555   555  2523 I ActivityTaskManager: START u0 {act=android.content.pm.action.REQUEST_PERMISSIONS pkg=com.android.permissioncontroller cmp=com.android.permissioncontroller/.permission.ui.GrantPermissionsActivity (has extras)} from uid 10087
01-03 19:32:40.563   555  2523 E CellBroadcastUtils: getDefaultCellBroadcastReceiverPackageName: no package found
01-03 19:32:40.584   555  5534 D CoreBackPreview: Window{194d36c u0 com.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity EXITING}: Setting back callback null
01-03 19:32:40.588   555  1129 W InputManager-JNI: Input channel object '194d36c com.android.permissioncontroller/com.android.permissioncontroller.permission.ui.GrantPermissionsActivity (client)' was disposed without first being removed with the input manager!
(and so on...)

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?

Kaljurand commented 1 year ago

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.

r0d0dendr0n commented 1 year ago

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.

r0d0dendr0n commented 1 year ago

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.

Kaljurand commented 1 year ago

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 SpeechActionActivity (this is an activity dialog panel that is provided by Kõnele, not Kõnele service, i.e. you'd need to have Kõnele installed):

01-03 19:32:36.316   555  2523 I ActivityTaskManager: START u0 {act=android.intent.action.ASSIST flg=0x13200000 cmp=ee.ioc.phon.android.speak/.activity.SpeechActionActivity (has extras)} from uid 10034
01-03 19:32:36.389   555   591 I ActivityManager: Start proc 6926:ee.ioc.phon.android.speak/u0a87 for next-top-activity {ee.ioc.phon.android.speak/ee.ioc.phon.android.speak.activity.SpeechActionActivity}

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).

01-03 19:32:37.667  2451  2451 I RecognitionService: caller doesn't have permission:android.permission.RECORD_AUDIO
r0d0dendr0n commented 1 year ago

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.

r0d0dendr0n commented 1 year ago

OK, thanks for these details! Make sure "Settings -> Privacy -> Microphone access" is enabled.

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.

You could also try to check a few things:

  • does speech input work in the Kõnele keyboard?

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.)

* does speech input work when Kõnele is launched via its launcher icon (or via an other app, e.g. Maps, ...)

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.

* does speech input work via Google's service (which for LineageOS, you can get via GApps, I guess), or any other speech recognition provider?

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 :-).

* does a basic sound recorder app work?

Yes, all apps I tried are working fine with my mic.

Kaljurand commented 1 year ago

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.

r0d0dendr0n commented 1 year ago

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.

r0d0dendr0n commented 1 year ago

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.

Kaljurand commented 1 year ago

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.)

Kaljurand commented 1 year ago

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 Settings -> System -> Languages & input -> Speech -> Voice input to Kaldi/Vosk Recognizer. After giving it mic permissions, the app works via its launcher icon, i.e. one can dictate and see the resulting (English) transcription.

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:

        <service
            android:name=".VoskRecognitionService"
            android:process=":speechProcess"
            android:icon="@drawable/ic_service_trigger"
            android:label="@string/vosk_recognition_service"
            android:permission="android.permission.RECORD_AUDIO">

One should add:

           android:exported="true"
            android:foregroundServiceType="microphone"

And at the manifest root level:

    <queries>
        <intent>
            <!-- Packages that provide speech recognition services -->
            <action android:name="android.speech.RecognitionService" />
        </intent>
    </queries>
Kaljurand commented 1 year ago

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:

    <queries>
        <intent>
            <action android:name="android.speech.RecognitionService" />
        </intent>
    </queries>

so perhaps this is enough.

nebkrid commented 1 year ago

Hi, I also have issues with Android 13 (but ~not~ on Samsung mobile hardware, not TV.) To be exact, I just can't find the menu point to choose the default-speech-recognition service (Which was in previous version within the Assistent menu). I also had a look into Settings -> System -> Languages & input -> Speech -> Voice input But within voice input I only find a menu to choose downloading offline speech, which I guess is provided by google or Samsung. I can not switch to any other speech recognition. Am I in the correct menu?

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 :)

grafik grafik grafik

Kaljurand commented 1 year ago

@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.

Screenshot_20230218-170644 Screenshot_20230218-170420 Screenshot_20230218-145356

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).

nebkrid commented 1 year ago

@Kaljurand thank you very much for your answer and sorry for my late reply. Your answer really helps me a lot since so it seems that this is not a general Android 13 issue (that's why I added it to this topic, since I was so confused about this "Android 13" behaviour that I guessed it still might be related with some missing permissions or manifest entries) but a specific Samsung implementation (yes you guessed correct: I indeed meant on Samsung hardware.)