mobox icon indicating copy to clipboard operation
mobox copied to clipboard

No sound and aaudio-sink causes new problems

Open DefeatWinter opened this issue 1 year ago • 24 comments

In winecfg, I cannot hear anything after clicking "test sound". I dunno what's happening from debug log. I also played some MP3 file using winamp, it did play, but no sound. mobox_log.txt

Another problem is the system freezes every 3-4 seconds. After booting, waiting for a few seconds, I cannot move the cursor anymore. But after I change the foreground app from X11 to others and then back to X11, I can move my cursor for 3-4 sec before it freeze again. I could fix it on my device in an awkward way: make termux a floating window, since I need to prevent it from low memory killer anyway.

Info of my device: Huawei matepad pro kirin 990 harmonicOS 4.0

PS: I tried exagear and winlator before, and mobox is the only one that can run dohna dohna without black screen, so I really want to fix the sound issue lol

DefeatWinter avatar Dec 28 '23 14:12 DefeatWinter

ok I solve it!( perhaps because I uninstalled mobox I think it's neither the problem of mobox not termux(no, it is) pulseaudio does not function on my device, Huawei did some trick https://github.com/termux/termux-packages/issues/11208 just start pulseaudio with aaudio-sink module then good to go freezing problem comes from termux because you put it background just change system settings

DefeatWinter avatar Dec 30 '23 02:12 DefeatWinter

fixed! /data/data/com.termux/files/usr/etc/pulse/default.pa need to modify this file. load module - aaudio-sink in the last line. and use winecfg to configure audio. be aware that aaudio seems to be unstable, as reported somewhere https://github.com/termux/termux-packages/issues/13965

DefeatWinter avatar Dec 30 '23 06:12 DefeatWinter

Bug step1

How to produce the bug

Start wine in mobox. Modify Z:/usr/etc/pulse/default.pa The original file looks like

...
### Allow including a default.pa.d directory, which if present, can be used
### for additional configuration snippets.
### Note that those snippet files must have a .pa file extension, not .conf
.nofail
.include /data/data/com.termux/files/usr/etc/pulse/default.pa.d
load-module module-sles-sink
#load-module module-aaudio-sink

Then remove # for load-module module-aaudio-sink in the file. For those who use Honor/Huawei devices, this might be how to make Termux work (not mobox yet). Check using pulseaudio -v or espeak -w /proc/self/fd/1 "This is an example text" | play - if you installed espeak and sox. Then I have the bug usually after I reboot wine system.

Expected Behavior

Open winecfg, in Audio column, the selected driver is pulseaudio.drv, the speaker configuration has two records pulseaudio and aaudio (no dummy), and clicking on test sound yields a little beep.

Bug description

Open winecfg, click Audio column, then it would take a minute to load items in Audio column. The selected driver is None, there's nothing in speaker configuration. Apart from that, the console in Termux is different:

patchelf: open: Text file busy
patchelf: open: Text file busy
Enter 1 to stop

Sometimes I have two or more outputs of Enter 1 to stop. Unless a miracle occurs (once for me), there's no way to get pulseaudio.drv back unless reinstall wine-ge-custom/wine-8.0.2

Possibly related log

Here's what I've found in mobox_log.txt:

...
0204:err:mmdevapi:DllGetClassObject Driver initialization failed
0204:err:ole:apartment_getclassobject DllGetClassObject returned error 0x80004005 for dll L"C:\\windows\\system32\\mmdevapi.dll"
0204:err:ole:com_get_class_object no class object {bcde0395-e52f-467c-8e3d-c4579291692e} could be created for context 0x1

Here's the file. mobox_log.txt I searched for these errors, and reports mainly come from Linux system.

Request

A mobox (also termux-box, I will check it in the future) version that is compatible with pulseaudio loading module-aaudio-sink?

Bug step2

How to "fix" Bug 1

Again in default.pa, find

### Automatically suspend sinks/sources that become idle for too long
#load-module module-suspend-on-idle

remove # for load-module module-suspend-on-idle. And #load-module module-sles-sink. Make sure to do this before playing audio in wine.

New problem

The sound in wine is crackling, even playing a mp3 file using winamp. K-Lite Codec Pack is not working. Sound is perfect from termux using play ***.mp3. Reinstall wine will not fix the problem, but reboot android system could. At first, the sound is perfect until you reboot wine system. And you'll never get the perfect voice back.

Possible explanation

I can't believe this problem, with high probability, has something to do with my Bluetooth earphone! The above events did not occur after I disconnected the earphone...well... I got another bluetooth earphone and several wired earphones...I will test...

DefeatWinter avatar Dec 31 '23 08:12 DefeatWinter

I tried your method and the problem was solved, but only temporarily. Once or twice when I turned it on and played a game, there was sound and then it stopped sounding like before. Then I tried to try again and it doesn't fix it anymore even though I edited default.pa

akcayemircan56 avatar Mar 04 '24 07:03 akcayemircan56

I tried your method and the problem was solved, but only temporarily. Once or twice when I turned it on and played a game, there was sound and then it stopped sounding like before. Then I tried to try again and it doesn't fix it anymore even though I edited default.pa

perhaps you can provide more information, like your device or some debugging results? I cant remember the bug clearly because it's month ago. I feel the problem is termux and Huawei are not compatible, so perhaps you could try pulseaudio -v or espeak -w /proc/self/fd/1 "This is an example text" | play - in the console of termux, and post what you find here. For me, the problem is aaudio-sink is suspended (I found this in the log of pulseaudio -v)

DefeatWinter avatar Mar 04 '24 08:03 DefeatWinter

I tried your method and the problem was solved, but only temporarily. Once or twice when I turned it on and played a game, there was sound and then it stopped sounding like before. Then I tried to try again and it doesn't fix it anymore even though I edited default.pa

perhaps you can provide more information, like your device or some debugging results? I cant remember the bug clearly because it's month ago. I feel the problem is termux and Huawei are not compatible, so perhaps you could try pulseaudio -v or espeak -w /proc/self/fd/1 "This is an example text" | play - in the console of termux, and post what you find here. For me, the problem is aaudio-sink is suspended (I found this in the log of pulseaudio -v) When I use pulseaudio -v I get a supending error: Screenshot_20240304_124409_com termux

The other command (espeak -w /proc/self/fd/1 "This is an example text" | play -)works normally and the sound is heard

My tablet is a Huawei Matepad 11.5

akcayemircan56 avatar Mar 04 '24 09:03 akcayemircan56

I tried your method and the problem was solved, but only temporarily. Once or twice when I turned it on and played a game, there was sound and then it stopped sounding like before. Then I tried to try again and it doesn't fix it anymore even though I edited default.pa

perhaps you can provide more information, like your device or some debugging results? I cant remember the bug clearly because it's month ago. I feel the problem is termux and Huawei are not compatible, so perhaps you could try pulseaudio -v or espeak -w /proc/self/fd/1 "This is an example text" | play - in the console of termux, and post what you find here. For me, the problem is aaudio-sink is suspended (I found this in the log of pulseaudio -v) When I use pulseaudio -v I get a supending error: Screenshot_20240304_124409_com termux

The other command (espeak -w /proc/self/fd/1 "This is an example text" | play -)works normally and the sound is heard

My tablet is a Huawei Matepad 11.5

I just tried running mobox after updating but everything tells me I need directsound and I have no sound, im missing sound dirve now lol But then I switch the wine container from wine-custom to wine-8.0.2, the sound is back again. Im not sure what is causing the problem. so perhaps you could try install winamp on wine and play some music, it told me there is no sound drive, i wonder what you might see

DefeatWinter avatar Mar 04 '24 13:03 DefeatWinter

I tried your method and the problem was solved, but only temporarily. Once or twice when I turned it on and played a game, there was sound and then it stopped sounding like before. Then I tried to try again and it doesn't fix it anymore even though I edited default.pa

perhaps you can provide more information, like your device or some debugging results? I cant remember the bug clearly because it's month ago. I feel the problem is termux and Huawei are not compatible, so perhaps you could try pulseaudio -v or espeak -w /proc/self/fd/1 "This is an example text" | play - in the console of termux, and post what you find here. For me, the problem is aaudio-sink is suspended (I found this in the log of pulseaudio -v) When I use pulseaudio -v I get a supending error: Screenshot_20240304_124409_com termux

The other command (espeak -w /proc/self/fd/1 "This is an example text" | play -)works normally and the sound is heard My tablet is a Huawei Matepad 11.5

I just tried running mobox after updating but everything tells me I need directsound and I have no sound, im missing sound dirve now lol But then I switch the wine container from wine-custom to wine-8.0.2, the sound is back again. Im not sure what is causing the problem. so perhaps you could try install winamp on wine and play some music, it told me there is no sound drive, i wonder what you might see

As seen in the videos in my bug report, the sound problem was solved until I shut down the termux and restarted mobox and wine. Then I checked winecfg and the sound driver was none and I couldn't open sleeping dogs which I normally can.

Also when I clicked on verify integrity of local files in the mobox interface I saw that two files were missing and had to be reinstalled:

https://github.com/olegos2/mobox/assets/82875458/07a624d7-f333-4f5f-9637-f5c31ddfd0f7

Unfortunately nothing changed after these files were reinstalled:

https://github.com/olegos2/mobox/assets/82875458/931972c0-27e7-4984-85a9-6f122fcd428a

Log file: mobox_log.txt

And after this error, I noticed that the "espeak -w /proc/self/fd/1 "This is an example text" | play -" command worked but there was no sound.

akcayemircan56 avatar Mar 04 '24 19:03 akcayemircan56

@olegos2 Is there any solution for this error?

akcayemircan56 avatar Mar 25 '24 07:03 akcayemircan56

@DefeatWinter Did you find any solution for Audio driver: (none) error Noe this is also a issue on s23 series

OmkarVedpathak avatar Apr 07 '24 22:04 OmkarVedpathak

Adding this here for anyone in the future. Another solution is to add this to the front of the pulse audio command. This should fix pulse audio.

File: /data/data/com.termux/files/usr/glibc/opt/scripts/start-tfm

Before:

pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

After:

LD_PRELOAD=/system/lib64/libskcodec.so pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

gtaforever00 avatar May 05 '24 05:05 gtaforever00

Adding this here for anyone in the future. Another solution is to add this to the front of the pulse audio command. This should fix pulse audio.

File: /data/data/com.termux/files/usr/glibc/opt/scripts/start-tfm

Before:

pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

After:

LD_PRELOAD=/system/lib64/libskcodec.so pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

I tried your solution it gaved this error: Screenshot_20240505_101125_com termux

Emircan56 avatar May 05 '24 07:05 Emircan56

Guys just Install Dark OS, if you're using s23 series, just run this code on termux. "nano ../usr/etc/bash.bashrc" And add this command in the last line I the edit....

"LD_PRELOAD=/system/lib64/libskcodec.so pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1"

I couldn't fix it on Mobox but Dark os does fixed, but problem would occur again if you wipe termux data or reinstall.

Stan7827 avatar May 05 '24 17:05 Stan7827

Adding this here for anyone in the future. Another solution is to add this to the front of the pulse audio command. This should fix pulse audio. File: /data/data/com.termux/files/usr/glibc/opt/scripts/start-tfm Before: pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 After: LD_PRELOAD=/system/lib64/libskcodec.so pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

I tried your solution it gaved this error: Screenshot_20240505_101125_com termux

Here is what mine looks like. I'm using a zflip 5 sd8gen2 on OneUI 6.1

Screenshot_20240504_231214_Termux

gtaforever00 avatar May 05 '24 19:05 gtaforever00

Adding this here for anyone in the future. Another solution is to add this to the front of the pulse audio command. This should fix pulse audio. File: /data/data/com.termux/files/usr/glibc/opt/scripts/start-tfm Before: pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 After: LD_PRELOAD=/system/lib64/libskcodec.so pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

I tried your solution it gaved this error: Screenshot_20240505_101125_com termux

Here is what mine looks like. I'm using a zflip 5 sd8gen2 on OneUI 6.1

Screenshot_20240504_231214_Termux

And it worked?

Stan7827 avatar May 05 '24 19:05 Stan7827

Adding this here for anyone in the future. Another solution is to add this to the front of the pulse audio command. This should fix pulse audio. File: /data/data/com.termux/files/usr/glibc/opt/scripts/start-tfm Before: pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 After: LD_PRELOAD=/system/lib64/libskcodec.so pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

I tried your solution it gaved this error: Screenshot_20240505_101125_com termux

Here is what mine looks like. I'm using a zflip 5 sd8gen2 on OneUI 6.1 Screenshot_20240504_231214_Termux

And it worked?

Yes it worked

gtaforever00 avatar May 05 '24 19:05 gtaforever00

Adding this here for anyone in the future. Another solution is to add this to the front of the pulse audio command. This should fix pulse audio. File: /data/data/com.termux/files/usr/glibc/opt/scripts/start-tfm Before: pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 After: LD_PRELOAD=/system/lib64/libskcodec.so pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

I tried your solution it gaved this error: Screenshot_20240505_101125_com termux

Here is what mine looks like. I'm using a zflip 5 sd8gen2 on OneUI 6.1 Screenshot_20240504_231214_Termux

And it worked?

Yes it worked

Even when you close termux entirely?

Stan7827 avatar May 05 '24 19:05 Stan7827

Even when you close termux entirely?

@Stan7827

Yes works for me when you force close termux, reboot mobox, etc

gtaforever00 avatar May 05 '24 19:05 gtaforever00

Even when you close termux entirely?

@Stan7827

Yes works for me when you force close termux, reboot mobox, etc

I'll give it a try

Stan7827 avatar May 05 '24 19:05 Stan7827

Adding this here for anyone in the future. Another solution is to add this to the front of the pulse audio command. This should fix pulse audio. File: /data/data/com.termux/files/usr/glibc/opt/scripts/start-tfm Before: pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1 After: LD_PRELOAD=/system/lib64/libskcodec.so pulseaudio --start --load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" --exit-idle-time=-1

I tried your solution it gaved this error: Screenshot_20240505_101125_com termux

Here is what mine looks like. I'm using a zflip 5 sd8gen2 on OneUI 6.1 Screenshot_20240504_231214_Termux

And it worked?

Yes it worked

Even when you close termux entirely?

It worked. Thank you so much.

Stan7827 avatar May 05 '24 20:05 Stan7827

@DefeatWinter @Stan7827 Please can you help me

My s23 ultra suddenly has no sound and mic is not working after software update, I'm not really clear on how you solved yours can you please guide me on the steps to follow

Payuski avatar Sep 01 '24 22:09 Payuski

@DefeatWinter @Stan7827 Please can you help me

My s23 ultra suddenly has no sound and the mic is not working after software update, I'm not really clear on how you solved yours can you please guide me on the steps to follow

Pls be more specific about the issue.

Stan7827 avatar Sep 02 '24 00:09 Stan7827

@Stan7827 The issue is my s23 ultra was working perfectly fine until it suddenly stopped producing sound and the mic stopped working, I can't make calls or send voice notes, I restarted the phone and even factory reset it but it still same issue. The phone is literally deaf and dumb.

I searched online to see if there are users with similar issues and that's how I found this thread. I think it's a software update bug from Samsung but I'm not sure how to resolve it. I'm running on one UI 6.1 and android 14

Payuski avatar Sep 02 '24 06:09 Payuski

@Stan7827 The issue is my s23 ultra was working perfectly fine until it suddenly stopped producing sound and the mic stopped working, I can't make calls or send voice notes, I restarted the phone and even factory reset it but it still same issue. The phone is literally deaf and dumb.

I searched online to see if there are users with similar issues and that's how I found this thread. I think it's a software update bug from Samsung but I'm not sure how to resolve it. I'm running on one UI 6.1 and android 14

Good day. This thread is exclusively for Mobox and Darkos emulator users. It addresses specific issues encountered by users of these emulators and provides solutions that require the system software sounds to be active. If your issue is not related to the Mobox/Darkos emulator or if the system software sounds are not active, this thread may not be able to resolve your problem. In such cases, I recommend that you contact the Samsung manufacturer for assistance. This thread is intended for users running Linux-based systems on their devices.

Stan7827 avatar Sep 02 '24 09:09 Stan7827