Randy the new RPi streamer and player on the block

Thanks for the logs @DRONE7

I have a feeling for what the issue is:

* Option 1 - did you change the user name when writing the RPI OS lite to something aside of 'pi'? - it maybe looking for the /home/pi/Randy/index.js , but your home directory is named after the new username instead. you can check that by seeing the dir when you ssh or writing the command "pwd" which will tell you your home directory

If it's option 1 - then it's cool you found this and I will try to make the installation script agnostic to this.
in the meanwhile you can sudo nano /etc/systemd/system/randy-node.service and change where it says /home/pi/.. to /home/[your user name]/... save and restart.

* Option 2 - perhaps the project files didn't download and untar, you can check that if you ls you should see a directory called 'Randy'

btw, I am aware of the name connotation :) maybe it will evolve into Randolph if people find it offensive..
 
Option 1 fixed it ! (Yes, I changed the username and password as exhorted by the RPi foundation and the security settings for the new RPi imager.)
Great catch and many thanks... now off to set up NAS etc.
Yes, interesting namings for several projects...Collybia for the mushroom ;-) and Snakeoil OS...

Best regards,
Bob
 
Great news! Bob (@DRONE7)
I updated the install script.. so it should work for others even if they change their usernames! Thanks for catching this one.

I am curious about your NAS set up! I don't use a NAS so please let me know how you are setting it up and I can add it to the wiki.
Technically if the NAS folder is mounted you should be able to set it up under settings -> music source -> custom path

Gideon
 
perhaps you might wish to consider other naming

People get offended by so many things these days.
Randy.jpg
 
@mbrennwa - yup its on my todo list to look at ways to make it easier to install.
For it to run as an always on streamer that you can run on a standalone device like a RPI and control over the network it has some magic to keep it running such as daemons, automounting usb drives etc.. It can technically also run locally as a normal music player but that brings another set of things to look at.

So I've been checking out different ways to package it, for RPI there is a project called rpi-gen which let's you package it as an os image and for others I am thinking of something linux packages like you suggest and something like electronjs for desktop apps. But I want to get a feeling if people like it as well :)

--
@TNT - thanks for your sharp catch :) - fixed USD -> USB. I wonder how USD DACs sound like...


Yeah MPV is a beast! similar to VLC it does pipe things to ffmpeg/libav so there is amazing support for almost everything you can imagine + it's directly integrated with yt-dlp which means you can play streaming content off of a lot of websites.
For example in Randy you can paste urls from mixcloud into the search bar and if it finds a stream in it, it will just play it.
I’ve been doing a lot of work lately with that same basic set of tools (mpv, ffmpeg/ffprobe, and yt-dlp). I’m using Whisper AI to transcribe the vocals from the audio tracks of videos downloaded mainly using yt-dlp. I typically remove subtitles if they exist and create them in several languages and rewrite the video using the updated subtitles (usually much improved). mpv is a great all-around player and I usually use it for testing. You’re right about the ease of creating pipes using these tools to facilitate tasks - it’s even possible to run several operations in parallel, particularly with ffmpeg and friends.

I also do much of my work on a mac, but the problem I run into is that there are a huge number of library dependencies, and if I need to use a version of one or more of those that’s not part of the the OS-managed packages, sometimes it’s difficult to get them to play nice together, not to mention keeping them from stomping on one another. I’ve settled on Docker using a Debian base OS to minimize those headaches. Have you considered using that? I throw nvm on the docker image for similar reasons - it makes it pretty easy to keep the version of nodejs you’re using consistent, and test with others if needed.

I just happened to be getting an Rpi together this evening with the intention of using it as a player at home, and now I can check yours out! (Btw, if you do go the docker route you can use runit as a dead-simple but effective way to keep your app up as a daemon. Not that systemd is bad; I just have a love-hate relationship with it. :).
 
@levo0101 - Really exciting project you are doing!
I've been thinking about the same in the past couple of days.. my experience with doing these kinds of things with Docker is that it doesn't play well with hardware but maybe this has changed. I agree with you that freezing a good combination of dependencies that work with each other is always a better practise.
Many options on the table and eventually I want to find a couple of best bang for buck ways to make it super accessible to as many people to try out.

btw, in the past I got Randy working on:
  • Alpine on RPI (not in a docker image) - it was super slim and I loved the speed of APK and also used runit to keep node running which was great, however there was some issues with playing music consistently off usb drives it had some hiccups here and there and also Apline on RPI is not very maintained and I was afraid there wouldn't be RPI4 support etc..
  • Void on RPI - again amazing slim OS, everything was super smooth and no issues with usb + runit, but the support and maintenance for RPI was abandoned.
  • Dietpi - was a bit of a PITA to be honest.. lots a of issues with boot sequence where my DAC wasn't recognised

My conclusion has been to stick with RPI OS Lite which is recently keeping up with the latest kernels and is pretty hiccups free.

On my rough todo list is to test an Unbuntu server installation script on RPI and an Intel NUC, so I get wider potential support for thin clients with intel chips and SBCs that support ubuntu and get more feedback from testers. Then look into way to make it even simpler.

@DRONE7 - you are right, all the south park episodes I watched were on my good old fujitsu laptop and off DVDs a friend of mine burned. The character Randy Marsh is a Father, Husband and constant inventor of out of the box ideas.
 
This look like a fun project to try. I have an Orange Pi Zero and an USB DAC/HPA.
If it works I will order an Orange Pi R1 Plus LTS in a simple/nice metal housing.

The install.sh downloads a number of packages, is there anything I should install on my old (November 2021), blank OPI Z DietPI image, before running your install script?
Last week my dietpi image for my Orange Pi (OPz) failed to start and I used the latest Dietpi image for the RPi ZeroW (on my RPi ZeroW).
With some manual changes and support from Gideon, I got it to work.
Today, I burned the OPz image to another SD and tried again with the OPz. Dietpi upgraded itself to the most recent version.
I enabled Audio via the dietpi-config configurator.
Connected via ssh fom my mac, the OPz returns an empty value for 'logname', I don't know exactly why.
(Gideon tested it and for him logname always returns a value.)
I downloaded the install script and replaced the call to logname by whoami.
Then I executed the script and it ran flawless.
After a reboot, I can listen to internetradio, although not all the stations -I listen to- play and I miss a volume control (or perhaps the expensive DAC I used doesn't have one...)
As it is, this is probably one of the cheapest players you can put together.
Thanks @gideon
 
  • Like
Reactions: 1 user
Member
Joined 2023
Paid Member
Had this running for minutes but the following process was pegging the CPU. Looks like it's stuck on a file for some reason. A service restart cleared the problem that several reboots did not.


Sysinfo:
rpi4b, ethernet cable, allo boss HAT, USB 2.0 connected soekris DAC
Linux randy 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
Music library mounted via smb to a NAS share
Only about 50 albums in the test library

Top output:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
576 root 20 0 803572 96084 36692 R 100 1.2 1:29.18 node

username@randy:~ $ sudo systemctl status randy-node.service
● randy-node.service - Randy nodejs application daemon
Loaded: loaded (/etc/systemd/system/randy-node.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-05-25 07:00:47 EDT; 11min ago
Main PID: 576 (node)
Tasks: 18 (limit: 8755)
CPU: 10min 59.785s
CGroup: /system.slice/randy-node.service
├─576 /usr/bin/node /home/username/Randy/index.js
└─602 mpv --no-config --af-clr --vf-clr --vid=no --no-video script-opts=ytdl_hook-ytdl_path=yt-dlp --audio-display=no --no-initial-audio-sync --ytdl-format=bestaudio --idle=yes --quiet --input-ipc-server=/tm>

May 25 07:00:47 randy systemd[1]: Started Randy nodejs application daemon.
May 25 07:00:53 randy randy-node[576]: [25.05.2023 07:00.53.811] [LOG] Welcome to Randy - localhost:80 - !
May 25 07:00:53 randy randy-node[576]: [25.05.2023 07:00.53.911] [LOG] getAllSongs
May 25 07:00:53 randy randy-node[576]: [25.05.2023 07:00.53.959] [LOG] Randy on port 80
May 25 07:00:53 randy randy-node[576]: [25.05.2023 07:00.53.967] [LOG] initPlaylist and setting watchers
May 25 07:00:53 randy randy-node[576]: [25.05.2023 07:00.53.970] [LOG] getting metadata for "/mnt/Music/Black Sabbath/Heaven and Hell/03 Lady Evil.flac"
May 25 07:00:53 randy randy-node[576]: [25.05.2023 07:00.53.987] [ERROR] Error getting file metadata - ENOENT: no such file or directory, stat '/mnt/Music/Black Sabbath/Heaven and Hell/03 Lady Evil.flac'
May 25 07:00:53 randy randy-node[576]: [25.05.2023 07:00.53.988] [ERROR] - for file:/mnt/Music/Black Sabbath/Heaven and Hell/03 Lady Evil.flac



The file exists:
Screenshot 2023-05-25 072004 - Copy.png
 
Last edited:
@Sumaco - thanks for testing it out and giving good information for debug.

It's interesting, technically it should just skip and move to the next file.. the CPU hog could be because it was moving through a lot of files quickly and failing each time?
Could it also be some lag between your NAS mounting and Randy starting up, perhaps thats why it doesn't work on reboot but works after you restart the daemon and maybe the mount is good. I don't have a NAS to test with but I will try to see if there is a good way to handle these kind of situations.

If you are able to replicate it again:
  • please DM to me the output of - journalctl -f -u randy-node
  • you can also try to run the file with mpv from console and see if it's able to pick it up - mpv --vid=no --no-video '/mnt/Music/Black Sabbath/Heaven and Hell/03 Lady Evil.flac'

Aside of that:
  • when you restarted the service was it playing OK or still stuck?
  • is your DAC showing up in alsamixer properly

I plan to tackle more of these edge cases that you and others bring up :) so this is super helpful.
 
Member
Joined 2023
Paid Member
Thanks for getting back to me. I can't reproduce the problem and I will chock-up to scanning & playing at the same time by being impatient. I will however keep you posted if any happens again.

NAS:
Randy is mapped against a small dev set of albums on the same NAS as my production music library. This is a multiple NIC bonded connection so output is not an issue. Rpi will be on deathbed overheated and throttled before the network is a problem. :whistle:

I do have a USB through Randy playback problem however and I believe could be a conflict with my Allo BOSS v1.2 HAT attached to the rpi. Is this a supported use case for the current release of Randy? USB connection with HAT attached... I am thinking it doesn't matter because it would be dependent on the selected overlay at boot, card 3 in my case, but please confirm.

No problem playing from the cli like (mpv --vid=no --no-video '/mnt/Music/Black Sabbath/Heaven and Hell/03 Lady Evil.flac') which you suggested above. DAC is recognized as default play device. Background info: Riopeee plays both USB and HAT so I know the hardware data to analog paths are functional.

username@randy:~ $ aplay -l
** List of PLAYBACK Hardware Devices **
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 7/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 1: vc4hdmi0 [vc4-hdmi-0], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: vc4hdmi1 [vc4-hdmi-1], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: S20 [Soekris dac1xxx USB Audio 2.0], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
username@randy:~ $ mpv --vid=no --no-video '/mnt/Music/Black Sabbath/Heaven and Hell/03 Lady Evil.flac'
Video --vid=1 [P] (mjpeg 500x500)
(+) Audio --aid=1 (flac 2ch 192000Hz)
File tags:
Artist: Black Sabbath
Album: Heaven And Hell
Album_Artist: Black Sabbath
Comment: The Rules of Hell
Date: 1980
Genre: Heavy Metal
Title: Lady Evil
Track: 3
AO: [alsa] 192000Hz stereo 2ch s32
A: 00:00:07 / 00:04:25 (2%) Cache: 77s/54MB


Exiting... (Quit)

I'll ping you the output of a clean restart from syslog and the journal output.
 
Member
Joined 2023
Paid Member
More functional testing results.

Validated the overlay instructions on the Wiki work for the addition of the Allo Boss HAT. Both outputs sound nice. :)

Deleting a few folders did not rescan in the library and left the log with file not found errors (of course)
Library still thinks there are 91 albums even though a dozen were deleted.
Deleted everything in source NAS folder - "B" titled Artists
Still reports 91 albums.
Copied in a bunch of new folders starting with "L" artists
Still reports 91 albums.
Reboot
Still only "B" artists.

Is there a way to flush & rescan the library?

Randy Library view:
Screenshot 2023-05-25 205800 - Copy.png


Subset of current mount point view:

username@randy:~ $ du -h /mnt/Music
8.0K /mnt/Music/@Recently-Snapshot
416M /mnt/Music/Lee Bannon/Pattern Of Excel
416M /mnt/Music/Lee Bannon
424M /mnt/Music/Lee Fields & The Expressions/Special Night
424M /mnt/Music/Lee Fields & The Expressions
1.1G /mnt/Music/Lee Konitz/Dig Dug Dog
1.1G /mnt/Music/Lee Konitz
879M /mnt/Music/Lee Konitz, Pony Poindexter, Phil Woods, Leo Wright/Alto Summit
879M /mnt/Music/Lee Konitz, Pony Poindexter, Phil Woods, Leo Wright
1012M /mnt/Music/Lee Michaels/Tailface
1012M /mnt/Music/Lee Michaels
1.7G /mnt/Music/Lee Morgan/The Gigolo
1.8G /mnt/Music/Lee Morgan/The Cooker
1.7G /mnt/Music/Lee Morgan/The Rumproller
5.1G /mnt/Music/Lee Morgan
571M /mnt/Music/Lee Ranaldo/Electric Trim Live at Rough Trade East
571M /mnt/Music/Lee Ranaldo
1.3G /mnt/Music/Lee Ritenour/Rhythm Sessions
524M /mnt/Music/Lee Ritenour/Dreamcatcher
1.4G /mnt/Music/Lee Ritenour/A Twist Of Rit
3.2G /mnt/Music/Lee Ritenour
564M /mnt/Music/Le Flex/Pay Close Attention
564M /mnt/Music/Le Flex
1.4G /mnt/Music/Legendary Pink Dots/A String Of Zeroes (The Legendary Pink Dots 2000 - 2010)
1.7G /mnt/Music/Legendary Pink Dots/A Ticking Clock 1990 - 99
880M /mnt/Music/Legendary Pink Dots/Live In Kontich 1986 (Divine Providence Flamande)
4.0G /mnt/Music/Legendary Pink Dots
704M /mnt/Music/Legends Shall Fall/Grief
704M /mnt/Music/Legends Shall Fall
 
@Sumaco - looking good! I am glad it's working for you.
I am going over your DM as well and digesting things, but just so others can also learn you mentioned that it worked with a new client and can you share some more details around it.

Regarding your question about rescanning the library:
  • How often do you change your library?
  • Right now the way to do it in Randy is to re-set the same folder from settings
  • I am using nodejs which has some elegant ways to watch for file changes but I was thinking it may add more background processing love which could go to music processing love! but it maybe worth looking into as well and see if it does affect the sound.

On one of the new releases, I will put some measures to better handle situations where the files are unreachable to prevent CPU issues and give some feedback on the web app.
 
Some good news and progress before the weekend kicks in:

I published a new release (Randy 1.0.13):

  • Added a new better check for situations when files are not accessible (Thanks @Sumaco)
  • Added better handling of DB saving for situations where there is no music folder (thanks @PJVervoon)
  • Added experimental update.sh script which updates the latest release and retains the db files
For the new update script, if you don't want to go through reinstalling the sd card or other unpleasant ways you can use it with these commands

Code:
sudo chmod +x ./update.sh
sudo ./update.sh

At some point, this will be also accessible from randy interface.

All thanks to @PjVervoorn @Sumaco @DRONE7 for finding really interesting edge cases and helping to make Randy better for everyone else.

Ubuntu Server on Intel NUC (Thin Client) and RPI​

Good news for Thin clients - I finally got the Intel NUC from my friend and tested it with the install script.
It worked out of the box and I am now happily listening to good music from it!

For Intel NUC and also RPI, I installed the vanilla Ubuntu Server on it and once ssh was working I just ran the same install script (changed a generic name)

Code:
curl -L https://raw.githubusercontent.com/PapaSimons/Randy/master/install.sh -o install.sh

sudo chmod +x ./install.sh

sudo ./install.sh

Everything works well, just note that it's worth to check if the DAC is connected first.

If you are trying Randy on a thin client (or SBC) please share the experience so I can add more info to the wiki:
  • Model, OS (if it's not Ubuntu Server)
  • DAC set up
  • What works, not works
  • issues, delights
  • other useful details

@thyristor44

Also indirectly I've learned about a lot of new good music from the logs and troubleshooting from the other members, here's a cool one to check out:

1685099798509.png


Gideon
 
  • Like
Reactions: 1 user
Member
Joined 2023
Paid Member
@Sumaco - looking good! I am glad it's working for you.
I am going over your DM as well and digesting things, but just so others can also learn you mentioned that it worked with a new client and can you share some more details around it.
I was referring to the steps provided for I2S and configuring the overlay for the All BOSS HAT. Link is here.

@Sumaco
  • How often do you change your library?
  • Right now the way to do it in Randy is to re-set the same folder from settings
  • I am using nodejs which has some elegant ways to watch for file changes but I was thinking it may add more background processing love which could go to music processing love! but it maybe worth looking into as well and see if it does affect the sound.

On one of the new releases, I will put some measures to better handle situations where the files are unreachable to prevent CPU issues and give some feedback on the web app.
Well, not that often however keep in mind that a tag or cover art update to a media file will update the Last Modified timestamp which should be accounted for in the database if there is a change to an attribute you may depend on. node.js can certainly build that array for you on a rescan.

Resetting the library path cleared and reset the library! Thank you...

Thank you, and I see you have a new code release. I will refresh and update later today.
 
  • Thank You
Reactions: 1 user
@Sumaco
Hoping you can help with NAS access.
I have an Open media Vault NAS that is found by other players without problem. (MoOde, Volumio, rPlayer) but not by Randy.
I have configured for guest access with no joy, specified client as Randy IP with no joy, setup smb on Randy for the NAS mount with no joy.
Not sure what I am doing wrong or without but if you could outline the steps you made to configure/access your NAS it would be most appreciated.
(currently all that Randy reports is that "Something went wrong" lol ...must have borrowed that phrase from Redmond !)

@gideon Excellent info for the Thin Client release. I will try tomorrow on an HP 610 and report.
 
Ran the update this morning, without issues.

For those (like me) that installed the version without the update script, it is easy to download and run the updater.
Just modify the original install commands:
Code:
curl -L https://raw.githubusercontent.com/PapaSimons/Randy/master/update.sh -o update.sh
sudo chmod +x ./update.sh
sudo ./update.sh

You don’t need big hardware to listen radio streams. Playing 320k FluxFM Kompensator stream On my Orange Pi Zero (running DietPI):
Screenshot 2023-05-27 at 09.52.00.png
 
  • Like
Reactions: 2 users