Play feature is broken in Non Root access on termux in Android env.See original GitHub issue
I’m using a non-rooted android device with termux.
Surprisingly I was able to build PyRadio from source, however upon selecting a station I get roughly 5 seconds of audio and I receive a KeyError & Permission error on /proc directory.
PyRadio clearly is working however fundamentally does not work with my environment.
~/.local/bin $ ./pyradio --play Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/psutil/_common.py", line 403, in wrapper return cache[key] KeyError: (('/proc',), frozenset()) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/psutil/_pslinux.py", line 302, in <module> set_scputimes_ntuple("/proc") File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/psutil/_common.py", line 405, in wrapper ret = cache[key] = fun(*args, **kwargs) File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/psutil/_pslinux.py", line 269, in set_scputimes_ntuple with open_binary('%s/stat' % procfs_path) as f: File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/psutil/_common.py", line 711, in open_binary return open(fname, "rb", **kwargs) PermissionError: [Errno 13] Permission denied: '/proc/stat'
For me to make this change I would allow the user to decide if a stream is indeed playing and continue playing it versus what appears to be happening is pyradio checks with /proc to see if the stream is healthy in some way and KeyError on that check… Since I’m building from source this may be a easy adjustment.
- Created 3 years ago
Top GitHub Comments
Unfortunately vlc (installed from app store) is not accessible from command line ($ vlc) so pyradio wouldn’t be able to call it. I can’t install mplayer either, using apt or pkg.
mpv works fine
$ mpv http://somafm.com/secretagent.pls will directly play audio.
I know you’re not targeting android with pyradio but the closest to getting something working officially would be using this Simple Protocol Player method. https://android.stackexchange.com/a/205711
You’ve guarded user inputs in the config files well, I tried to break connection_timeout high and low but it constrains it back to default.
I’ve stripped out the lines for the timeout counter to activate in player.py ln1126-ln1137 Plays fine now :] Just a message about “Opening connection…” , I tried setting the connection_timeout_thread = True in hopes that that would short circuit it to think the job was done but to no avail.
BTW, If you do post a tutorial or guide or something about how you did this, please do send us a link.
It would be really interesting!