Always start Prate Radio on specific station?


#1

Is there a way to have the Pirate Radio always start on a specific channel /station, regardless of what channel it was on when shut off? Mine seems to be hit or miss on whether it keeps the last channel I was listening to when I shut it down? Its almost random what channel it starts on some times. Other times I get the one I was listening too last several times in a row? I always shut down with the pHat Beat power button.
What I would like is the first entry in my playlist to be the default on every boot up. Starting / playing without having to hit a button would be nice too. I suspect this might be what is changing channels on me?
Currently when I shut down I leave it powered. When i want use it I press a button that shorts the run terminals to boot it up. Its a momentary switch, mini arcade button. Then I have to wait for it to boot up, and give the one static pop. Then press the channel up or down button to get it to play, is that by design?


#2

The first entry in the playlist should be the default, but I’ve got a sneaking suspicion that because the internet is not up and connected (this is a guess) when VLC starts, it fails through the first few stations and - when the internet comes up - starts playing whatever it happens to be trying at that point.

A simple test for this would be to add a short delay before the script starts VLC, you could do this by editing /usr/bin/vlcd (iirc) and adding a sleep 30 or similar before the looong command for starting VLC. This is a hack though, and the right way to do this is by setting up the systemd script to depend upon internet connectivity… I think :D

It should be possible to store the currently playing station on shutdown and resume when played, but I don’t think VLC supports this directly. It would involve a pre-shutdown hook to grab the currently playing title, and a similar script post-bootup to select that title.


#3

Yeah, I have to listen for a while to figure out what station I’m on. That can be a while sometimes before they announce who they are etc. Then look at my paper copy of my playlist to see how many channel changes I need to make to get to the one I want. I only have about 5 channels in my list and usually only listen to one particular channel. Every once in a while though I don’t like what they are playing and switch channels. Mostly Classic rock. I’m running full Raspbian but just booting to command line. Would there be any advantage to running Stretch lite? In that the Internet might come up quicker?
I’ll play around with the sleep 30 option latter on. I’ve got some other stuff on the go at the moment.

It usually doesn’t play on boot up until I hit a channel up down button. Hitting play pause doesn’t start it. I don’t think volume up down starts it either. When its sitting there not playing after boot up, is it actually streaming, testing streams? Something else that happens every once in a while is it just shuts down again when I press a channel button, instead of playing? Happens some times in use too. It’s playing, I do a channel change and it does a shut down? I’ve double and triple checked my wiring and the extra buttons I added.


#4

@gadgetoid I may have found an easy solution. I went into the Raspbian configuration menu and checked the “wait for network” option under boot options. So far its booting up to the last station it was on when I shut down, and starting on its own without me having to press a button. =) It’s only been 3 or 4 startups so hopefully I didn’t just jinx myself lol.


#5

Many power ups latter and its remembering the last station and starting the stream without having to push any button, other than the one to turn it on / boot it up. The “wait for network” was the answer. =)