Setting Up PiKaraoke in Kiosk Mode on Raspberry Pi with Bookworm Lite OS #430
Replies: 10 comments 5 replies
-
Excellent guide! Really good to know that this helps performance on the pi 3. Did not realize the desktop introduces that much CPU overhead. I will add to the wiki. |
Beta Was this translation helpful? Give feedback.
-
Thank you for making this tutorial. I tried it a week or so ago and was sure I followed all steps quite closely. It didn't work. When everything was done it just booted into the regular prompt. I used the 32 bit Bookworm Lite OS. Should I have used the 64 bit? I couldn't think of anything else that would be different from what you did. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the quick reply. I had already setup Auto Login. I've got a fresh 64 bit Bookworm Lite OS ready to give another try. There was one other place in the instructions I wasn't completely sure about. There was a point where there were further steps to follow and the prompt was the venv prompt. Was I supposed to exit out of that or execute the commands using that prompt? |
Beta Was this translation helpful? Give feedback.
-
No, you should run them in venv. |
Beta Was this translation helpful? Give feedback.
-
OK, I just remembered something else. It seemed like the user/password should be pi and pikaraoke. Is that correct? It doesn't seem like that is specifically noted anywhere. |
Beta Was this translation helpful? Give feedback.
-
Negative. That was way back when vicwomg was building the whole disk image. Today the user is whatever you make it. The default credentials are pi/raspberry for all of the standard raspian OS builds. Sent from my iPhoneOn Dec 6, 2024, at 2:36 PM, dublus ***@***.***> wrote:
OK, I just remembered something else. It seemed like the user/password should be pi and pikaraoke. Is that correct? It doesn't seem like that is specifically noted anywhere.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
OK, this part seemed confusing: [Service] Since I don't have a pi user. There would be no path: /home/pi/ or am I missing something? |
Beta Was this translation helpful? Give feedback.
-
Well, still no luck. Just boots into the normal prompt. As a last resort I'll ask a couple things that could have gone wrong on my end. I'm seeing a space after the first "." . When you say "Create a .venv directory in the home directory:" and "Create a .xinitrc file in the home directory:" do you literally mean in the "home" directory? Because even if I'm in the "home" directory it always puts it in the "/home/pi" directory. |
Beta Was this translation helpful? Give feedback.
-
Any thoughts on building on the FullPageOS? Others had success using my wiki.Sent from my iPhoneOn Dec 7, 2024, at 4:01 AM, Leonardo Moreira ***@***.***> wrote:
To try to help, I used chatgpt to see if it enlight's us. Try these:
1. Check the startx.service
Ensure that the service was created correctly and is active.
Check the service status:
sudo systemctl status startx.service
Expected Output: It should indicate the service is active (running). If there are errors, note them.
If the service is not running, try starting it manually:
sudo systemctl start startx.service
If errors occur, review the service file to ensure its content matches the tutorial:
sudo nano /etc/systemd/system/startx.service
2. Check the .xinitrc
Ensure the ~/.xinitrc file contains the correct configurations and is in the right location.
Open the file to verify:
nano ~/.xinitrc
Expected Content:
#!/bin/sh
xset -dpms # disable DPMS (Energy Star) features
xset s off # disable screen saver
xset s noblank # don’t blank the video device
. ~/.venv/bin/activate
exec openbox-session & pikaraoke
Ensure the file has executable permissions:
chmod +x ~/.xinitrc
3. Verify the Virtual Environment
Confirm that the virtual environment exists and pikaraoke is installed.
Activate the virtual environment:
source ~/.venv/bin/activate
Check if pikaraoke is installed:
pip list | grep pikaraoke
Expected Output: It should list pikaraoke along with its version.
4. Test Startx Manually
Try starting the graphical environment manually to see if errors occur.
Run the command:
startx
If the graphical environment fails to start or errors appear, note the messages displayed.
5. Check Logs for Errors
Examine system logs to identify potential issues.
General system logs:
journalctl -xe
Logs specific to the service:
journalctl -u startx.service
6. Other Possible Causes
Wrong user in the service: The startx.service file specifies the pi user. Ensure you’re using the correct username. If you’re using a different user, replace pi with your username in the service file.
Missing packages: Ensure all necessary packages are installed:
sudo apt-get install ffmpeg xserver-xorg xinit chromium-browser chromium-chromedriver openbox -y
Display permissions: You may need to set the display permissions:
export DISPLAY=:0
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
It's working now! I have a feeling the problem was something different each time but in my sleep deprived state last night I made a typo on "WorkingDirectory" and instead had "Workingdirectory". That's the only thing I found and after I changed it it worked. That's the good news. The bad news is there's something weird about the key changer. If I change the key the song stops as usual to start over with the new key but it never starts again. Just shows the song as the "Up next" song in the queue and in the home screen it says "Nothing is playing". In the admin interface it shows the CPU at 100%. That reminds me that I should have asked about the key changer from the beginning. Do you have it working without any stutter? If I run Bookworm on my Pi3+ in desktop OS the song can't play smoothly once I change the key. I was hoping that running the lite OS might help. |
Beta Was this translation helpful? Give feedback.
-
Inspired by the discussion started by @romeo1984 about running pikaraoke kiosk mode with FullPageOS, I decided to write this tutorial on running pikaraoke in kiosk mode with the "native" Bookworm Lite OS.
My issue was that using the RPI OS with desktop on my Pi 3b+ was making the system too slow and the easy solution was to overclocking my Pi which I didn't wanted to, so I found this solution on running the chromium without the need of the desktop which consumes less resources.
Is important to note that I'm using a Pi 3b+, I don't see why it wouldn't work with other pi versions, but I can't test them.
First I installed the Bookworm Lite OS on my SD card, using the Raspberry Pi Imager.
In the Imager, you can configure the Wi-Fi SSID, password, and SSH keys. If you're unfamiliar with this, just select the OS image and proceed. We'll configure Wi-Fi directly on the Pi later.
SD card with image, plug it on the pi and start it on.
Configuring Wi-Fi:
After the boot process, run
nmtui
This will open the Network Manager where you can go to "Activate a connection", select your Wi-Fi and activate it. After that, exit the manager and let's start running some commands.Steps
1. Updating the repositories:
It's always a good practice to update your repositories.
In the CLI, run:
3. Installing the necessary componentes:
Now we will install the necessary stuff to run the PiKaraoke and to run it in kiosk mode.
In the CLI, run:
4. Installing Pikaraoke
Now we create and activate the virtual environment and install PiKaraoke
Create a .venv directory in the home directory:
Activate your virtual environment:
Install PiKaraoke from PyPi:
5. Configuring Kiosk Mode
In this step, we will configure the RPi to start the right things to run in kiosk mode
Create a .xinitrc file in the home directory:
Add the following to launch the browser in kiosk mode
Creating a Systemd Service to Start the System
Create a new service file called startx.service in the /etc/systemd/system/ directory:
Add the following content to the file:
Reload the systemd services to recognize the new service:
Enable the service so that it starts automatically on boot:
And thats it!
One more thing
If you want to change the audio output, you can try the following:
It will list the playback hardware devices and show something like this:
Based on this, you will look for the desired output. In my case:
HEADPHONE - it is card 0
HDMI - it is card 1
Now, in the CLI, run:
clear everything (or comment out the lines with a
#
) and put this in place, changing 0 to the desired output card number:That's it. Hope it helps someone out there.
@vicwomg keep up the excellent work. Let's have fun!
Beta Was this translation helpful? Give feedback.
All reactions