How to get pikaraoke running through pisound

I’m using Patchbox OS to add reverb to the mic input on the pisound and it works good so far. I have also installed pikaraoke from GitHub - vicwomg/pikaraoke: Youtube-based Karaoke machine for Raspberry Pi, OSX, Windows, and Linux but it forces the audio through the headphone jack of the pi, not through the pisound… is there a way I can make it use the pisound instead of the built in headphone jack of the pi? It appears as though pikaraoke is using vlc as the video player and vlc is maybe using ALSA but I don’t want to confuse issues by assuming things :wink:

You have to configure the software to use the Pisound audio card, I see it has this argument:

  --adev ADEV           Pass the audio output device argument to omxplayer.
                        Possible values: hdmi/local/both/alsa[:device]. If you
                        are using a rpi USB soundcard or Hifi audio hat, try:
                        'alsa:hw:0,0' Default: 'both'

Check aplay -l output to determine the ID of Pisound card, usually it’s hw:1,0 or hw:2,0

Anyway, you should look for info how to configure that particular software to use an external audio card, including USB ones, and adapt that info for making it select Pisound.

In case you’re getting “soundcard is busy” errors, it’s likely because the Jack backend is already running. It’s preferable to make audio software use Jack, but some don’t support it, in that case you have to stop & disable the jack backend so it releases the Pisound:

sudo systemctl disable --now jack

To get it back, do the same as above, just enable instead of disable. :slight_smile:


I’m attaching the console output of running pikaraoke and attempting to play a CDG track by Depeche Mode. The pikaraoke server runs perfectly fine and when I added the track it played on the screen too with the proper video output. The karaoke song was not audible through the pisound but it was when I unplugged the headphones from it and plugged them into the pi headphone jack. Plugging the headphones back into the pisound and I can hear the mic input which is using modep.

The --adev ADEV argument seems to only be for omxplayer which does not support CDG which is what the player really needs since all f my karaoke tracks are CDG. Is there any ideas on how I can tell VLC to use whatever modep is using?

Launching desktop and loading patchage I can see that Patchbox comes with pulse ausio sink which is why I thought I could use pulseaudio for pikaraoke but I guess I need to use something else?

Is jack using pulseaudio? And if so do I need to tell pikaraoke to use jack? When I launch VLC from the desktop it plays video audio fine through the pi sound on top of modep.

Just found this:

Do I need to run pikaraoke as a particular user which is the same user which starts modep perhaps?

The docs state:
“You must run as sudo on pi devices if you are running directly from the console since PiKaraoke uses pygame to control the screen buffer. You can probably run as non-sudo from the Raspbian desktop environment, but may need to specify a different download directory than the default with the -d option.”

Could running as sudo be the issue here? I have tried running using “python3” but then get an error saying that the background graphic is not a bmp. I think it also needs sudo to create that graphic which contains a QR code…

This is how it looks when running as non sudo:

The pikaraoke software should be somehow in charge to let the underlying software it starts to know what audio configuration to use.

Do you intend to run both modep and pikaraoke at the same time? It might be an issue if pikaraoke does not support Jack as the audio server - in case it doesn’t, it most likely want to use ALSA, and only one program at a time gets access to it. Anyway, best to first get pikaraoke output the sound correctly first, without mixing audio software.

Check out the troubleshooting steps: GitHub - vicwomg/pikaraoke: Youtube-based Karaoke machine for Raspberry Pi, OSX, Windows, and Linux

It says how to get audio out of the Raspberry Pi headphone jack. I think you can follow the same steps but you should set the card to the Pisound number (you can find it by running aplay -l, you should see hw:1,0, hw:2,0 or hw:3,0 next to Pisound, use the major digit you see for the ALSA config files)

1 Like

I did intend to run both pikaraoke and modep at the same time. And I got it working eventually :slight_smile: First thing was to re-flash Patchbox OS and run the wizard and select the desktop auto login environment. Then I ran apt update and inatalled pikaraoke as per the instructions. I then ran it NOT using sudo and made sure to set the download folder to ~/pikaraoke-songs

This got it to run so I connected to it using my phone and started a song. No sound out of pisound but out of the headphone jack. So I shut the pi down and rebooted and on the second try the audio came out of the pisound. Winner :slight_smile:
So next I installed modep, then installed the lv2 modules as per instructions here [Plugins] Only 73 plugins available in modep - #6 by Pranciskus which removed python3-pygame so I uninstalled the plugin which removed it and re-installed pygame.

Then after another reboot I plugged in the mic and connected to modep, added a reverb and that worked on the mic. Running pikaraoke stlll worked so I was able to sing on top of the backing with effects applied. Awesome sauce :slight_smile:

1 Like