pulseaudio can't record on LineageOS 20 / Android 13?

So, I have a Xiaomi Smart Clock running LineageOS 20 (Android 13) that I'm trying to get Wyoming in Termux (https://github.com/T-vK/wyoming-satellite-termux/tree/main) running on. I am able to get everything installed and running ... but it seems like the mic isn't getting any input. If I use termux-microphone-record I'm able to record audio and play it back with termux-media-player but when I try to use sox (via rec) or parecord , the output file is exclusively 0x00 data. This is even if I run pactl load-module module-sles-source immediately before. I granted mic permission to Termux:API and the fact that the mic works with termux-microphone-record makes me think this isn't an Android permissions issue. I am seeing the green microphone icon in the status bar when I run rec or parecord but still getting 0x00 output in files. If I run pulseaudio with the following command line pulseaudio -L module-sles-source -D --log-level=4 --log-target=file:/data/data/com.termux/files/home/pa.log --log-time=0 and then run rec yay.wav I see the attached in the log which doesn't show any obvious issue. The only notable thing in the output of rec is that the time increments much much much slower than wall time (e.g. it takes more than 5 seconds to record 5 seconds of audio)
GitHub
GitHub - T-vK/wyoming-satellite-termux: A set of scripts allowing y...
A set of scripts allowing you to run wyoming-satellite on Android with Termux - T-vK/wyoming-satellite-termux
2 Replies
jasonanovak
jasonanovakOP6d ago
In case it is helpful, here's the output of termux-info
~ $ termux-info
Termux Variables:
TERMUX_API_VERSION=0.51.0
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=3481
TERMUX_APP__BUILD_DATA_DIR=/data/data/com.termux
TERMUX_APP__DATA_DIR=/data/user/0/com.termux
TERMUX_APP__LEGACY_DATA_DIR=/data/data/com.termux
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c139,c256,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.2
TERMUX__HOME=/data/data/com.termux/files/home
TERMUX__PREFIX=/data/data/com.termux/files/usr
TERMUX__ROOTFS=/data/data/com.termux/files
TERMUX__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c139,c256,c512,c768
TERMUX__USER_ID=0
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://mirror.vern.cc/termux/termux-main stable main
Updatable packages:
All packages up to date
termux-tools version:
1.45.0
Android version:
13
Kernel build information:
Linux localhost 4.14.141+ #1 SMP PREEMPT Tue Dec 14 13:16:21 UTC 2021 armv7l Android
Device manufacturer:
unknown
Device model:
Phh-Treble vanilla
Supported ABIs:
SUPPORTED_ABIS: armeabi-v7a,armeabi
SUPPORTED_32_BIT_ABIS: armeabi-v7a,armeabi
SUPPORTED_64_BIT_ABIS:
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec-ld-preload.so
Installed termux plugins:
com.termux.api versionCode:1000
~ $
~ $ termux-info
Termux Variables:
TERMUX_API_VERSION=0.51.0
TERMUX_APK_RELEASE=GITHUB
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=3481
TERMUX_APP__BUILD_DATA_DIR=/data/data/com.termux
TERMUX_APP__DATA_DIR=/data/user/0/com.termux
TERMUX_APP__LEGACY_DATA_DIR=/data/data/com.termux
TERMUX_APP__SE_FILE_CONTEXT=u:object_r:app_data_file:s0:c139,c256,c512,c768
TERMUX_APP__SE_INFO=default:targetSdkVersion=28:complete
TERMUX_IS_DEBUGGABLE_BUILD=1
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.2
TERMUX__HOME=/data/data/com.termux/files/home
TERMUX__PREFIX=/data/data/com.termux/files/usr
TERMUX__ROOTFS=/data/data/com.termux/files
TERMUX__SE_PROCESS_CONTEXT=u:r:untrusted_app_27:s0:c139,c256,c512,c768
TERMUX__USER_ID=0
Packages CPU architecture:
arm
Subscribed repositories:
# sources.list
deb https://mirror.vern.cc/termux/termux-main stable main
Updatable packages:
All packages up to date
termux-tools version:
1.45.0
Android version:
13
Kernel build information:
Linux localhost 4.14.141+ #1 SMP PREEMPT Tue Dec 14 13:16:21 UTC 2021 armv7l Android
Device manufacturer:
unknown
Device model:
Phh-Treble vanilla
Supported ABIs:
SUPPORTED_ABIS: armeabi-v7a,armeabi
SUPPORTED_32_BIT_ABIS: armeabi-v7a,armeabi
SUPPORTED_64_BIT_ABIS:
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec-ld-preload.so
Installed termux plugins:
com.termux.api versionCode:1000
~ $
jasonanovak
jasonanovakOP6d ago
For completeness: - Installing the pulseaudio build without memfd from https://github.com/termux/termux-packages/issues/21660 doesn't fix it - Changing the config to use aaudio as a sink doesn't fix it - https://github.com/termux/termux-packages/issues/19623#issuecomment-2123168051 - And because this isn't running OneUI, I don't have /system/lib64/libskcodec.so to preload
GitHub
[Bug]: PulseAudio not working on 32bit Android · Issue #21660 · t...
Problem description On 32bit arm Android devices, PulseAudio does not appear to work properly. I'm trying to load module-sles-source in order to access the microphone. Some people suggest setti...
GitHub
[Bug]: PulseAudio cannot hook to OpenSL ES after One UI 6.1 update ...
Problem description So not too long ago my device (Samsung Galaxy S23 Ultra) gotten One UI 6.1 update and then after I noticed that exact same environment I use does not reproduce any audio. At fir...

Did you find this page helpful?