mirror of
git://git.yoctoproject.org/meta-intel
synced 2026-01-01 13:58:05 +00:00
meta-nuc: init script for configuring HDMI audio
Provide an init script to check at boot time which HDMI port is connected and configure the default ALSA audio out to that port. Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
This commit is contained in:
parent
a2d990eaad
commit
773a71c667
|
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides:
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
# Short-Description: Configure ALSA audio output to the connected HDMI port
|
||||
### END INIT INFO
|
||||
|
||||
#
|
||||
# If both HDMI ports are connected then use HDMI0 for default ALSA audio out..
|
||||
|
||||
ALSA_CONF_FILE="/etc/asound.conf"
|
||||
|
||||
HDMI0_STATUS_FILE="/sys/class/drm/card0-HDMI-A-1/status"
|
||||
HDMI1_STATUS_FILE="/sys/class/drm/card0-HDMI-A-2/status"
|
||||
|
||||
HDMI0_ALSA_CONF="hw:0,3"
|
||||
HDMI1_ALSA_CONF="hw:0,7"
|
||||
|
||||
if [ -f "${HDMI0_STATUS_FILE}" ] && [ "`cat ${HDMI0_STATUS_FILE}`" == "connected" ]
|
||||
then
|
||||
sed -i "s/pcm *\"hw:[0-9]*,[0-9]*\"/pcm \"${HDMI0_ALSA_CONF}\"/" ${ALSA_CONF_FILE}
|
||||
elif [ -f "${HDMI1_STATUS_FILE}" ] && [ "`cat ${HDMI1_STATUS_FILE}`" == "connected" ]
|
||||
then
|
||||
sed -i "s/pcm \"hw:[0-9]*,[0-9]*\"/pcm \"${HDMI1_ALSA_CONF}\"/" ${ALSA_CONF_FILE}
|
||||
fi
|
||||
10
meta-nuc/recipes-core/initscripts/initscripts_1.0.bbappend
Normal file
10
meta-nuc/recipes-core/initscripts/initscripts_1.0.bbappend
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
SRC_URI += "file://hdmi_port_audio.sh"
|
||||
|
||||
PR .= ".1"
|
||||
|
||||
do_install_append() {
|
||||
install -m 0755 ${WORKDIR}/hdmi_port_audio.sh ${D}${sysconfdir}/init.d
|
||||
ln -sf ../init.d/hdmi_port_audio.sh ${D}${sysconfdir}/rcS.d/S66hdmi_port_audio.sh
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user