summaryrefslogtreecommitdiffstats
path: root/meta-yocto/recipes-bsp/beagleboard-audio
diff options
context:
space:
mode:
authorDarren Hart <dvhart@linux.intel.com>2011-06-17 14:42:32 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-06-22 17:02:55 +0100
commit489fe5d4406410e7eae35ca7ee7be911fac938ec (patch)
tree86e11cc1bc9ecd69f6e28c9204d21ec049a39c8a /meta-yocto/recipes-bsp/beagleboard-audio
parent0363835985a264458fb9432aab1f6345bb2bd424 (diff)
downloadpoky-489fe5d4406410e7eae35ca7ee7be911fac938ec.tar.gz
beagleboard: add basic audio mixer defaults
We need a generic alsa based mechanism that we can use a bbappend to save default mixer controls per bsp. Until that is ready, this ensures the Audio Out on the Beagleboard is enabled out of the box. Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'meta-yocto/recipes-bsp/beagleboard-audio')
-rw-r--r--meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb30
-rw-r--r--meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio44
2 files changed, 74 insertions, 0 deletions
diff --git a/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb
new file mode 100644
index 0000000000..b0c2cd708b
--- /dev/null
+++ b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio.bb
@@ -0,0 +1,30 @@
1SUMMARY = "Provide a basic init script to enable audio"
2DESCRIPTION = "Set the volume and unmute the Front mixer setting during boot."
3SECTION = "base"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
6
7PR = "r4"
8
9inherit update-rc.d
10
11RDEPENDS = "alsa-utils-amixer"
12
13SRC_URI = "file://beagleboard-audio"
14
15INITSCRIPT_NAME = "beagleboard-audio"
16INITSCRIPT_PARAMS = "defaults 90"
17
18do_install() {
19 install -d ${D}${sysconfdir} \
20 ${D}${sysconfdir}/init.d
21 install -m 0755 ${WORKDIR}/beagleboard-audio ${D}${sysconfdir}/init.d
22 cat ${WORKDIR}/${INITSCRIPT_NAME} | \
23 sed -e 's,/etc,${sysconfdir},g' \
24 -e 's,/usr/sbin,${sbindir},g' \
25 -e 's,/var,${localstatedir},g' \
26 -e 's,/usr/bin,${bindir},g' \
27 -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
28 chmod 755 ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
29}
30
diff --git a/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio
new file mode 100644
index 0000000000..ed2bd50f8b
--- /dev/null
+++ b/meta-yocto/recipes-bsp/beagleboard-audio/beagleboard-audio/beagleboard-audio
@@ -0,0 +1,44 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: beagleboard mixer setup
4# Required-Start: $syslog
5# Required-Stop: $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Initialize the beagleboard audio mixer
9# Description: Unmute FRONT and set volume to ~70%.
10### END INIT INFO
11
12# Author: Darren Hart <dvhart@linux.intel.com>
13# Based on /etc/init.d/skeleton
14
15PATH=/sbin:/usr/sbin:/bin:/usr/bin
16DESC="Audio mixer settings"
17NAME=beagleboard-audio
18AMIXER=`which amixer`
19SCRIPTNAME=/etc/init.d/$NAME
20
21# Exit if amixer is not installed
22[ -x "$AMIXER" ] || exit 0
23
24do_start() {
25 # Enable the Headset (Audio Out)
26 $AMIXER sset "Headset" 2 > /dev/null
27 $AMIXER sset "HeadsetL Mixer AudioL1" on > /dev/null
28 $AMIXER sset "HeadsetR Mixer AudioR1" on > /dev/null
29}
30
31case "$1" in
32start)
33 echo "$NAME: setting default mixer settings."
34 do_start
35 ;;
36stop)
37 ;;
38*)
39 echo "Usage: $SCRIPTNAME {start|stop}" >&2
40 exit 3
41 ;;
42esac
43
44exit 0