How to Fix Audio & Sound Problems in Termux (proot-distro)
This guide explains how to fix audio and sound issues in a Linux distribution (such as Ubuntu) running inside Termux using proot-distro.
Follow each step carefully to ensure audio works correctly inside your Linux environment.
Update Termux
Before starting, update your Termux repositories:
pkg update
(This also helps avoid common libssl.so related errors.)
What Is PulseAudio?
PulseAudio is a sound server used on Linux and BSD systems. It acts as a middleware layer between applications and audio hardware, allowing multiple programs to share audio devices smoothly.
Installation
Install PulseAudio in Termux:
pkg install pulseaudio
Fixing the Audio Issue
After installing PulseAudio, apply the following configuration steps.
Step 1: Edit PulseAudio Default Configuration
nano $PREFIX/etc/pulse/default.pa
Add the following line at the end of the file:
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1
Save and exit (Ctrl + X, then Y, then Enter).
Step 2: Edit PulseAudio Daemon Configuration
nano $PREFIX/etc/pulse/daemon.conf
Find this line:
exit-idle-time = 20
Change it to:
exit-idle-time = -1
Save and exit the file.
Step 3: Start PulseAudio
pulseaudio --start
Inside the Linux Distro (Important)
After starting your Linux distro (Ubuntu, Debian, etc.), run the following command inside the distro, not in Termux:
export PULSE_SERVER=127.0.0.1
This command must be executed before playing any video or sound.
Alternative Method
You can also start PulseAudio using:
pulseaudio --start \
--load="module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1" \
--exit-idle-time=-1
Features After Fix
- Working audio output inside proot-distro
- Lightweight setup (requires at least 4 GB of storage)
- Supports desktop environments in Termux
- Compatible with Chromium and Mozilla Firefox
Once configured, audio should work reliably across your Linux environment in Termux.