mt8163 / android_device_amazon_karnak_old

Android device tree for the Amazon Fire HD8 2018
GNU General Public License v2.0
9 stars 0 forks source link

microphone doesnt work, selinux implicated #26

Open opalapo opened 1 year ago

opalapo commented 1 year ago

Issue

microphone does not work at all

Build

lineage-20.0-20230104-UNOFFICIAL-karnak.zip

Device

karnak

Notes:

not in recorder or in any other app headset mic also not working i do not have a bluetooth mic to test recorder produces zero-duration files recorder crashes unless high quality recording is enabled this is with install of only lineage and magisk 25.2

Troubleshooting Info

logcat pipe to grep for microphone

E SELinux : avc:  denied  { find } for pid=1949 uid=2000 name=android.hardware.microphone scontext=u:r:shell:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=1

dmesg -w when using recorder

06-06 13:29:06.030   302   343 E AudioALSAStreamManager: -setParameters(), do nothing, return
06-06 13:29:06.030   302   343 E AudioALSAHardware: Err createAudioPatch 4844
06-06 13:29:06.030   302   343 E AudioALSAHardware: Fail status -1
06-06 13:29:06.046  3349  3349 E AudioRecord: start(15): status -61

selinux info


$ adb logcat -d | grep microphone -B 100 -A 100 > logfile.txt
$ adb pull /sys/fs/selinux/policy SEPOLICY_FILE

$ cat logfile.txt | audit2allow -w -p SEPOLICY_FILE

06-06 12:52:16.870   217   217 E SELinux : avc:  denied  { find } for pid=1949 uid=2000 name=android.hardware.microphone scontext=u:r:shell:s0 tcontext=u:object_r:default_android_service:s0 tclass=service_manager permissive=1

Was caused by:
Missing type enforcement (TE) allow rule.

You can use audit2allow to generate a loadable module to allow this access.

$ cat logfile.txt | audit2allow -p SEPOLICY_FILE

#============= shell ==============
allow shell default_android_service:service_manager find;
R0rt1z2 commented 1 year ago

SELinux is configured in Permissive mode, so it's not the primary issue here. Could you kindly supply complete log files?

opalapo commented 1 year ago

here ya go! full_logfile.txt

opalapo commented 1 year ago

microphone works in recorder on lineage-18.1-20211028-UNOFFICIAL-karnak.zip

opalapo commented 1 year ago

does not work on lineage-20.0-20221230-UNOFFICIAL-karnak.zip