PiratePython - Pirate Radio

Hi - the issue with Buster in the Pirate Radio code is that it checks for the OS level in the VLC bringup and “buster” is not in the list so VLC loading fails. There are two ways to fix this, either run Stretch or change the config file for the VLC player and add a line to accept the new 'buster" OS.

Hi guys! Need some help with customizing the vlc radio app: I want to make a change to the interface (if I can) so it displays the internet radio URL that is playing on the terminal. I would think I could just modify some python code somewhere to do that when the “next” button is pressed, but I can’t find where the code handles the “next” button. Maybe this is not accessible from the python code?

I had this saved as a crib note from a thread I started many moons ago on the original Pirate Radio / Internet Radio. Might help. It looks like I ran vlc -I rc from terminal and that was the output.

pi@raspberry:~ $ vlc -I rc
VLC media player 2.2.5 Weatherwax (revision 2.2.5-0-g9275f0fefa)
[0204da48] pulse audio output error: PulseAudio server connection failure: Connection refused
[02045630] core interface error: no suitable interface module
[01fae8f8] core libvlc error: interface "globalhotkeys,none" initialization failed
[01fce6c0] dbus interface error: Failed to connect to the D-Bus session daemon: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
[01fce6c0] core interface error: no suitable interface module
[01fae8f8] core libvlc error: interface "dbus,none" initialization failed
[01fce608] [cli] lua interface: Listening on host "*console".
VLC media player 2.2.5 Weatherwax
Command Line Interface initialized. Type `help' for help.
longhelp
> +----[ CLI commands ]
| add XYZ  . . . . . . . . . . . . . . . . . . . . add XYZ to playlist
| enqueue XYZ  . . . . . . . . . . . . . . . . . queue XYZ to playlist
| playlist . . . . . . . . . . . . .  show items currently in playlist
| search [string]  . .  search for items in playlist (or reset search)
| delete [X] . . . . . . . . . . . . . . . . delete item X in playlist
| move [X][Y]  . . . . . . . . . . . . move item X in playlist after Y
| sort key . . . . . . . . . . . . . . . . . . . . . sort the playlist
| sd [sd]  . . . . . . . . . . . . . show services discovery or toggle
| play . . . . . . . . . . . . . . . . . . . . . . . . . . play stream
| stop . . . . . . . . . . . . . . . . . . . . . . . . . . stop stream
| next . . . . . . . . . . . . . . . . . . . . . .  next playlist item
| prev . . . . . . . . . . . . . . . . . . . .  previous playlist item
| goto, gotoitem . . . . . . . . . . . . . . . . .  goto item at index
| repeat [on|off]  . . . . . . . . . . . . . .  toggle playlist repeat
| loop [on|off]  . . . . . . . . . . . . . . . .  toggle playlist loop
| random [on|off]  . . . . . . . . . . . . . .  toggle playlist random
| clear  . . . . . . . . . . . . . . . . . . . . .  clear the playlist
| status . . . . . . . . . . . . . . . . . . . current playlist status
| title [X]  . . . . . . . . . . . . . . set/get title in current item
| title_n  . . . . . . . . . . . . . . . .  next title in current item
| title_p  . . . . . . . . . . . . . .  previous title in current item
| chapter [X]  . . . . . . . . . . . . set/get chapter in current item
| chapter_n  . . . . . . . . . . . . . .  next chapter in current item
| chapter_p  . . . . . . . . . . . .  previous chapter in current item
|
| seek X . . . . . . . . . . . seek in seconds, for instance `seek 12'
| pause  . . . . . . . . . . . . . . . . . . . . . . . .  toggle pause
| fastforward  . . . . . . . . . . . . . . . . . . set to maximum rate
| rewind . . . . . . . . . . . . . . . . . . . . . set to minimum rate
| faster . . . . . . . . . . . . . . . . . .  faster playing of stream
| slower . . . . . . . . . . . . . . . . . .  slower playing of stream
| normal . . . . . . . . . . . . . . . . . .  normal playing of stream
| rate [playback rate] . . . . . . . . . .  set playback rate to value
| frame  . . . . . . . . . . . . . . . . . . . . . play frame by frame
| fullscreen, f, F [on|off]  . . . . . . . . . . . . toggle fullscreen
| info . . . . . . . . . . . . .  information about the current stream
| stats  . . . . . . . . . . . . . . . .  show statistical information
| get_time . . . . . . . . .  seconds elapsed since stream's beginning
| is_playing . . . . . . . . . . . .  1 if a stream plays, 0 otherwise
| get_title  . . . . . . . . . . . . . the title of the current stream
| get_length . . . . . . . . . . . .  the length of the current stream
|
| volume [X] . . . . . . . . . . . . . . . . . .  set/get audio volume
| volup [X]  . . . . . . . . . . . . . . .  raise audio volume X steps
| voldown [X]  . . . . . . . . . . . . . .  lower audio volume X steps
| achan [X]  . . . . . . . . . . . .  set/get stereo audio output mode
| atrack [X] . . . . . . . . . . . . . . . . . . . set/get audio track
| vtrack [X] . . . . . . . . . . . . . . . . . . . set/get video track
| vratio [X] . . . . . . . . . . . . . . .  set/get video aspect ratio
| vcrop, crop [X]  . . . . . . . . . . . . . . . .  set/get video crop
| vzoom, zoom [X]  . . . . . . . . . . . . . . . .  set/get video zoom
| vdeinterlace [X] . . . . . . . . . . . . . set/get video deinterlace
| vdeinterlace_mode [X]  . . . . . . .  set/get video deinterlace mode
| snapshot . . . . . . . . . . . . . . . . . . . . take video snapshot
| strack [X] . . . . . . . . . . . . . . . . .  set/get subtitle track
| hotkey, key [hotkey name]  . . . . . . . . . . simulate hotkey press
|
| vlm  . . . . . . . . . . . . . . . . . . . . . . . . .  load the VLM
| set [var [value]]  . . . . . . . . . . . . . . . . . set/get env var
| save_env . . . . . . . . . . . .  save env vars (for future clients)
| alias [cmd]  . . . . . . . . . . . . . . . . set/get command aliases
| description  . . . . . . . . . . . . . . . . .  describe this module
| license  . . . . . . . . . . . . . . . . print VLC's license message
| help, ? [pattern]  . . . . . . . . . . . . . . . . .  a help message
| longhelp [pattern] . . . . . . . . . . . . . . a longer help message
| lock . . . . . . . . . . . . . . . . . . . .  lock the telnet prompt
| logout . . . . . . . . . . . . . .  exit (if in a socket connection)
| quit . . . . . . . .  quit VLC (or logout if in a socket connection)
| shutdown . . . . . . . . . . . . . . . . . . . . . . .  shutdown VLC
+----[ end of help ]

curl https://get.pimoroni.com/vlcradio | bash

Even if I execute it, the login screen is displayed.

I have been using the Pirate Radio as my primary access to BBC Radio for ages now.
Now I have started to get warning messages telling me that it will soon stop working because of the withdrawal of flash functionality. The BBC tells us to contact the manufacturer of our audio device.

What do I need to do to keep it working.

Plummet

I do believe that message just means the “web site” may stop working in your browser? I don’t think Flash has any affect on the audio stream that the Pirate Radio uses? I’m sure I’ll be corrected if I’m wrong.

On the BBC website there is a help page under “Sounds” that includes:-

… Then your device is using Adobe Flash to play video and audio content. Flash’s owners, Adobe, are phasing it out so if your device uses Flash, you’ll need to make some changes to continue listening with an alternative. This is out of the BBC’s control.

My Pirate Radio is using VLC. Does this use Flash? Or does it use Flash somehow for its browser accessible control panel?
Plummet

That I don’t know. I guess you’ll have to poke around on the VLC site? Maybe ask that question there? Or wait for somebody more knowledgeable than me to reply here.
Might want to start a new thread on this with a new title to get better views and replies.

from some of what i just searched and read I will say no it doesn’t use adobe ,seem the big issue will be some games people play online

Well, I have tried the VLC Forum but only got a snotty reply telling me that they are not some US retailers fault finders! Lets hope for others with a more helpful attitude.

plummet

I use VLC as my default player on win 10 laptop, and i’ts still works ok

Do you use it to stream BBC Radio?

That is where the problem is happening.
Plummet

Glad to see you still don’t care about your customers, This is over 3 years old and you have done NOTHING with it. Additionally the install scripts for both the spotify and vlcradio both blow up with errors and refuse to fully install… now you release a new version of a solder-less pirate radio but can’t even update the scripts so one can successfully install on MODERN distributions (not my/users job to download and debug your installers even if we could). Maybe its time that Pimoroni walk the plank…

1 Like

@DaVyper Sorry for the frustration! Looks like the vlcradio one line installer still seems to be grabbing an older version of setup.sh from somewhere which would explain why it’s not working properly on Buster… I’ve asked our software folks to take a look.

In the meantime, this got my setup working:
curl https://get.pimoroni.com/vlcradio | bash
(and after you get the message about buster not being supported)
git clone https://github.com/pimoroni/phat-beat
cd phat-beat/projects/vlc-radio
./setup.sh

Feel free to drop us an email at support@pimoroni.com if you need help getting things going!

The Spotipy one line installer seems to be working OK for me (although the Mopidy-Spotify plug-in does now ask for a client_id and client_secret which aren’t mentioned in Sandy’s original tutorial - I’ll fix that!)

H

1 Like

Dashboard version is similarly messed up, glad your software folks don’t even test this junk

I had this saved from the last time I redid my (standard) Pirate Radio install.

This is because there is no check for Buster in the
Pimoroni/phatbeat/projects/vlc-radio/setup.sh installation script
The raspbian_check() routine needs to be modified as shown below to support Rasbian Buster

raspbian_check() {
IS_SUPPORTED=false
IS_EXPERIMENTAL=false

if [ -f /etc/os-release ]; then
    if cat /etc/os-release | grep -q "/sid"; then
        IS_SUPPORTED=false && IS_EXPERIMENTAL=true
    elif cat /etc/os-release | grep -q "stretch"; then
        IS_SUPPORTED=false && IS_EXPERIMENTAL=true
    elif cat /etc/os-release | grep -q "jessie"; then
        IS_SUPPORTED=true && IS_EXPERIMENTAL=false
    elif cat /etc/os-release | grep -q "wheezy"; then
        IS_SUPPORTED=true && IS_EXPERIMENTAL=false
    elif cat /etc/os-release | grep -q "buster"; then
        IS_SUPPORTED=true && IS_EXPERIMENTAL=false
    else
        IS_SUPPORTED=false && IS_EXPERIMENTAL=false
    fi
fi
}

I did the above modification and vlc-radio installed and ran fine.

1 Like

you can also change the else statement to return true and false, The issue here is the end user shouldn’t have to know enough bash/programming to fix it themselves… Especially now they make the kit solder-less so parents/teachers/etc will likely called upon to “fix this garbage” when the kid they bought it for gets frustrated/pissed.

Additionally changing vlc-nox to vlc installs a fuller vlc instance (including youtube support [don’t know if it does yt channels/playlists], just add --no-video to vlcd file and you have an audio only youtube player), adding “–repeat” loops short files for things like pink/brown/whit noise + nature soundscapes. I’d also set a larger buffer before play default in vlcd is 10sec? i set mine to 60sec (does introduce a slight delay, but stops it doing studder-fest on starting playback of larger files)

One caveat of adding --repeat is it will repeat the bad files/down streams till you manually next them.

for those interested here’s my /usr/bin/vlcd
#!/usr/bin/env bash

sudo mkdir -p /var/run/vlcd

if [ -n $(cat /etc/passwd | grep -w "pi:") ]; then
    sudo chown pi:pi /var/run/vlcd
    if [ -f /boot/playlist.m3u ]; then
        mkdir -p /home/pi/.config/vlc
        sudo mv -f /boot/playlist.m3u /home/pi/.config/vlc/
        sudo chmod -R pi:pi /home/pi/.config/vlc/
    fi
    if [ -f /home/pi/.config/vlc/playlist.m3u ]; then
        playlist="/home/pi/.config/vlc/playlist.m3u"
    else
        playlist="/etc/vlcd/default.m3u"
    fi
else
    playlist="/etc/vlcd/default.m3u"
fi

volpref=$(grep "^alsa-gain" ~/.config/vlc/vlcrc)

if [ -z $volpref ]; then
    volpref="alsa-gain 0.065"
fi

/usr/bin/vlc \
--verbose 1 \
--repeat \
--no-video \
--file-caching=60000 \
--file-logging \
--logfile /var/run/vlcd/vlcd.log \
--$volpref \
--audio-filter compressor,volnorm \
--norm-buff-size 60 \
--norm-max-level 80.0 \
--norm-max-level -3 \
--compressor-attack 50.0 \
--compressor-release 200.0 \
--compressor-ratio 20.0 \
--compressor-threshold 0.0 \
--compressor-rms-peak 0.0 \
--compressor-knee 1.0 \
--compressor-makeup-gain 0.0 \
--intf dummy \
--extraintf rc:http \
--rc-host 0.0.0.0:9294 --rc-fake-tty \
--http-host 0.0.0.0 --http-port 8080 --http-password raspberry \
--no-quiet \
--daemon \
--pidfile /var/run/vlcd/vlcd.pid \
$playlist
1 Like

We’ve updated the vlcradio one line installer and it should now be working properly with Buster.

1 Like

is that the one dashboard uses as well? as i mentioned that previously was broke too

It looks like the pimoroni-dashboard menu options just point at the one line installers, so hopefully they should now be working too? I’ll give them a go.

EDIT: phat-beat and vlcradio both installing correctly for me using pimoroni-dashboard on Buster Lite 👍