AnotherTerm icon indicating copy to clipboard operation
AnotherTerm copied to clipboard

Audio in graphical session

Open dvlahakis opened this issue 2 years ago • 3 comments

Are there any suggestions for how audio might work in a proot graphical session? I tried running pulseaudio and pacmd unsuccessfully in a Debian bullseye session. I thought I might be able to stream to the app pulsedroid. Thanks!

dvlahakis avatar Jun 18 '22 17:06 dvlahakis

I'll think about it but it is not a priority now... The main priority is a PRoot => QEMU migration as Android become more and more restrictive. Also I recommend you to be mentally ready to a moment when Android own console support will remain in the GitHub releases only (due to tightening of the Google Play rules).

green-green-avk avatar Jul 04 '22 03:07 green-green-avk

pulseaudio tcp & rtp server

Run this script

#!/bin/sh
set -eu

## Make sure module-native-protocol-tcp is loaded on android for pactl to work
if ! (pactl list modules short | grep -q -e module-native-protocol-tcp); then
 if pulseaudio --check; then
  pulseaudio --kill
 fi

 pulseaudio --exit-idle-time=-1 --daemonize=true --load="module-native-protocol-tcp"
fi

## Check if module is loaded before unloading
pactl_better_unload_module() {
 if (pactl list modules short | grep -q -e "$1"); then
  pactl unload-module "$1"
 fi
}

## tcp sender
pactl_better_unload_module module-simple-protocol-tcp
pactl load-module module-simple-protocol-tcp source=auto_null.monitor rate=48000 channels=2 format=s16le record=true listen=127.0.0.1 port=4010

## rtp sender
pactl_better_unload_module module-rtp-send
pactl load-module module-rtp-send source=auto_null.monitor rate=48000 channels=2 mtu=320 destination=127.0.0.1 port=4010

Or add your pulseaudio configuration

/etc/pulse/default.pa.d/sender.pa

#!/usr/bin/pulseaudio -nF

## Android module
load-module module-native-protocol-tcp

## tcp sender
load-module module-simple-protocol-tcp source=auto_null.monitor rate=48000 channels=2 format=s16le record=true listen=127.0.0.1 port=4010

## rtp sender
load-module module-rtp-send source=auto_null.monitor rate=48000 channels=2 mtu=320 destination=127.0.0.1 port=4010

and run

pulseaudio --exit-idle-time=-1 --daemonize=true

zongou avatar Oct 14 '23 01:10 zongou

A related question: https://github.com/green-green-avk/AnotherTerm/issues/52

Maybe I will change my mind but rather prefer to implement it as PipeWire.

green-green-avk avatar Dec 23 '23 00:12 green-green-avk