What is PulseAudio?
PulseAudio is a sound server -- a program that manages audio on Linux. It sits between your applications (music players, browsers, video players) and your actual audio hardware (speakers, headphones, Bluetooth devices), routing sound from where it is produced to where you want to hear it.
In ADL, PulseAudio solves a specific problem: your Linux applications run inside Ubuntu through proot, but your phone's speakers and audio hardware are controlled by Android. PulseAudio bridges that gap.
What a Sound Server Doesโ
Without a sound server, each application would need to talk directly to the audio hardware. That creates problems:
- Only one application could play sound at a time
- There would be no system-wide volume control
- Switching audio output (speakers to headphones) would require restarting applications
- Different applications might conflict over audio access
A sound server acts as a central hub:
PulseAudio mixes audio from all applications together, applies volume adjustments, and sends the combined output to your chosen audio device.
How Audio Works in ADLโ
The ADL audio architecture has a unique challenge. Your Linux applications are running inside Ubuntu (through proot inside Termux), but they cannot directly access the phone's audio hardware because proot does not provide real hardware access.
The solution uses a TCP connection over localhost (the phone's internal network):
- PulseAudio runs inside Termux (the Android side), where it can access the phone's audio hardware
- Applications in Ubuntu are configured to send audio to a PulseAudio server at
127.0.0.1(localhost) on a specific port - PulseAudio in Termux receives the audio data and plays it through Android's audio system
The TCP Localhost Connectionโ
The key architectural detail is the TCP connection. Here is what happens step by step:
- PulseAudio starts in Termux and listens on TCP port 4713 at address
127.0.0.1 - Inside the proot Ubuntu environment, the
PULSE_SERVERenvironment variable is set totcp:127.0.0.1:4713 - When a Linux application plays audio, it connects to that address
- Audio data flows over this local TCP connection from the proot environment to Termux
- PulseAudio in Termux outputs the audio through Android
This works because 127.0.0.1 (localhost) is shared between Termux and the proot environment -- they are on the same device, so local network connections work seamlessly.
The TCP connection adds negligible latency. Since the data never leaves your phone (it goes from one process to another on the same device), the delay is imperceptible. Audio playback sounds normal.
Setting Up Audioโ
The ADL setup guides walk through audio configuration step by step. If you need to set it up manually or troubleshoot, here are the key pieces:
Termux Side (PulseAudio Server)โ
In Termux, PulseAudio needs to be installed and started:
pkg install pulseaudioTo start PulseAudio listening on TCP:
pulseaudio --start --load='module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1' --exit-idle-time=-1Ubuntu Side (Client Configuration)โ
Inside the proot Ubuntu environment, applications need to know where to send audio:
export PULSE_SERVER=tcp:127.0.0.1:4713This variable is usually set in the startup script that launches your desktop.
If you have no audio, the most common cause is that PulseAudio is not running in Termux. Before troubleshooting inside Ubuntu, switch to the Termux terminal and verify PulseAudio is active with pulseaudio --check. If it returns an error, restart it with the command above.
Volume Controlโ
Once PulseAudio is working, you can control volume at multiple levels:
| Level | How to Adjust | What It Affects |
|---|---|---|
| Android volume | Phone's physical volume buttons | Master output level |
| PulseAudio system volume | pavucontrol in Ubuntu, or XFCE volume plugin | All Linux audio |
| Per-application volume | pavucontrol Playback tab | Individual application volume |
| Application-internal | Volume controls within the app itself | Only that app |
pavucontrol (PulseAudio Volume Control) is a graphical tool that gives you full control over audio routing and volume levels. Install it inside Ubuntu:
sudo apt install pavucontrolTroubleshooting Audioโ
| Symptom | Likely Cause | Fix |
|---|---|---|
| No sound at all | PulseAudio not running in Termux | Start PulseAudio in Termux |
| No sound at all | PULSE_SERVER not set in Ubuntu | Add export PULSE_SERVER=tcp:127.0.0.1:4713 to your startup script |
| Sound is choppy | High CPU usage or buffer issues | Close some applications, or increase PulseAudio buffer size |
| Sound works then stops | PulseAudio crashed or was killed | Restart PulseAudio in Termux |
| Bluetooth audio not working | Android Bluetooth not connected | Connect Bluetooth device through Android settings first |
If audio was working and then stopped, Android may have killed the Termux PulseAudio process in the background. Switch to Termux and restart PulseAudio. Excluding Termux from battery optimization (Android Settings > Apps > Termux > Battery > Unrestricted) helps prevent this.
PulseAudio vs. PipeWireโ
PipeWire is a newer audio (and video) server that is replacing PulseAudio on desktop Linux distributions. You may see references to it in Linux documentation.
| Feature | PulseAudio | PipeWire |
|---|---|---|
| Maturity | Stable, well-established | Newer, rapidly improving |
| Purpose | Audio only | Audio and video |
| ADL compatibility | Fully supported | Experimental in Termux |
| Configuration | Well-documented for ADL | Limited documentation for ADL |
For ADL, PulseAudio remains the recommended audio solution. PipeWire support in Termux is experimental and may require additional configuration.
Summaryโ
PulseAudio is the sound server that routes audio from your Linux applications to your phone's speakers. In ADL, it works by running a PulseAudio server in Termux that listens on a local TCP port, while applications inside the Ubuntu proot environment send their audio to that port. This architecture bridges the gap between the isolated Linux environment and Android's audio hardware, giving you working sound in your Linux desktop.
Next: Learn about package managers, which let you install software on your Linux system.
For the full audio setup walkthrough, see the audio setup guide.