All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2][meta-intel] n450: set default mixer settings on boot [YOCTO #798]
@ 2011-03-12  8:46 Darren Hart
  2011-03-12  8:46 ` [PATCH 1/2] n450: revamp audio mixer init script Darren Hart
  2011-03-12  8:46 ` [PATCH 2/2] n450: replace n450-audio with a proper " Darren Hart
  0 siblings, 2 replies; 3+ messages in thread
From: Darren Hart @ 2011-03-12  8:46 UTC (permalink / raw)
  To: poky; +Cc: Darren Hart

From: Darren Hart <dvhart@linux.intel.com>

The following patches address Bug 798. The existing n450-audiofix wasn't
getting installed, and it wasn't adjusting the mixer. These patches repair
the recipe and update it to resemble a proper init script.

This is a stop-gap solution as a more general solution, such as alsa-state,
would be preferred long term.

Darren Hart (2):
  n450: revamp audio mixer init script
  n450: replace n450-audio with a proper init script

 meta-n450/conf/machine/n450.conf                   |    2 +
 meta-n450/recipes-bsp/audiofix/audiofix.bb         |   17 --------
 meta-n450/recipes-bsp/audiofix/files/n450_audiofix |   13 ------
 meta-n450/recipes-bsp/n450-audio/n450-audio.bb     |   30 ++++++++++++++
 .../recipes-bsp/n450-audio/n450-audio/n450-audio   |   42 ++++++++++++++++++++
 5 files changed, 74 insertions(+), 30 deletions(-)
 delete mode 100644 meta-n450/recipes-bsp/audiofix/audiofix.bb
 delete mode 100644 meta-n450/recipes-bsp/audiofix/files/n450_audiofix
 create mode 100644 meta-n450/recipes-bsp/n450-audio/n450-audio.bb
 create mode 100644 meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] n450: revamp audio mixer init script
  2011-03-12  8:46 [PATCH 0/2][meta-intel] n450: set default mixer settings on boot [YOCTO #798] Darren Hart
@ 2011-03-12  8:46 ` Darren Hart
  2011-03-12  8:46 ` [PATCH 2/2] n450: replace n450-audio with a proper " Darren Hart
  1 sibling, 0 replies; 3+ messages in thread
From: Darren Hart @ 2011-03-12  8:46 UTC (permalink / raw)
  To: poky; +Cc: Darren Hart

From: Darren Hart <dvhart@linux.intel.com>

Fixes [YOCTO #798]

n450-audiofix suffered from various problems, including not getting installed.
This patch adds it via MACHINE_EXTRA_RRECOMMENDS and cleans up the various
bugs in the implementation. The structure has been renamed and the comments
updated for consistency. This should be considered a stop-gap measure, as
something along the lines of oe's alsa-state is a far better solution.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta-n450/conf/machine/n450.conf                   |    2 +
 meta-n450/recipes-bsp/audiofix/audiofix.bb         |   17 --------------
 meta-n450/recipes-bsp/audiofix/files/n450_audiofix |   13 -----------
 meta-n450/recipes-bsp/n450-audio/n450-audio.bb     |   23 ++++++++++++++++++++
 .../recipes-bsp/n450-audio/n450-audio/n450-audio   |   15 +++++++++++++
 5 files changed, 40 insertions(+), 30 deletions(-)
 delete mode 100644 meta-n450/recipes-bsp/audiofix/audiofix.bb
 delete mode 100644 meta-n450/recipes-bsp/audiofix/files/n450_audiofix
 create mode 100644 meta-n450/recipes-bsp/n450-audio/n450-audio.bb
 create mode 100644 meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio

diff --git a/meta-n450/conf/machine/n450.conf b/meta-n450/conf/machine/n450.conf
index eda91d9..c06cb6c 100644
--- a/meta-n450/conf/machine/n450.conf
+++ b/meta-n450/conf/machine/n450.conf
@@ -11,3 +11,5 @@ APPEND += "console=ttyS0,115200 console=tty0"
 
 PREFERRED_PROVIDER_virtual/kernel ?= "linux-yocto-stable"
 
+# Ensure the bsp packages are installed
+MACHINE_EXTRA_RRECOMMENDS += " n450-audio "
diff --git a/meta-n450/recipes-bsp/audiofix/audiofix.bb b/meta-n450/recipes-bsp/audiofix/audiofix.bb
deleted file mode 100644
index 3b1d272..0000000
--- a/meta-n450/recipes-bsp/audiofix/audiofix.bb
+++ /dev/null
@@ -1,17 +0,0 @@
-SUMMARY = "Provide a basic init script to enable audio"
-DESCRIPTION = "This package provides an init script which enables the audio on startup via the amixer command.  It address a problem with the development board that has the audio muted on power on."
-SECTION = "base"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
-
-PR = "r2"
-RDEPENDS = "alsa-utils-amixer"
-
-SRC_URI = "file://n450_audiofix"
-
-do_install () {
-	install -d ${D}${sysconfdir}/init.d
-	install -d ${D}${sysconfdir}/rc5.d
-	install -m 0755 ${WORKDIR}/n450_audiofix ${D}${sysconfdir}/init.d
-	ln -sf ${D}${sysconfdir}/init.d/n450_audiofix ${D}/${sysconfdir}/rc5.d/S91n450_audiofix
-}
diff --git a/meta-n450/recipes-bsp/audiofix/files/n450_audiofix b/meta-n450/recipes-bsp/audiofix/files/n450_audiofix
deleted file mode 100644
index 9ec0448..0000000
--- a/meta-n450/recipes-bsp/audiofix/files/n450_audiofix
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/sh
-
-AMIXER=`which amixer`
-
-if [ ! -e $AMIXER ]; then
-	if [ -e /usr/bin/amixer ]; then
-		AMIXER=/usr/bin/amixer
-	else
-		echo "No amixer, so unable to reset Front channel ON"
-	fi
-fi
-
-
diff --git a/meta-n450/recipes-bsp/n450-audio/n450-audio.bb b/meta-n450/recipes-bsp/n450-audio/n450-audio.bb
new file mode 100644
index 0000000..20e3a9a
--- /dev/null
+++ b/meta-n450/recipes-bsp/n450-audio/n450-audio.bb
@@ -0,0 +1,23 @@
+SUMMARY = "Provide a basic init script to enable audio"
+DESCRIPTION = "Set the volume and unmute the Front mixer setting during boot."
+SECTION = "base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+
+PR = "r3"
+
+inherit update-rc.d
+
+RDEPENDS = "alsa-utils-amixer"
+
+SRC_URI = "file://n450-audio"
+
+INITSCRIPT_NAME = "n450-audio"
+INITSCRIPT_PARAMS = "defaults 90"
+
+do_install() {
+        install -d ${D}${sysconfdir} \
+                   ${D}${sysconfdir}/init.d
+	install -m 0755 ${WORKDIR}/n450-audio ${D}${sysconfdir}/init.d
+}
+
diff --git a/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio b/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio
new file mode 100644
index 0000000..ad1b0bd
--- /dev/null
+++ b/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+AMIXER=`which amixer`
+
+if [ ! -e "$AMIXER" ]; then
+	if [ -e /usr/bin/amixer ]; then
+		AMIXER=/usr/bin/amixer
+	else
+		echo "amixer not found, unable to set default audio settings."
+		exit 1
+	fi
+fi
+
+# Enable the "Front" simple controls (black phones jack)
+$AMIXER sset Front 30 on
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] n450: replace n450-audio with a proper init script
  2011-03-12  8:46 [PATCH 0/2][meta-intel] n450: set default mixer settings on boot [YOCTO #798] Darren Hart
  2011-03-12  8:46 ` [PATCH 1/2] n450: revamp audio mixer init script Darren Hart
@ 2011-03-12  8:46 ` Darren Hart
  1 sibling, 0 replies; 3+ messages in thread
From: Darren Hart @ 2011-03-12  8:46 UTC (permalink / raw)
  To: poky; +Cc: Darren Hart

From: Darren Hart <dvhart@linux.intel.com>

Rewrite n450-audio based on /etc/init.d/skeleton. Update the install to
rewrite all the system paths.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta-n450/recipes-bsp/n450-audio/n450-audio.bb     |   13 ++++-
 .../recipes-bsp/n450-audio/n450-audio/n450-audio   |   49 +++++++++++++++----
 2 files changed, 48 insertions(+), 14 deletions(-)

diff --git a/meta-n450/recipes-bsp/n450-audio/n450-audio.bb b/meta-n450/recipes-bsp/n450-audio/n450-audio.bb
index 20e3a9a..90ec267 100644
--- a/meta-n450/recipes-bsp/n450-audio/n450-audio.bb
+++ b/meta-n450/recipes-bsp/n450-audio/n450-audio.bb
@@ -4,7 +4,7 @@ SECTION = "base"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${POKYBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
 
-PR = "r3"
+PR = "r4"
 
 inherit update-rc.d
 
@@ -16,8 +16,15 @@ INITSCRIPT_NAME = "n450-audio"
 INITSCRIPT_PARAMS = "defaults 90"
 
 do_install() {
-        install -d ${D}${sysconfdir} \
-                   ${D}${sysconfdir}/init.d
+	install -d ${D}${sysconfdir} \
+	           ${D}${sysconfdir}/init.d
 	install -m 0755 ${WORKDIR}/n450-audio ${D}${sysconfdir}/init.d
+        cat ${WORKDIR}/${INITSCRIPT_NAME} | \
+            sed -e 's,/etc,${sysconfdir},g' \
+                -e 's,/usr/sbin,${sbindir},g' \
+                -e 's,/var,${localstatedir},g' \
+                -e 's,/usr/bin,${bindir},g' \
+                -e 's,/usr,${prefix},g' > ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
+        chmod 755 ${D}${sysconfdir}/init.d/${INITSCRIPT_NAME}
 }
 
diff --git a/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio b/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio
index ad1b0bd..c5a0044 100644
--- a/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio
+++ b/meta-n450/recipes-bsp/n450-audio/n450-audio/n450-audio
@@ -1,15 +1,42 @@
 #!/bin/sh
+### BEGIN INIT INFO
+# Provides:          n450 mixer setup
+# Required-Start:    $syslog
+# Required-Stop:     $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Initialize the n450 audio mixer
+# Description:       Unmute FRONT and set volume to ~70%.
+### END INIT INFO
 
+# Author: Darren Hart <dvhart@linux.intel.com>
+# Based on /etc/init.d/skeleton
+
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+DESC="Audio mixer settings"
+NAME=n450-audio
 AMIXER=`which amixer`
+SCRIPTNAME=/etc/init.d/$NAME
+
+# Exit if amixer is not installed
+[ -x "$AMIXER" ] || exit 0
+
+do_start() {
+	# Enable the "Front" simple controls (black phones jack)
+	$AMIXER sset Front 30 on > /dev/null
+}
+
+case "$1" in
+start)
+	echo "$NAME: setting default mixer settings."
+	do_start
+	;;
+stop)
+	;;
+*)
+	echo "Usage: $SCRIPTNAME {start|stop}" >&2
+	exit 3
+	;;
+esac
 
-if [ ! -e "$AMIXER" ]; then
-	if [ -e /usr/bin/amixer ]; then
-		AMIXER=/usr/bin/amixer
-	else
-		echo "amixer not found, unable to set default audio settings."
-		exit 1
-	fi
-fi
-
-# Enable the "Front" simple controls (black phones jack)
-$AMIXER sset Front 30 on
+exit 0
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-03-12  8:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-12  8:46 [PATCH 0/2][meta-intel] n450: set default mixer settings on boot [YOCTO #798] Darren Hart
2011-03-12  8:46 ` [PATCH 1/2] n450: revamp audio mixer init script Darren Hart
2011-03-12  8:46 ` [PATCH 2/2] n450: replace n450-audio with a proper " Darren Hart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.