pyradio: Connection fails with mpv, but works fine with mplayer

OS: Raspberry Pi OS lite (latest, on a pi zero w)

Pyradio v0.8.9.16

All dependencies installed that you included in your PR ( https://github.com/taoteh1221/Bluetooth_Internet_Radio/pull/2 ), using that script.

If I run pyradio, it says its using mpv, additionally which mpv tells me the binary exists OK on the system. But pyradio says connecting to..., and then it says connection failed when using mpv.

If I remove mpv from the system, and install mplayer instead, pyradio works OK, everything plays as expected, no problems.

Additionally (before un-installing mpv with apt), when I was in pyradio, I hit the c key, unchecked mpv checkbox, hit the s key, closed and restarted pyradio, but mpv was still selected with a checkmark when I opened the config window?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 23

Most upvoted comments

Ok. Thanks for the PR and insight, it was very helpful! šŸ˜„ Most people may use a more powerful pi, the zero model is the weakest chipset…maybe why you never heard of mpv crashing before. Take care, thanks again! šŸ˜„

I am curious as to why the issue

The only reason I can think of is that maybe this particular board is not strong enough to handle constantly opening and closing pipes… IDK…

I’ve had other people asking about rasberry and mpv (facing problems with the timeout value), but never anything like crashes and such…

Anyway, I think I’ll be closing this issue now, feel free to contact me if anything else pops up šŸ˜„

The thing is that mpvuses pipes to communicate with pyradio, so, I don’t know, maybe some other board can ahndle it better, but with what you’ve been facing, it’s a deal breaker, IMHO.

So, yes, go with mplayer…

I am curious as to why the issue, but yes since mplayer ā€˜just works’ on this tiny device, then it should be used instead.

It seems you should dump mpv alltogether, and stick to mplayer, since it does not cause you problems. So, I would suggest reverting everything related to mpv to what it was before I gave you my ā€œwiseā€ cry advice.

Just keep the stuff about python 3 though…

Sorry again…

Ok, no worries I appreciate your help! šŸ˜„ I was just giving you some feedback to help with pyradio UX on raspberry pi devices. I do not think there is anyway you could have known a tiny computer like this would not run mpv well: https://www.raspberrypi.com/products/raspberry-pi-zero/

pyradio does run very well with mplayer on the raspberry pi zero though, I have been using it that way for weeks. šŸ˜„

Yeah, I updated the comment, after you read it (it seems)…

Hi again @taoteh1221

No, I think it’s not worth it…

I am sorry I lead you astray on this one…

It seems you should dump mpv alltogether, and stick to mplayer, since it does not cause you problems. So, I would suggest reverting everything related to mpv to what it was before I gave you my ā€œwiseā€ 😢 advice.

Just keep the stuff about python 3 though…

As for the users of your project, let them deal with all this heartache (if they feel they want to use mpv), maybe display a note on it through your script.

The thing is that mpvuses pipes to communicate with pyradio, so, I don’t know, maybe some other board can handle it better, but with what you’ve been facing, it’s a deal breaker, IMHO.

So, yes, go with mplayer…

@s-n-g I just realized that mpv crashes a raspberry pi zero (leaving it completely unresponsive) after running for a few hours. This happened a couple times in a row. mplayer in pyradio does not crash the device though (I have run it all day for weeks without a problem). So here is some logic you could port to python for raspi devices: https://github.com/taoteh1221/Bluetooth_Internet_Radio/blob/main/bt-radio-setup.bash#L1169

raspi-config is a part of all ā€œRaspberry Pi OSā€ distro versions: https://www.raspberrypi.com/documentation/computers/configuration.html#:~:text=The raspi-config Tool,-Edit this on GitHub

As for alternative distros that run on a raspberrypi, I don’t know how easily you could tell.

BTW, please make sure that these sed commands are executed after the files are created (after pyradio has been executed at least once), or exist beforehand.

šŸ‘ https://github.com/taoteh1221/Bluetooth_Internet_Radio/blob/main/bt-radio-setup.bash#L1151

Yes, this is a sure way to check for raspi-config, located here: /usr/bin/raspi-config

This is great! Is this the case for every distro? Please keep in mind I know absolutely nothing about the Raspberry world 😃

And default timeout to 20: sed -i 's/connection_timeout = .*/connection_timeout = 20/g' ~/.config/pyradio/config 😃

Thanks for the info. I fixed mpv default volume to 100 everytime my script runs pyradio: sed -i 's/volume=.*/volume=100/g' ~/.config/mpv/mpv.conf