See Post #4 for updated playbook v2
UPDATED v2.1:
I have spent the past few days figuring this out due to my own inexperience and mistaken my USB connections, and I have now gotten it working and verified with another fresh install. My usecase is likely unique as I didn’t find any previous thread on the matter, and even more “gotchas” with my hardware. These are my exact steps for my hardware so it may not work for you exactly, and I provide this a reference that it can be done.
Hardware:
Pi 4b w/ 8gb
LCDWIKI 8" 1280x800 HDMI touchscreen
POE HAT
Generic Power Filter HAT
Generic “Hifiberry Digi” HAT
Samsung Soundbar
Scenario:
My Pi4 was my first Volumio build so I tinker the most with it. It was originally hooked up to a SMSL DAC via USB and outputs thru various audio HAT’s. For my daily use, I now run a Pi5 with another enclosure and I’ve been looking to make more use of Pi4 instead of a just a smart clock/weather station. The Pi4 was originally powered and networked thru POE and moving it closer to the sound bar meant I had to try a few things I wasn’t planning on, namely wifi and USB power. These 2 functions now causes the Pi4 to draw more power than before so I ran into a few gotchas:
- To ensure everything is powered adequately, the screen now attaches 1 USB port to power and another to the Pi for touch controls. With POE, I was able to power the screen thru the Pi4’s own USB2 port but I found doing so now might cause instability.
- I’m now using a OnePlus USB charger as my PSU to solely power the Pi. I’m sure the power requirements may lower if I removed the HAT’s for this application but I couldn’t be bothered for now. There are no perceptible noise or emi from this.
- I now have to use the built in hotspot for initial setup.
- ***I arrived at these steps with the help of ChatGPT. It had suggested various scripts and hacks that I have also tried to no success.
- I’m not sure if a OTA update will kill these tweaks.
Goal:
I simply wanted to output video-only to HDMI_0 port and audio-only to the HDMI_1 port. Due to my screen being more like 16x9 in resolution scale vs the typical 1280x780 video signal expected by the soundbar, I had to try many different things that did not work. I’ve finally tested the following steps and duplicated it again for verification. Since I’ve spent so much time on this, I hope it may help someone else in the future.
Steps:
-
Flash Volumio on media, install, setup, activate DEV. Connect touchscreen [HDMI_0] and sound bar [HDMI_1].
-
Install “Touch Display” and “Now Playing” plugins. Reboot and enable both.
-
Edit userconfig.txt:
sudo nano /boot/userconfig.txt
# --- Pi4 Customization ---
arm_boost=1
max_usb_current=1
dtoverlay=vc4-kms-v3d-pi4,audio=on
disable_overscan=1
hdmi_blanking=0
config_hdmi_boost=7
# --- Force HDMI0 to native at boot ---
hdmi_force_hotplug:0=1
hdmi_ignore_edid_audio:0=1
hdmi_drive:0=1
# --- Force HDMI1 audio at boot ---
hdmi_force_hotplug:1=1
hdmi_force_edid_audio:1=1
# --- Light OC for smooth UI ---
gpu_freq=650
over_voltage=4
force_turbo=0
# --- Disable unused buses ---
dtparam=spi=off
dtparam=uart=off
-
Reboot.
-
Create a tiny helper script and make it executable:
sudo nano /usr/local/bin/fix-outputs.sh
#!/usr/bin/env bash
# Robustly set display layout + touch mapping for Volumio Touch Display
# Works with vc4-kms-v3d on Pi 4
export DISPLAY=:0
export XAUTHORITY=/var/lib/volumio/.Xauthority
log() { echo "[fix-outputs] $*" | systemd-cat -t fix-outputs -p info; }
# Wait for X to be up
for i in {1..30}; do
if xrandr >/dev/null 2>&1; then break; fi
sleep 1
done
# Ensure connectors are present
xrandr_out="$(xrandr)"
echo "$xrandr_out" | grep -q "^HDMI-1 connected" || { log "HDMI-1 not connected"; exit 0; }
echo "$xrandr_out" | grep -q "^HDMI-2 connected" || log "HDMI-2 not connected (ok if soundbar off)"
# 1) Set HDMI-1 (LCDWIKI) to native 1280x800 and primary
xrandr --output HDMI-1 --mode 1280x800 --pos 0x0 --primary --rate 60 --dpi 120
# 2) Put HDMI-2 (soundbar) to the right so outputs don't overlap
# Choose a common stable mode on the bar (fallback 1920x1080@60)
if echo "$xrandr_out" | sed -n '/^HDMI-2 connected/,/^\S/p' | grep -q "1920x1080"; then
xrandr --output HDMI-2 --mode 1920x1080 --pos 1280x0 --rate 60
else
# use its preferred mode (starred) if 1080p isn't present
pref="$(echo "$xrandr_out" | awk '/^HDMI-2 connected/{flag=1;next}/^\S/{flag=0}flag && /\*/{print $1; exit}')"
[ -n "$pref" ] && xrandr --output HDMI-2 --mode "$pref" --pos 1280x0
fi
# 3) Prevent DPMS blanking (Volumio sometimes blanks aggressively)
xset -dpms
xset s off
xset s noblank
# 4) Map touchscreen input to HDMI-1
# Find the first touch-capable device (adjust if you know the exact name)
touch_id="$(xinput list | awk -F'=|\\[' '/Touch|touch|Goodix|ILITEK|eGalax|WaveShare|HID/ && /pointer/ {print $2; exit}')"
if [ -n "$touch_id" ]; then
xinput map-to-output "$touch_id" HDMI-1
log "Mapped touch device id $touch_id to HDMI-1"
else
log "No obvious touch device found in xinput list"
fi
log "Outputs configured."
Make it executable:
sudo chmod +x /usr/local/bin/fix-outputs.sh
- Create a systemd unit that runs after the X session which the Touch Display plugin launches:
sudo nano /etc/systemd/system/outputs-fix.service
[Unit]
Description=Fix display layout and touch mapping for Volumio kiosk
After=volumio-kiosk.service
Wants=volumio-kiosk.service
[Service]
Type=oneshot
User=volumio
Group=volumio
Environment=DISPLAY=:0
ExecStart=/usr/local/bin/fix-outputs.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
- Enable and start:
sudo systemctl daemon-reload
sudo systemctl enable outputs-fix.service
sudo systemctl start outputs-fix.service
-
Reboot
-
***REMEMBER TO CHANGE OUTPUT TO “HDMI 1” IN “PLAYBACK OPTIONS”
-
Scale the UI in “Touch Display”; you’ll need to reboot again for it to apply the correct resolution.
Outcome:
I can now get pixel-perfect display out to my 1280x800 touchscreen without it stretching to match the output expected by the soundbar or display any black bar if it tried to match the scaling of the sound bar. Again, this is unique to my usecase and I wondered if I tried my non-touch screen that scales to normal video resolution expected by the sound bar, if it’d have made life easier. Audio outputs thru the other HDMI port to the sound bar and I have no issue with any format being played. I have not looked into multi-channel audio out thru HDMI_1 yet but I also don’t have any source material for it anyway for now.
I know there’s more than one way to skin a cat, so to speak…if there’s a better way to make this work, I’m all ears!