pimoroni / phat-beat

Python library for PHAT BEAT - A stereo DAC, AMP and VU for the Raspberry Pi
https://shop.pimoroni.com/products/phat-beat
MIT License
99 stars 28 forks source link

[Suggestion] vlc-radio: save volume and last station across shutdown/start cycle #17

Open Wikinaut opened 5 years ago

Wikinaut commented 5 years ago

I want to propose a tiny improvement of your vlc-radio software:

permanently, so that the next start starts with these values.

Perhaps you know a quick way to achieve this.

pirateradiohack commented 5 years ago

@Wikinaut I have created a variant of the vlc-radio and one of the features is just that. You may want to give it a try: https://github.com/pirateradiohack/PiRadio

Wikinaut commented 2 years ago

@Wikinaut I have created a variant of the vlc-radio and one of the features is just that. You may want to give it a try: https://github.com/pirateradiohack/PiRadio

@pirateradiohack Hi, just coming back after a long time to this. I still have the original pirateradio plus phatbeat. Can this (phatbeat) used with your "Transistor" system. You mentioned "deprecated" there.

One remark: I just implemented a clever idea for users without a display on their pirateradio. I am going to file a separate issue here with the details of my patch.

Basically, the station names (in EXTINF fields in the playlist) are once spoken-out (wav file previously or on demand produced by pico2wave), when you change the channel. The last station number is tracked in phatbeatd and preserved. vlcd can be forced to "goto X", Xth item in the playlist. So everytime when I change the station via prev/next, the station name is spoken out on my pirate radio.

This tiny patch will be published, when it becomes fully tested. At the moment I cope with a difficult-to-find problem that vlcd (on start) does not obey the first "goto " command. I now noticed, that there appears to be an offset (4):

The first item in the playlist has the id 4 (I do not know, why):

http://pirateradio:8080/requests/status.xml?command=pl_play&id=4
pirateradiohack commented 2 years ago

Hi @Wikinaut , yes, you can use Transistor with phatbeat. I mentioned "deprecated" because I believe this device is not sold anymore. I will update the README to make it clearer. Thanks for pointing this. I use Transistor on a phatbeat myself, I maintain compatibility with it.

Regarding your idea to speak the name of the currently selected radio stream, I like it. Knowing which radio you are switching to when using the physical buttons without screen can get pretty confusing. I have been trying to find a solution to that. I use a Python controller in Transistor and could very easily integrate that solution. I'm a bit concerned about the quality of the synth voice though, mostly when it comes to different languages. I will give it a try myself to gauge the user experience.

Wikinaut commented 2 years ago

@pirateradiohack I now have my code fixed, not yet published (modification of phatbeatd).

A bash script, manually started once after a new playlist is supplied, parses that playlist, extracts the commented stations names (later, this could be fetched using mplayer automatically from streams), "speaks" into wav-files 00.wav, 01.wav and so on. Instead of "next" and "prev" I now use "goto N" and play (using sox' play -q -v 0.4 the stationname-file N.wav (basically).

The "laststation" is always saved in a small file on the sd card and always used when the pirate radio is started.

It's a nice extension, and improvement.

Wikinaut commented 2 years ago

@pirateradiohack Do you have any idea why:

 I now noticed, that there appears to be an offset (4):

The first item in the playlist has the id 4 (I do not know, why):

http://pirateradio:8080/requests/status.xml?command=pl_play&id=4

Question: Why is there an offset of 4 when accessing an item in the playlist?

Question relates to pirate radio and internet radio using vlcd and phatbeatd.

pirateradiohack commented 2 years ago

@Wikinaut I do not use this implementation (vlcd) so I can't help you. This is one of the reasons I use a Python controller, so it is easier to implement this kind of functionality.

wisemoth commented 2 years ago

@Wikinaut Is your vlc-radio patch available? I just set up an old Pirate radio with the stock Pimoroni software. All working OK - but I was thinking of the exact same improvement as you :)

Wikinaut commented 2 years ago

@Wikinaut Is your vlc-radio patch available? I just set up an old Pirate radio with the stock Pimoroni software. All working OK - but I was thinking of the exact same improvement as you :)

Uh, I have to look for that. Will come back later.