If you need to switch between the laptop's screen and the HDMI ouput, remember you can update your new /userdata/changeVideoOuput.sh script file.
Like this :
#!/bin/bash
clear
echo "Select video output :"
echo "L= Laptop's screen (default)"
echo "H= HDMI"
read -t 10 -n 1 answer
if [ $? -ne 0 ]; then
answer="l"
fi
clear
if [[ $answer == "l" ]]; then
cp /userdata/system/.xinitrc_lvds /userdata/system/.xinitrc
cp /userdata/system/.asoundrc_lvds /userdata/system/.asoundrc
echo "Restart Batocera to get display on your laptop's screen"
elif [[ $answer == "h" ]]; then
cp /userdata/system/.xinitrc_hdmi /userdata/system/.xinitrc
cp /userdata/system/.asoundrc_hdmi /userdata/system/.asoundrc
echo "Restart Batocera to get display on your HDMI video device"
else
echo "Invalid choice"
fi
sleep 5
exit
As sample, here is my /userdata/system/.asoundrc_hdmi file :
pcm.dmixer {
type dmix
ipc_key 2048
slave {
pcm "hw:1,3" #card1, device3 (HDA ATI HDMI, HDMI 0)
period_size 512
buffer_size 4096
rate 48000
format S16_LE
}
bindings {
0 0
1 1
}
}
pcm.!default {
type plug
slave.pcm dmixer
}
pcm:iec958 {
type plug
slave.pcm dmixer
}
And my /userdata/system/.asoundrc_lvds file :
pcm.dmixer {
type dmix
ipc_key 2048
slave {
pcm "hw:0,0" #card0, device0 (HDA Intel, ALC269 Analog)
period_size 512
buffer_size 4096
rate 48000
format S16_LE
}
bindings {
0 0
1 1
}
}
pcm.!default {
type plug
slave.pcm dmixer
}
pcm:iec958 {
type plug
slave.pcm dmixer
}
Hope my experience will help you or give you some tricks to solve your issue too.