Skip to content
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

Audio on Linux Deploy/CHROOT for Android 10/11/12? #1271

Open
falkor2k15 opened this issue Jun 28, 2021 · 7 comments
Open

Audio on Linux Deploy/CHROOT for Android 10/11/12? #1271

falkor2k15 opened this issue Jun 28, 2021 · 7 comments

Comments

@falkor2k15
Copy link

I looked at some old methods from 2015/2017, but none seem to be working now.

Does anyone have an up-to-date method that's confirmed to work with recent Android devices/security?

Incidentally, it works with PROOT: Termux is setup as a Pulse Audio server (built in) and then the proot distro is set to export audio to the localhost, i.e. the Termux server.

Of course, Linux Deploy cannot send it's audio to Termux unless we can perhaps find a way to run LD CHROOT through Termux instead of using the Start button in the LD app? Other Android apps acting as Pulse Audio server (or as somewhere to "stream" the audio to so to speak), such as Simple Protocol or PulseDroid no longer seem to work for whatever reason(s).

Besides Pulse Audio there's also some Alsa utils, but those methods seem too outdated. XSDLserver apparently has a built in Pulse Audio server like Termux, but is no longer working out of the box.

@abs0023
Copy link

abs0023 commented Jun 28, 2021

hey falkor I'm really a noob so I understand about 10% of what you saying but the way I told you to get the sound working i linux deploy still works for me.

@abs0023
Copy link

abs0023 commented Jun 28, 2021

buy the way where you from? out of topic though
because if you can get a oneplus 6( as your looking for a mobile now, it's two years old but still have great hardware) you can run android/linux in dual boot, so you can still play with deploy in android and have a taste what can be a linux phone, for more information check the postmarketos project or for less information the mobian project.

@falkor2k15
Copy link
Author

Sound works for you in Linux Deploy? It sure doesn't work for me, and according to one source getting audio working in CHROOT has been a long-standing problem. I heard the issue can be device specific, and people have had more luck with XSDL output whereas I am using VNC. Either way I have been unsuccessful, and there evidently hasn't been any discussion about (pulse) audio/LD in a number of years.

I am from London, and there are Android phones littered all over the place - but you cannot rely on there being any particular model available, such as the OnePlus 6 unless you order online. Therefore, although I love your idea, I try to find one solution fits all - and since root is seldom available without extra tools, Linux Deploy is more a secondary consideration compared to PROOT, which may be more the viable way to go - complete with guaranteed working sound.

@falkor2k15
Copy link
Author

OK I got audio to work with XSDL X server - just had to increment the port number by 1! I also found out that XSDL has graphics acceleration, so can run more apps compared to VNC, such as Pinta. Perhaps more desktop environments will also display; PROOT might even work with XSDL too - with or without graphics acceleration? Shame the app is a bit clunky though and hijacks the Android mouse cursor.

@MatejMagat305
Copy link

like I write in #1297 you can use termux (I recomend from fdroid), then you need put to /etc/profile this: export PULSE_SERVER=127.0.0.1
then turn of linux.

go to termux and install pulseaudio pkg install pulseaudio, then you put theese comand (every times before you start linux - I have this in script):

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

the original recomend auth-anonymous=1 too, but I run it without this command......, and finaly run linux and enjoy it!

@yingshaoxo
Copy link

If you guys also need to record audio, see this:

termux/termux-app#2871 (comment)


The only problem is how to let pulseaudio take termux microphone as mic_input remotely

@yingshaoxo
Copy link

yingshaoxo commented Sep 14, 2023

I solved this problem by doing:

  1. Install LinuxDeploy apk; Install busybox apk, install busybox payloads, reboot your phone

  2. Select Ubuntu, bionic, File, image size 60GB, set username and password, enable ssh, enable vnc gui, select xfce. Hit the install button, hit the configure button, hit the start button.

  3. Install "termux" apk, install "com.termux.api" apk

  4. In termux

    
    pkg update
    
    pkg install pulseaudio
    
    pkg install termux-api
    
    
    
    termux-microphone-record -l 3
    
    
    
    pulseaudio --start --exit-idle-time=-1
    
    pacmd load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1
    
    pacmd load-module module-sles-source
    
    pactl load-module module-sles-source
    
    ```
    
    
  5. In LinuxDeploy system, add "export PULSE_SERVER=127.0.0.1" to the end of "/etc/profile", do a reboot

  6. Use fakestandby apk to make sure the network is always on:

  7. Now when you use vnc enter your linux system, you should be able to use microphone and speaker without any problems.

https://yingshaoxo.blogspot.com/2023/09/how-to-let-linuxdeploy-desktop-audio.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants