termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.04k stars 2.99k forks source link

does pulseaudio termux support simple-protocol-tcp protocol #8783

Closed JanuszChmiel closed 2 years ago

JanuszChmiel commented 2 years ago

Dear specialists, I have found out, that Pulseaudio for Termux can play audio samples which have been streamed by using TCP protocol. But I would like to know if it would be possible to setup Pulseaudio for Termux so it would be able to play audio samples which would have streamed by using simple-protocol-tcp protocol. I want to setup Pulseaudio in ArchLinux AArch 64 and I would like to be able to listen audio by using build in PUlseaudio for Termux. Is it possible please? I want to avoid using Simple Protocol player and similar ANdroid players, because it uses Audio track or other Android APIS in Java. I prefer Pulseaudio for Termux because it uses other approach to send audio blocks to The system.

Is it possible please? Or somebody would had to recode Pulseaudio for Termux? If is it possible. Please write Me how to initialize PUlseaudio for Termux so it will accept audio data send by using simple-protocol-tcp The aim of my attempt is to reduce time delay when using speech-dispatcher and Espeak-ng speech engine. Now delay if one second if I Am using The following setup. Pulseaudio Termux initialisation command

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

And on my ArchLinux side export PULSE_SERVER=tcp:127.0.0.1

In my case, Pulseaudio from ArchLinux is not executed. But I would like to know if I could speed up audio delay by switching to The simple-protocol-tcp instead.

Thank you very very much for your patience and for some advices.

xtkoba commented 2 years ago

The package has a module for that:

$PREFIX/lib/pulse-14.2/modules/module-simple-protocol-tcp.so

I do not now how it works though.

SDRausty commented 2 years ago

I do not now how it works though.

Both @JanuszChmiel and I are using setupTermuxArch [visualorca] [manual] [install|refresh] [customdir] to aid in configuring, setup and running pulseaudio in both native Termux and Termux PRoot in two Android screen taps after tabbing and taping in the appropriate commands. He was instrumental in developing this command long ago; Thank you once more @JanuszChmiel and all who have contributed.

I was stunned at how well this command had worked a few evenings ago during configuration, and setup. This package request [Package]: The GHCup-hs Haskell installer #8758 would not have been shared, had its job been unsuccessful.

I wish I had more resources and time today to help in resolving this issue right now. Unfortunately, I do not. Hopefully the command I have shared here will help out with express quick configure and setup.

JanuszChmiel commented 2 years ago

I want to try The reaction speed between key press and Espeak-ng pronouncation. Because Sockets or TCP native causes one Second delay between key press and speech.

It is so sad, because if Android is being used directly on device, those delays are not presented at all.

SDRausty commented 2 years ago

so sad

Please try food as medicine; e.g. kefir and similar foods that make you feel well, instead of merely fooling human taste buds.

JanuszChmiel commented 2 years ago

The situation could be solved if I could root my phone. SO I could run Linux distribution directly without using Proot. And I could even decrease Cpu freq to 700 MH/Z and delay would be gone.

JanuszChmiel commented 2 years ago

For now I will begin to use Simple protocol Player. Its author has prepared good wiky article. I will try to use 16 Bits endian instead of 32 Bits because synthetic speech do not require so soft sound. Because MR Bahran has programmed very reliable shared memory support and dbus-launch work even with Pulseaudio in ArchLinux I have A good chance. I can also experiment by changing arious settings for sound lenght in Milliseconds Sound buffer.