Skip to main content
deleted 18 characters in body
Source Link
MRule
  • 131
  • 5

That said, even some of the older content I'm finding on the internet suggests that Termux can route pulseaudio output to the phone speakers on its own. I just can't find any tutorials that actuaool work. The partial information from forum posts are usually from people half-way through attempting a proot or chroot installation of a more expansive Linux distribution under Termux. I want to interafaceinterface play in Termux with the host Android linuxLinux as lightly a possible.

That said, even some of the older content I'm finding on the internet suggests that Termux can route pulseaudio output to the phone speakers on its own. I just can't find any tutorials that actuaool work. The partial information from forum posts are usually from people half-way through attempting a proot or chroot installation of a more expansive Linux distribution under Termux. I want to interaface play in Termux with the host Android linux as lightly a possible.

That said, even some of the older content I'm finding on the internet suggests that Termux can route pulseaudio output to the phone speakers on its own. I just can't find any tutorials that work. The information from forum posts are usually from people half-way through attempting a proot or chroot installation of a more expansive Linux distribution under Termux. I want to interface play in Termux with the host Android Linux as lightly a possible.

added 7 characters in body
Source Link
MRule
  • 131
  • 5

Edits on 2024.08.23

Is Termux 0.118.1 supposed to be able to output audio on its own?

Edit 1 on 2024.08.23: Is Termux 0.118.1 supposed to be able to output audio on its own?

That said, even some of the older content I'm finding on the internet suggests that Termux can route pulseaudio output to the phone speakers on its own. I just can't find any tutorials that actuaool work. The partial information from forum posts are usually from people half-way through attempting a proot or chroot installation of a more expansive Linux distribution under Termux. I want to interaface play in Termux with the host Android linux as lightly a possible.

Can we use the app PulseAudio Rtp Receiver?

These are the default server settings for PulseAudio Rtp Receiver version 1.0.6 installed from F-Droid on 2024.08.23:

IP:   224.0.0.56        # default 127.0.0.1? 
Port: 4010              # default 4712? 
MTU:  320               # "max. transmit unit", default 1500?
Max Latency (ms): 300   # default 100? 
Channel Count:    2
Channel Mask:     0
SampleRate:       48000 # cannot change this
framesPerBurst:   192   # cannot change this
  • That default IP 224.0.0.56 is probably nonsense. I changed it to 127.0.0.1 in the PulseAudio Rtp Receiver GUI and restarted the server.
  • We should probably use the port 4712 as this is the more common value for pulseaudio servers?
  • It seems like MTU usually defaults to 1500, not 320?
  • It seems like max latency usually defaults to 100, not 300?

I had no luck with the PulseAudio Rtp Receiver defaults (playing garbled horrible noises at best), so I tried these settings:

IP:               127.0.0.1
Port:             4712
MTU:              1500
Max Latency (ms): 100
Channel Count:    2
Channel Mask:     0
SampleRate:       48000
framesPerBurst:   192

Per this reddit comment, I tried running

export PULSE_SERVER=127.0.0.1:4712

and various permutations, with no luck. The TCP-based command from [2] is also not applicable, since PulseAudio Rtp Receiver is listening via RTP not TCP/

Based on the first comment reply here I added the following lines to /data/data/com.termux/files/usr/etc/pulse/default.pa:

load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=48000 sink_properties="device.description='RTP Multicast Sink'"
load-module module-rtp-send source=rtp.monitor destination_ip=127.0.0.1 port=4712 loop=1

I started a fresh shell and ran

pulseaudio -k
pulseaudio --start
play ......

With success! (I will add move as an answer shortly).

Edits on 2024.08.23

Is Termux 0.118.1 supposed to be able to output audio on its own?

That said, even some of the older content I'm finding on the internet suggests that Termux can route pulseaudio output to the phone speakers on its own. I just can't find any tutorials that actuaool work. The partial information from forum posts are usually from people half-way through attempting a proot or chroot installation of a more expansive Linux distribution under Termux. I want to interaface play in Termux with the host Android linux as lightly a possible.

Can we use the app PulseAudio Rtp Receiver?

These are the default server settings for PulseAudio Rtp Receiver version 1.0.6 installed from F-Droid on 2024.08.23:

IP:   224.0.0.56        # default 127.0.0.1? 
Port: 4010              # default 4712? 
MTU:  320               # "max. transmit unit", default 1500?
Max Latency (ms): 300   # default 100? 
Channel Count:    2
Channel Mask:     0
SampleRate:       48000 # cannot change this
framesPerBurst:   192   # cannot change this
  • That default IP 224.0.0.56 is probably nonsense. I changed it to 127.0.0.1 in the PulseAudio Rtp Receiver GUI and restarted the server.
  • We should probably use the port 4712 as this is the more common value for pulseaudio servers?
  • It seems like MTU usually defaults to 1500, not 320?
  • It seems like max latency usually defaults to 100, not 300?

I had no luck with the PulseAudio Rtp Receiver defaults (playing garbled horrible noises at best), so I tried these settings:

IP:               127.0.0.1
Port:             4712
MTU:              1500
Max Latency (ms): 100
Channel Count:    2
Channel Mask:     0
SampleRate:       48000
framesPerBurst:   192

Per this reddit comment, I tried running

export PULSE_SERVER=127.0.0.1:4712

and various permutations, with no luck. The TCP-based command from [2] is also not applicable, since PulseAudio Rtp Receiver is listening via RTP not TCP/

Based on the first comment reply here I added the following lines to /data/data/com.termux/files/usr/etc/pulse/default.pa:

load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=48000 sink_properties="device.description='RTP Multicast Sink'"
load-module module-rtp-send source=rtp.monitor destination_ip=127.0.0.1 port=4712 loop=1

I started a fresh shell and ran

pulseaudio -k
pulseaudio --start
play ......

With success! (I will add move as an answer shortly).

Edit 1 on 2024.08.23: Is Termux 0.118.1 supposed to be able to output audio on its own?

That said, even some of the older content I'm finding on the internet suggests that Termux can route pulseaudio output to the phone speakers on its own. I just can't find any tutorials that actuaool work. The partial information from forum posts are usually from people half-way through attempting a proot or chroot installation of a more expansive Linux distribution under Termux. I want to interaface play in Termux with the host Android linux as lightly a possible.

added 7 characters in body
Source Link
MRule
  • 131
  • 5

Question: How do I wantget the pulseaudio command play from the Termux app to emit sound over the phone speakers (without rooting the phone or using a proot installation in Termux). Has anyone achieved this?

I cannot find clearworking instructions, but I did find the following:

That said, even some of the older content I'm finding on the internet suggests that Termux can route pulseaudio output to the phone speakers on its own. I just can't find any complete tutorials, and the that actuaool work. The partial information from forum posts are usually from people half-way through attempting a proot or chroot installation of a more expansive Linux distribution under Termux. So perhaps it isI want to interaface play in Termux with the host Android linux as lightly a possible?.

IP:   224.0.0.56        # default 127.0.0.1? 
Port: 4010              # default 4712? 
MTU:  320               # "max. transmit unit", default 1500?
Max Latency (ms): 300   # default 100? 
Channel Count:    2
Channel Mask:     0
SampleRate:       48000 # cannot change this
framesPerBurst:   192   # cannot change this
  • That default IP 224.0.0.56 is probably nonsense. I changed it to 127.0.0.1 in the PulseAudio Rtp Receiver GUI and restarted the server.
  • We should probably use the port 4712 as this is the more common value for pulseaudio servers?
  • It seems like MTU usually defaults to 1500, not 320?
  • It seems like max latency usually defaults to 100, not 300?

That default IP 224.0.0.56 is probably nonsense. I changed it to 127.0.0.1 inhad no luck with the PulseAudio Rtp Receiver GUI and restarted the server. Perdefaults (playing garbled horrible noises at best), so I tried these settings:

IP:               127.0.0.1
Port:             4712
MTU:              1500
Max Latency (ms): 100
Channel Count:    2
Channel Mask:     0
SampleRate:       48000
framesPerBurst:   192

Per this reddit comment, I tried running

export PULSE_SERVER=224PULSE_SERVER=127.0.0.1:40104712

(with and without the port)various permutations, but it did not workwith no luck. Neither did the pactl load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1The TCP-based command from [2]. I got Could not open device: error 5 when subsequently using the is also not applicable, since play command for all of the above.PulseAudio Rtp Receiver is listening via RTP not TCP/

load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=48000 sink_properties="device.description='RTP Multicast Sink'"
load-module module-rtp-send source=rtp.monitor destination_ip=127.0.0.1 port=4010port=4712 loop=1

With some success, I can now see PulseAudio Rtp Receiver receiving data! Still, no sound. At first I thought there must be some permission missing, but it seems that Android does not gate access to the phone speaker this way.

I restarted everything from scratch and double-checked that all volume channels were set to full. It seems to get some audio now, but mostly in the form of horrible sounding bursts. I suppose this is getting pretty close, just need to figure out the correct settings for the stream and where/how to set them?

Can we use VLC?

Since I seemed to have a stream working, I tried pointing the Android VLC app to

rtp://127.0.0.1:4010

VLC(I will happily createadd move as an entry for any IP and port, but no permutation I've tried so far picks up any audio from termuxanswer shortly).

Question: I want the pulseaudio command play from the Termux app to emit sound over the phone speakers (without rooting the phone or using a proot installation in Termux). Has anyone achieved this?

I cannot find clear instructions, but I did find the following:

That said, even some of the older content I'm finding on the internet suggests that Termux can route pulseaudio output to the phone speakers on its own. I just can't find any complete tutorials, and the partial information from forum posts are usually from people attempting a proot or chroot installation. So perhaps it is possible?

IP: 224.0.0.56
Port: 4010
MTU: 320
Max Latency (ms): 300
Channel Count: 2
Channel Mask: 0
SampleRate: 48000
framesPerBurst: 192

That default IP 224.0.0.56 is probably nonsense. I changed it to 127.0.0.1 in the PulseAudio Rtp Receiver GUI and restarted the server. Per this reddit comment, I tried running

export PULSE_SERVER=224.0.0.1:4010

(with and without the port), but it did not work. Neither did the pactl load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 auth-anonymous=1 command from [2]. I got Could not open device: error 5 when subsequently using the play command for all of the above.

load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=48000 sink_properties="device.description='RTP Multicast Sink'"
load-module module-rtp-send source=rtp.monitor destination_ip=127.0.0.1 port=4010 loop=1

With some success, I can now see PulseAudio Rtp Receiver receiving data! Still, no sound. At first I thought there must be some permission missing, but it seems that Android does not gate access to the phone speaker this way.

I restarted everything from scratch and double-checked that all volume channels were set to full. It seems to get some audio now, but mostly in the form of horrible sounding bursts. I suppose this is getting pretty close, just need to figure out the correct settings for the stream and where/how to set them?

Can we use VLC?

Since I seemed to have a stream working, I tried pointing the Android VLC app to

rtp://127.0.0.1:4010

VLC will happily create an entry for any IP and port, but no permutation I've tried so far picks up any audio from termux.

Question: How do I get the pulseaudio command play from the Termux app to emit sound over the phone speakers (without rooting the phone or using a proot installation in Termux)?

I cannot find working instructions, but I did find the following:

That said, even some of the older content I'm finding on the internet suggests that Termux can route pulseaudio output to the phone speakers on its own. I just can't find any tutorials that actuaool work. The partial information from forum posts are usually from people half-way through attempting a proot or chroot installation of a more expansive Linux distribution under Termux. I want to interaface play in Termux with the host Android linux as lightly a possible.

IP:   224.0.0.56        # default 127.0.0.1? 
Port: 4010              # default 4712? 
MTU:  320               # "max. transmit unit", default 1500?
Max Latency (ms): 300   # default 100? 
Channel Count:    2
Channel Mask:     0
SampleRate:       48000 # cannot change this
framesPerBurst:   192   # cannot change this
  • That default IP 224.0.0.56 is probably nonsense. I changed it to 127.0.0.1 in the PulseAudio Rtp Receiver GUI and restarted the server.
  • We should probably use the port 4712 as this is the more common value for pulseaudio servers?
  • It seems like MTU usually defaults to 1500, not 320?
  • It seems like max latency usually defaults to 100, not 300?

I had no luck with the PulseAudio Rtp Receiver defaults (playing garbled horrible noises at best), so I tried these settings:

IP:               127.0.0.1
Port:             4712
MTU:              1500
Max Latency (ms): 100
Channel Count:    2
Channel Mask:     0
SampleRate:       48000
framesPerBurst:   192

Per this reddit comment, I tried running

export PULSE_SERVER=127.0.0.1:4712

and various permutations, with no luck. The TCP-based command from [2] is also not applicable, since PulseAudio Rtp Receiver is listening via RTP not TCP/

load-module module-null-sink sink_name=rtp format=s16be channels=2 rate=48000 sink_properties="device.description='RTP Multicast Sink'"
load-module module-rtp-send source=rtp.monitor destination_ip=127.0.0.1 port=4712 loop=1

With success! (I will add move as an answer shortly).

added 613 characters in body
Source Link
MRule
  • 131
  • 5
Loading
added 231 characters in body
Source Link
MRule
  • 131
  • 5
Loading
deleted 42 characters in body
Source Link
MRule
  • 131
  • 5
Loading
deleted 42 characters in body
Source Link
MRule
  • 131
  • 5
Loading
deleted 42 characters in body
Source Link
MRule
  • 131
  • 5
Loading
added 467 characters in body
Source Link
MRule
  • 131
  • 5
Loading
added 284 characters in body
Source Link
MRule
  • 131
  • 5
Loading
added 1404 characters in body
Source Link
MRule
  • 131
  • 5
Loading
added 1404 characters in body
Source Link
MRule
  • 131
  • 5
Loading
added 1140 characters in body
Source Link
MRule
  • 131
  • 5
Loading
added 2371 characters in body
Source Link
MRule
  • 131
  • 5
Loading
Source Link
MRule
  • 131
  • 5
Loading