Hardware part 1
The first device that I created was made using the casing of a defective internet radio,
which I equipped with a capacitive 5-inch touchscreen from Waveshare
and a Raspberry Pi 3 with Hifiberry Amp 2. At that time, I didn’t have a 3D printer, so I mounted everything using small sheet metal brackets,
making it nearly impossible to replicate it (you’d need the exact same casing), but maybe the pictures will inspire you to come up with
your own solutions. The most interesting part is that the device is on a shelf above a door, so you are looking at it from underneath.
And because it is not an IPS panel , the picture looks terrible from this angle. Therefore it was necessary to install the display
upside down.
The necessary parameters to rotate the Raspberry’s image content on a touchscreen are also listed in the instructions below.
Hardware part 2
For my second Raspberry Pi player, I opted for a slightly larger display, choosing a model with a 7-inch IPS panel and a casing
suitable for the Raspberry Pi 3 and 4.This product comes from the manufacturer Shenzen Dusun Technology Co. Ltd.
and is sold by various importers under different names.
I bought it from Amazon, but I'm not linking it here anymore, because as of Augist 2023, a completely different device is being
sold under the product number of my purchase from eight weeks prior (and the positive reviews do not correlate with this new
device). The display is now found under the brand name
UPERFECT.
Addendum: Three days after I wrote the previous update, only the 10-inch model is still available for purchase (where
the display could be ordered as a 7-inch and 10-inch version).
Reliability from these Chinese sellers is questionable, but I'll leave the link as is; just don't be surprised if a
completely different product appears there there —I can’t monitor this product page continuously. The10-inch size
is certainly not wrong, but it also costs significantly more.
I have
made three comparison pictures to assist you in your search.
I mention this in such detail because this device was easy to assemble and works well thanks to the many small
parts supplied. The rear panel includes M3 VESA screws at a spaced 75 mm apart. I use a
Digitus DA-90303-1 monitor wall
mount for wall mounting, where the casing is attached using V-shaped rails. The only drawbackis the built-in fan,
which produces slight noise. It has been replaced by a
Noiseblocker NB-BlackSilentFan XM-1 40x40x10, although this required small cable
connectors or some soldering due to different connectors.
I designed and printed a rear panel extension to fit the Hifiberry amplifier into the case
(my 3D printer is an FDM model from Anycubic); the
OpenSCAD and STL files are available for replication. This
extension fits both in the 7-inch and the 10-inch version of the case.
If you want to use the housing extension for something else, you can adjust its depth by changing the variable za. If
necessary, translate the German comments in the OpenSCAD code.
Software
On the Raspberry, the program, the music and the lyrics are stored on an external USB drive (which must be called MUSIC_LRC), the
Raspberry is write-protected and operates with an overlay file allowing for easy shutdowns, and straightforward swapping of the
program, settings, and music collection for upgrades.. On system startup, the program is copied to the home directory via an
autostart entry in /etc/xdg/lxsession/LXDE-pi/autostart ,made executable and launched there.
The script startLyricsJukebox.sh and the program fullscreenmessage should be placed in /home/pi, set to executable. (With the
current Raspberry Pi OS version lacking the Pi user, I have simply created this standard user again, of course it could be
done differently).
All required files are compiled on the download page in the archive for the Raspberry.
Steps to set up a Raspberry player with Hifiberry Amp 2 and either the 5-inch display from Waveshare or the 7-inch and
10-inch case monitor:
(This step-by-step guide was written at the end of 2022, expect changes with operating systems and adjust the setup
accordingly.
These notes are just for my reference, so if they are too concise, feel free to complain :)
- Install Raspberry Pi OS on SD card using imager_1.7.3.exe
- Mount the Raspberry and display
- Set up the 5-inch display from Waveshare according to the instructions
(this is not necessary for the 7-inchdisplay with caseing)
- Start the Raspberry, configure the standard user and install updates (this will be done automatically if
there is an available Internet connection via ethernet or Wi-Fi). Assuming you have set up the standard
user for older Raspberry OS versions:
username: pi
password: raspberry
- Deactivate the screen saver:
Menu button / Settings / Raspberry Pi configuration / Display tab / Disable screen wipe
- The following steps assume that the user pi exists. With current RaspberryOS versions, this is
no longer necessarily the case, so either create the user pi during the initial setup (as specified
above) or adapt the name pi in the files autostart and
startLyricsJukebox.sh and in the paths mentioned below to the user name created.
- Start terminal
- sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
add the line at the end of the file:
@/home/pi/startLyrics_Jukebox.sh
- Save (Ctrl-O, Enter) and exit (Ctrl-X)
- Copy the files startLyricsJukebox.sh and fullscreenmessage
(which are located in the Rasperry directory of the downloaded archive) to /home/pi and
- make them executable
chmod +x startLyricsJukebox.sh
chmod +x fullscreenmessage
- Testing:
./startLyricsJukebox.sh
- Install Hifiberry Amp2. (The power supply runs via Hifiberry Amp2, 12V to 6A or 24V to 3A, power
supply with round plug 5.5x2.1mm, positive pole inside).
Edit /boot/config.txt:
sudo nano /boot/config.txt
Comment out or remove dtparam=audio=on.
If dtoverlay=vc4-fkms-v3d is present, switch off audio:
dtoverlay=vc4-fkms-v3d,audio=off
insert dtoverlay=hifiberry-dacplus.
- rotate the image only if necessary:
display_rotate = 2
- Save (Ctrl-O, Enter) and exit (Ctrl-X)
- and only rotate the touch screen if necessary
(according to these
instructions):
sudo nano /usr/share/X11/xorg.conf.d/
there in the
Section "InputClass"
"Identifier libinput touchscreen catchall"
add the line
Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 0 1"
- If everything works, write-protect the file system:
Menu button / Settings / Raspberry Pi configuration / Performance tab / Overlay file system / Configure:
Enable overlay and boot partition.
Problems and solutions
-
With the second player presented, the power supply I used was slightly underpowered for the three components Raspberry,
monitor and amplifier at high volume. This initially seemed like a non-issue as the device was operated at low volumes.
However, there was an incident where the volume was set very high, causing the voltage for the Raspberry to drop too
low and the system crashed. It rebooted immediately, which would not have been disastrous, but unfortunately there was
enough time before the crash to write the changed settings onto the USB flash drive, resulting in a very loud noise
and an immediate subsequent crash upon reboot.
This annoying reboot loop (during a birthday party) led to the addition of the VolumeMax and RadioVolumeFactor settings.
VolumeMax sets the volume as the upper limit at which the device will still run reliably, and RadioVolumeFactor can be
used to adjust the volume of the radio (since the most listened-to station was played much louder by VLC than its own
music tracks).
-
Initially, I equipped the Raspberry with small heat sinks attached with thermal pads. This was not a great idea, as the
adhesive properties of these pads apparently deteriorated and they eventually fell off when the Raspberry is installed
upright. This caused a short circuit that damaged my HifiBerry amp.
Since the case is cooled by a fan and a Raspberry Pi 3 or 4 can generally run without a heatsink, I just left it out,
which didn't cause any problems, as expected.
-
Some music files, especially on the Raspberry, caused noise while playing. This was caused by MP3 files that did not have
unsychronization enabled when the ID3 tags was written. (This means that there may be a byte sequence in the ID3 tag
area that marks the start of a frame in the music data). As a countermeasure in such a case, it is of course helpful to rewrite
the tags with a suitable program, but the PreLoadMusic configuration entry should also help.