alsa: move recipes into dynamic-layers for NXP
Signed-off-by: Mike Engel <Mike.Engel@digi.com>
This commit is contained in:
parent
fab1962b15
commit
798510ad64
|
|
@ -1,221 +0,0 @@
|
|||
From cc06048dcd722049f92ab17958760bd798fb4781 Mon Sep 17 00:00:00 2001
|
||||
From: Shengjiu Wang <b02247@freescale.com>
|
||||
Date: Thu, 5 Jun 2014 17:37:47 +0800
|
||||
Subject: [PATCH] add conf for multichannel support in imx
|
||||
|
||||
Upstream Status: Inappropriate [platform specific]
|
||||
|
||||
Signed-off-by: Shengjiu Wang <b02247@freescale.com>
|
||||
---
|
||||
src/conf/cards/CS42888.conf | 94 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
src/conf/cards/IMX-HDMI.conf | 67 +++++++++++++++++++++++++++++++
|
||||
src/conf/cards/Makefile.am | 4 +-
|
||||
src/conf/cards/aliases.conf | 2 +
|
||||
4 files changed, 166 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/conf/cards/CS42888.conf
|
||||
create mode 100644 src/conf/cards/IMX-HDMI.conf
|
||||
|
||||
diff --git a/src/conf/cards/CS42888.conf b/src/conf/cards/CS42888.conf
|
||||
new file mode 100644
|
||||
index 0000000..671a284
|
||||
--- /dev/null
|
||||
+++ b/src/conf/cards/CS42888.conf
|
||||
@@ -0,0 +1,94 @@
|
||||
+#
|
||||
+# Configuration for the CS42888 chip
|
||||
+#
|
||||
+
|
||||
+# default with dmix & dsnoop
|
||||
+CS42888.pcm.default {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type asym
|
||||
+ playback.pcm {
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ @func concat
|
||||
+ strings [ "dmix:" $CARD ",FORMAT=S32_LE" ]
|
||||
+ }
|
||||
+ }
|
||||
+ capture.pcm {
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ @func concat
|
||||
+ strings [ "dsnoop:" $CARD ",FORMAT=S32_LE" ]
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+<confdir:pcm/surround40.conf>
|
||||
+
|
||||
+CS42888.pcm.surround40.0 {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ }
|
||||
+ slave.channels 4
|
||||
+ ttable.0.0 1
|
||||
+ ttable.1.2 1
|
||||
+ ttable.2.1 1
|
||||
+ ttable.3.3 1
|
||||
+}
|
||||
+
|
||||
+
|
||||
+<confdir:pcm/surround41.conf>
|
||||
+<confdir:pcm/surround50.conf>
|
||||
+<confdir:pcm/surround51.conf>
|
||||
+
|
||||
+CS42888.pcm.surround51.0 {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ }
|
||||
+ slave.channels 6
|
||||
+ ttable.0.0 1
|
||||
+ ttable.1.3 1
|
||||
+ ttable.2.1 1
|
||||
+ ttable.3.4 1
|
||||
+ ttable.4.2 1
|
||||
+ ttable.5.5 1
|
||||
+}
|
||||
+
|
||||
+<confdir:pcm/surround71.conf>
|
||||
+
|
||||
+CS42888.pcm.surround71.0 {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ }
|
||||
+ slave.channels 8
|
||||
+ ttable.0.0 1
|
||||
+ ttable.1.4 1
|
||||
+ ttable.2.1 1
|
||||
+ ttable.3.5 1
|
||||
+ ttable.4.2 1
|
||||
+ ttable.5.6 1
|
||||
+ ttable.6.3 1
|
||||
+ ttable.7.7 1
|
||||
+}
|
||||
+
|
||||
+# vim: ft=alsaconf
|
||||
diff --git a/src/conf/cards/IMX-HDMI.conf b/src/conf/cards/IMX-HDMI.conf
|
||||
new file mode 100644
|
||||
index 0000000..a51509e
|
||||
--- /dev/null
|
||||
+++ b/src/conf/cards/IMX-HDMI.conf
|
||||
@@ -0,0 +1,67 @@
|
||||
+#
|
||||
+# Configuration for the CS42888 chip
|
||||
+#
|
||||
+
|
||||
+# default with dmix & dsnoop
|
||||
+IMX-HDMI.pcm.default {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type asym
|
||||
+ playback.pcm {
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ @func concat
|
||||
+ strings [ "dmix:" $CARD ",FORMAT=S32_LE" ]
|
||||
+ }
|
||||
+ }
|
||||
+ capture.pcm {
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ @func concat
|
||||
+ strings [ "dsnoop:" $CARD ",FORMAT=S32_LE" ]
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+<confdir:pcm/surround40.conf>
|
||||
+
|
||||
+IMX-HDMI.pcm.surround40.0 {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ channels 4
|
||||
+}
|
||||
+
|
||||
+
|
||||
+<confdir:pcm/surround41.conf>
|
||||
+<confdir:pcm/surround50.conf>
|
||||
+<confdir:pcm/surround51.conf>
|
||||
+
|
||||
+IMX-HDMI.pcm.surround51.0 {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ channels 6
|
||||
+}
|
||||
+
|
||||
+<confdir:pcm/surround71.conf>
|
||||
+
|
||||
+IMX-HDMI.pcm.surround71.0 {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ channels 8
|
||||
+}
|
||||
+
|
||||
+# vim: ft=alsaconf
|
||||
diff --git a/src/conf/cards/Makefile.am b/src/conf/cards/Makefile.am
|
||||
index 00999f0..fbf0697 100644
|
||||
--- a/src/conf/cards/Makefile.am
|
||||
+++ b/src/conf/cards/Makefile.am
|
||||
@@ -58,7 +58,9 @@ cfg_files = aliases.conf \
|
||||
VIA8237.conf \
|
||||
VX222.conf \
|
||||
VXPocket.conf \
|
||||
- VXPocket440.conf
|
||||
+ VXPocket440.conf \
|
||||
+ CS42888.conf \
|
||||
+ IMX-HDMI.conf
|
||||
|
||||
if BUILD_ALISP
|
||||
cfg_files += aliases.alisp
|
||||
diff --git a/src/conf/cards/aliases.conf b/src/conf/cards/aliases.conf
|
||||
index 18a920f..2c422ee 100644
|
||||
--- a/src/conf/cards/aliases.conf
|
||||
+++ b/src/conf/cards/aliases.conf
|
||||
@@ -57,6 +57,8 @@ CMI8786 cards.CMI8788
|
||||
CMI8787 cards.CMI8788
|
||||
pistachio cards.pistachio-card
|
||||
VC4-HDMI cards.vc4-hdmi
|
||||
+imx-cs42888 cards.CS42888
|
||||
+imx-hdmi-soc cards.IMX-HDMI
|
||||
|
||||
<confdir:pcm/default.conf>
|
||||
<confdir:pcm/dmix.conf>
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
From 67be50a9d95c8659d4821d0cd8c228e4f57b2c32 Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Kysela <perex@perex.cz>
|
||||
Date: Wed, 30 Dec 2020 09:31:10 +0100
|
||||
Subject: [PATCH 1/2] pcm: plugin status - fix the return value (regression)
|
||||
|
||||
The snd_pcm_plugin_avail_update() error code in snd_pcm_plugin_status()
|
||||
should not be reported to the caller. The state errors can be determined
|
||||
using the state member in the status structure.
|
||||
|
||||
Fixes: 4f90392f07e ("pcm: fix the snd_pcm_plugin_status() avail and delay fields")
|
||||
BugLink: https://github.com/alsa-project/alsa-lib/issues/107
|
||||
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
||||
---
|
||||
src/pcm/pcm_plugin.c | 8 +++-----
|
||||
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
|
||||
index 5739cfc2eb07..76a524fa801d 100644
|
||||
--- a/src/pcm/pcm_plugin.c
|
||||
+++ b/src/pcm/pcm_plugin.c
|
||||
@@ -541,19 +541,17 @@ static snd_pcm_sframes_t snd_pcm_plugin_avail_update(snd_pcm_t *pcm)
|
||||
static int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
||||
{
|
||||
snd_pcm_plugin_t *plugin = pcm->private_data;
|
||||
- snd_pcm_sframes_t err, avail;
|
||||
+ snd_pcm_sframes_t err;
|
||||
|
||||
/* sync with the latest hw and appl ptrs */
|
||||
- avail = snd_pcm_plugin_avail_update(pcm);
|
||||
- if (avail < 0)
|
||||
- return avail;
|
||||
+ snd_pcm_plugin_avail_update(pcm);
|
||||
|
||||
err = snd_pcm_status(plugin->gen.slave, status);
|
||||
if (err < 0)
|
||||
return err;
|
||||
status->appl_ptr = *pcm->appl.ptr;
|
||||
status->hw_ptr = *pcm->hw.ptr;
|
||||
- status->avail = avail;
|
||||
+ status->avail = snd_pcm_mmap_avail(pcm);
|
||||
status->delay = snd_pcm_mmap_delay(pcm);
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
2.27.0
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
From eeea1c8c352e54908f464e8dfd7a06b0f7ce0e6e Mon Sep 17 00:00:00 2001
|
||||
From: Jaroslav Kysela <perex@perex.cz>
|
||||
Date: Sun, 3 Jan 2021 16:16:10 +0100
|
||||
Subject: [PATCH 2/2] pcm: plugin status - revert the recent changes
|
||||
|
||||
It's no reason to sync the avail/delay fields using the mirrored
|
||||
buffer pointers. The slave information must be valid.
|
||||
|
||||
The original report probably tries to fix something for
|
||||
the specific plugin. Revert all changes.
|
||||
|
||||
Fixes: afe6ff3b33e ("pcm: plugin status - fix the return value (regression)")
|
||||
Fixes: 4f90392f07e ("pcm: fix the snd_pcm_plugin_status() avail and delay fields")
|
||||
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
|
||||
---
|
||||
src/pcm/pcm_plugin.c | 2 --
|
||||
1 file changed, 2 deletions(-)
|
||||
|
||||
diff --git a/src/pcm/pcm_plugin.c b/src/pcm/pcm_plugin.c
|
||||
index 76a524fa801d..ea60eb98986e 100644
|
||||
--- a/src/pcm/pcm_plugin.c
|
||||
+++ b/src/pcm/pcm_plugin.c
|
||||
@@ -551,8 +551,6 @@ static int snd_pcm_plugin_status(snd_pcm_t *pcm, snd_pcm_status_t * status)
|
||||
return err;
|
||||
status->appl_ptr = *pcm->appl.ptr;
|
||||
status->hw_ptr = *pcm->hw.ptr;
|
||||
- status->avail = snd_pcm_mmap_avail(pcm);
|
||||
- status->delay = snd_pcm_mmap_delay(pcm);
|
||||
return 0;
|
||||
}
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
From 1641ce8c724018365d7fa598f9a70c6492e7c271 Mon Sep 17 00:00:00 2001
|
||||
From: Shengjiu Wang <shengjiu.wang@nxp.com>
|
||||
Date: Wed, 31 Jan 2018 15:06:53 +0800
|
||||
Subject: [PATCH] add ak4458 conf for multichannel support
|
||||
|
||||
one limitation is that ALSA and pulseaudio only support
|
||||
maximum 8 channels, but ak4458 may support 16 channels
|
||||
|
||||
Upstream-Status: Inappropriate [i.MX specific]
|
||||
|
||||
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
|
||||
---
|
||||
src/conf/cards/AK4458.conf | 74 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
src/conf/cards/Makefile.am | 3 +-
|
||||
src/conf/cards/aliases.conf | 1 +
|
||||
3 files changed, 77 insertions(+), 1 deletion(-)
|
||||
create mode 100644 src/conf/cards/AK4458.conf
|
||||
|
||||
Index: alsa-lib-1.1.6/src/conf/cards/AK4458.conf
|
||||
===================================================================
|
||||
--- /dev/null
|
||||
+++ alsa-lib-1.1.6/src/conf/cards/AK4458.conf
|
||||
@@ -0,0 +1,74 @@
|
||||
+#
|
||||
+# Configuration for the AK4458 chip
|
||||
+#
|
||||
+
|
||||
+# default with dmix & dsnoop
|
||||
+AK4458.pcm.default {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type asym
|
||||
+ playback.pcm {
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ @func concat
|
||||
+ strings [ "dmix:" $CARD ",FORMAT=S32_LE" ]
|
||||
+ }
|
||||
+ }
|
||||
+ capture.pcm {
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ @func concat
|
||||
+ strings [ "dsnoop:" $CARD ",FORMAT=S32_LE" ]
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+<confdir:pcm/surround40.conf>
|
||||
+
|
||||
+AK4458.pcm.surround40.0 {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ }
|
||||
+ slave.channels 4
|
||||
+}
|
||||
+
|
||||
+
|
||||
+<confdir:pcm/surround41.conf>
|
||||
+<confdir:pcm/surround50.conf>
|
||||
+<confdir:pcm/surround51.conf>
|
||||
+
|
||||
+AK4458.pcm.surround51.0 {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ }
|
||||
+ slave.channels 6
|
||||
+}
|
||||
+
|
||||
+<confdir:pcm/surround71.conf>
|
||||
+
|
||||
+AK4458.pcm.surround71.0 {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD {
|
||||
+ type string
|
||||
+ }
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ }
|
||||
+ slave.channels 8
|
||||
+}
|
||||
Index: alsa-lib-1.1.6/src/conf/cards/Makefile.am
|
||||
===================================================================
|
||||
--- alsa-lib-1.1.6.orig/src/conf/cards/Makefile.am
|
||||
+++ alsa-lib-1.1.6/src/conf/cards/Makefile.am
|
||||
@@ -60,7 +60,8 @@ cfg_files = aliases.conf \
|
||||
VXPocket.conf \
|
||||
VXPocket440.conf \
|
||||
CS42888.conf \
|
||||
- IMX-HDMI.conf
|
||||
+ IMX-HDMI.conf \
|
||||
+ AK4458.conf
|
||||
|
||||
if BUILD_ALISP
|
||||
cfg_files += aliases.alisp
|
||||
Index: alsa-lib-1.1.6/src/conf/cards/aliases.conf
|
||||
===================================================================
|
||||
--- alsa-lib-1.1.6.orig/src/conf/cards/aliases.conf
|
||||
+++ alsa-lib-1.1.6/src/conf/cards/aliases.conf
|
||||
@@ -59,6 +59,7 @@ pistachio cards.pistachio-card
|
||||
VC4-HDMI cards.vc4-hdmi
|
||||
imx-cs42888 cards.CS42888
|
||||
imx-hdmi-soc cards.IMX-HDMI
|
||||
+ak4458-audio cards.AK4458
|
||||
|
||||
<confdir:pcm/default.conf>
|
||||
<confdir:pcm/dmix.conf>
|
||||
|
|
@ -1,89 +0,0 @@
|
|||
From d2be0f650f9fec265f0f0b4ba646a157f2a4cb7c Mon Sep 17 00:00:00 2001
|
||||
From: Viorel Suman <viorel.suman@nxp.com>
|
||||
Date: Mon, 9 Mar 2020 14:25:46 +0200
|
||||
Subject: [PATCH] add conf for iMX XCVR sound card
|
||||
|
||||
Upstream Status: Pending
|
||||
|
||||
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
|
||||
---
|
||||
src/conf/cards/IMX-XCVR.conf | 39 +++++++++++++++++++++++++++++++++++++++
|
||||
src/conf/cards/Makefile.am | 3 ++-
|
||||
src/conf/cards/aliases.conf | 1 +
|
||||
3 files changed, 42 insertions(+), 1 deletion(-)
|
||||
create mode 100755 src/conf/cards/IMX-XCVR.conf
|
||||
|
||||
diff --git a/src/conf/cards/IMX-XCVR.conf b/src/conf/cards/IMX-XCVR.conf
|
||||
new file mode 100755
|
||||
index 0000000..009000c
|
||||
--- /dev/null
|
||||
+++ b/src/conf/cards/IMX-XCVR.conf
|
||||
@@ -0,0 +1,39 @@
|
||||
+#
|
||||
+# Configuration for the IMX-XCVR sound card using software IEC958
|
||||
+# subframe conversion
|
||||
+#
|
||||
+IMX-XCVR.pcm.default {
|
||||
+ @args [ CARD ]
|
||||
+ @args.CARD { type string }
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ @func concat
|
||||
+ strings [ "iec958:" $CARD ]
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+<confdir:pcm/iec958.conf>
|
||||
+
|
||||
+IMX-XCVR.pcm.iec958.0 {
|
||||
+ @args [ CARD AES0 AES1 AES2 AES3 ]
|
||||
+ @args.CARD { type string }
|
||||
+ @args.AES0 { type integer }
|
||||
+ @args.AES1 { type integer }
|
||||
+ @args.AES2 { type integer }
|
||||
+ @args.AES3 { type integer }
|
||||
+ type iec958
|
||||
+ slave {
|
||||
+ format IEC958_SUBFRAME_LE
|
||||
+ pcm {
|
||||
+ type plug
|
||||
+ slave.pcm {
|
||||
+ type hw
|
||||
+ card $CARD
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ status [ $AES0 $AES1 $AES2 $AES3 ]
|
||||
+ preamble.z 0x0
|
||||
+ preamble.x 0x1
|
||||
+ preamble.y 0x3
|
||||
+}
|
||||
diff --git a/src/conf/cards/Makefile.am b/src/conf/cards/Makefile.am
|
||||
index 34fa5a3..70b9bab 100644
|
||||
--- a/src/conf/cards/Makefile.am
|
||||
+++ b/src/conf/cards/Makefile.am
|
||||
@@ -61,7 +61,8 @@ cfg_files = aliases.conf \
|
||||
VXPocket440.conf \
|
||||
CS42888.conf \
|
||||
IMX-HDMI.conf \
|
||||
- AK4458.conf
|
||||
+ AK4458.conf \
|
||||
+ IMX-XCVR.conf
|
||||
|
||||
if BUILD_ALISP
|
||||
cfg_files += aliases.alisp
|
||||
diff --git a/src/conf/cards/aliases.conf b/src/conf/cards/aliases.conf
|
||||
index 5d92ac7..c195848 100644
|
||||
--- a/src/conf/cards/aliases.conf
|
||||
+++ b/src/conf/cards/aliases.conf
|
||||
@@ -60,6 +60,7 @@ VC4-HDMI cards.vc4-hdmi
|
||||
imx-cs42888 cards.CS42888
|
||||
imx-hdmi-soc cards.IMX-HDMI
|
||||
ak4458-audio cards.AK4458
|
||||
+imx-audio-xcvr cards.IMX-XCVR
|
||||
|
||||
<confdir:pcm/default.conf>
|
||||
<confdir:pcm/dmix.conf>
|
||||
--
|
||||
2.7.4
|
||||
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
|
||||
|
||||
IMX_PATCH += " \
|
||||
file://0001-pcm-plugin-status-fix-the-return-value-regression.patch \
|
||||
file://0002-pcm-plugin-status-revert-the-recent-changes.patch \
|
||||
"
|
||||
|
||||
PACKAGE_ARCH_imx = "${TUNE_PKGARCH}"
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
# Copyright (C) 2017 Digi International.
|
||||
|
||||
SUMMARY = "DEY sound card detection app"
|
||||
SECTION = "multimedia"
|
||||
LICENSE = "MPL-2.0"
|
||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"
|
||||
|
||||
DEPENDS = "alsa-lib"
|
||||
|
||||
SRC_URI = "file://card-detect.c"
|
||||
|
||||
S = "${WORKDIR}"
|
||||
|
||||
inherit pkgconfig
|
||||
|
||||
export CFLAGS += "`pkg-config --cflags alsa`"
|
||||
export LDLIBS += "`pkg-config --libs alsa`"
|
||||
|
||||
do_configure[noexec] = "1"
|
||||
|
||||
do_compile() {
|
||||
oe_runmake card-detect
|
||||
}
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${bindir}
|
||||
install -m 0755 card-detect ${D}${bindir}
|
||||
}
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2017 Digi International Inc.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int len, ret = EXIT_SUCCESS;
|
||||
snd_pcm_t *handle;
|
||||
char *device;
|
||||
|
||||
if (argc < 2) {
|
||||
printf("Usage: %s [CARD NUMBER]\n", argv[0]);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
len = strlen("hw:") + strlen(argv[1]) + 1;
|
||||
device = calloc(1, len);
|
||||
snprintf(device, len, "hw:%s", argv[1]);
|
||||
|
||||
/* Open the PCM-device in playback mode */
|
||||
if (snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK, 0) < 0) {
|
||||
printf("Could't open PCM '%s'\n", device);
|
||||
ret = EXIT_FAILURE;
|
||||
} else {
|
||||
printf("Device %s opened successfully\n", device);
|
||||
snd_pcm_close(handle);
|
||||
}
|
||||
|
||||
free(device);
|
||||
return ret;
|
||||
}
|
||||
Loading…
Reference in New Issue