mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
more name hint interace updates
- add long card name to device description - create empty PCM plugin to allow right hint description parsing - reorder devices in alsa.conf - make namehint more configurable (using default.namehint.showall switch) - add two levels basic and exteded for hints to default configuration files - do not show direct device aliases - removed all known memory leaks
This commit is contained in:
parent
aa7a0dd70b
commit
1300e70573
20 changed files with 456 additions and 322 deletions
|
|
@ -292,7 +292,7 @@ else
|
||||||
pcm_plugins=""
|
pcm_plugins=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PCM_PLUGIN_LIST="copy linear route mulaw alaw adpcm rate plug multi shm file null share meter hooks lfloat ladspa dmix dshare dsnoop asym iec958 softvol extplug ioplug"
|
PCM_PLUGIN_LIST="copy linear route mulaw alaw adpcm rate plug multi shm file null empty share meter hooks lfloat ladspa dmix dshare dsnoop asym iec958 softvol extplug ioplug"
|
||||||
|
|
||||||
build_pcm_plugin="no"
|
build_pcm_plugin="no"
|
||||||
for t in $PCM_PLUGIN_LIST; do
|
for t in $PCM_PLUGIN_LIST; do
|
||||||
|
|
@ -332,6 +332,7 @@ AM_CONDITIONAL(BUILD_PCM_PLUGIN_MULTI, test x$build_pcm_multi = xyes)
|
||||||
AM_CONDITIONAL(BUILD_PCM_PLUGIN_SHM, test x$build_pcm_shm = xyes)
|
AM_CONDITIONAL(BUILD_PCM_PLUGIN_SHM, test x$build_pcm_shm = xyes)
|
||||||
AM_CONDITIONAL(BUILD_PCM_PLUGIN_FILE, test x$build_pcm_file = xyes)
|
AM_CONDITIONAL(BUILD_PCM_PLUGIN_FILE, test x$build_pcm_file = xyes)
|
||||||
AM_CONDITIONAL(BUILD_PCM_PLUGIN_NULL, test x$build_pcm_null = xyes)
|
AM_CONDITIONAL(BUILD_PCM_PLUGIN_NULL, test x$build_pcm_null = xyes)
|
||||||
|
AM_CONDITIONAL(BUILD_PCM_PLUGIN_EMPTY, test x$build_pcm_empty = xyes)
|
||||||
AM_CONDITIONAL(BUILD_PCM_PLUGIN_SHARE, test x$build_pcm_share = xyes)
|
AM_CONDITIONAL(BUILD_PCM_PLUGIN_SHARE, test x$build_pcm_share = xyes)
|
||||||
AM_CONDITIONAL(BUILD_PCM_PLUGIN_METER, test x$build_pcm_meter = xyes)
|
AM_CONDITIONAL(BUILD_PCM_PLUGIN_METER, test x$build_pcm_meter = xyes)
|
||||||
AM_CONDITIONAL(BUILD_PCM_PLUGIN_HOOKS, test x$build_pcm_hooks = xyes)
|
AM_CONDITIONAL(BUILD_PCM_PLUGIN_HOOKS, test x$build_pcm_hooks = xyes)
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,17 @@ cards.@hooks [
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
#
|
||||||
# defaults
|
# defaults
|
||||||
|
#
|
||||||
|
|
||||||
|
# show all name hints also for definitions without hint {} section
|
||||||
|
defaults.namehint.showall off
|
||||||
|
# show just basic name hints
|
||||||
|
defaults.namehint.basic on
|
||||||
|
# show extended name hints
|
||||||
|
defaults.namehint.extended off
|
||||||
|
#
|
||||||
defaults.ctl.card 0
|
defaults.ctl.card 0
|
||||||
defaults.pcm.card 0
|
defaults.pcm.card 0
|
||||||
defaults.pcm.device 0
|
defaults.pcm.device 0
|
||||||
|
|
@ -101,6 +110,26 @@ defaults.timer.subdevice 0
|
||||||
# PCM interface
|
# PCM interface
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# redirect to load-on-demand extended pcm definitions
|
||||||
|
pcm.cards cards.pcm
|
||||||
|
|
||||||
|
pcm.default cards.pcm.default
|
||||||
|
pcm.front cards.pcm.front
|
||||||
|
pcm.rear cards.pcm.rear
|
||||||
|
pcm.center_lfe cards.pcm.center_lfe
|
||||||
|
pcm.side cards.pcm.side
|
||||||
|
pcm.surround40 cards.pcm.surround40
|
||||||
|
pcm.surround41 cards.pcm.surround41
|
||||||
|
pcm.surround50 cards.pcm.surround50
|
||||||
|
pcm.surround51 cards.pcm.surround51
|
||||||
|
pcm.surround71 cards.pcm.surround71
|
||||||
|
pcm.iec958 cards.pcm.iec958
|
||||||
|
pcm.spdif iec958
|
||||||
|
pcm.dmix cards.pcm.dmix
|
||||||
|
pcm.dsnoop cards.pcm.dsnoop
|
||||||
|
pcm.modem cards.pcm.modem
|
||||||
|
pcm.phoneline cards.pcm.phoneline
|
||||||
|
|
||||||
pcm.hw {
|
pcm.hw {
|
||||||
@args [ CARD DEV SUBDEV ]
|
@args [ CARD DEV SUBDEV ]
|
||||||
@args.CARD {
|
@args.CARD {
|
||||||
|
|
@ -141,7 +170,13 @@ pcm.hw {
|
||||||
card $CARD
|
card $CARD
|
||||||
device $DEV
|
device $DEV
|
||||||
subdevice $SUBDEV
|
subdevice $SUBDEV
|
||||||
hint 0
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.extended
|
||||||
|
}
|
||||||
|
description "Direct hardware device without any conversions"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pcm.plughw {
|
pcm.plughw {
|
||||||
|
|
@ -187,7 +222,13 @@ pcm.plughw {
|
||||||
device $DEV
|
device $DEV
|
||||||
subdevice $SUBDEV
|
subdevice $SUBDEV
|
||||||
}
|
}
|
||||||
hint 0
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.extended
|
||||||
|
}
|
||||||
|
description "Hardware device with all software conversions"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pcm.plug {
|
pcm.plug {
|
||||||
|
|
@ -246,35 +287,35 @@ pcm.file {
|
||||||
}
|
}
|
||||||
|
|
||||||
pcm.null {
|
pcm.null {
|
||||||
hint.description "Discard all samples (playback) or generate zero samples (capture)"
|
|
||||||
type null
|
type null
|
||||||
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.basic
|
||||||
|
}
|
||||||
|
description "Discard all samples (playback) or generate zero samples (capture)"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# redirect to load-on-demand extended pcm definitions
|
|
||||||
pcm.cards cards.pcm
|
|
||||||
# some links for easy use
|
|
||||||
pcm.front cards.pcm.front
|
|
||||||
pcm.rear cards.pcm.rear
|
|
||||||
pcm.center_lfe cards.pcm.center_lfe
|
|
||||||
pcm.side cards.pcm.side
|
|
||||||
pcm.surround40 cards.pcm.surround40
|
|
||||||
pcm.surround41 cards.pcm.surround41
|
|
||||||
pcm.surround50 cards.pcm.surround50
|
|
||||||
pcm.surround51 cards.pcm.surround51
|
|
||||||
pcm.surround71 cards.pcm.surround71
|
|
||||||
pcm.iec958 cards.pcm.iec958
|
|
||||||
pcm.spdif cards.pcm.iec958
|
|
||||||
pcm.modem cards.pcm.modem
|
|
||||||
pcm.phoneline cards.pcm.phoneline
|
|
||||||
|
|
||||||
pcm.default cards.pcm.default
|
|
||||||
pcm.dmix cards.pcm.dmix
|
|
||||||
pcm.dsnoop cards.pcm.dsnoop
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Control interface
|
# Control interface
|
||||||
#
|
#
|
||||||
|
|
||||||
|
ctl.default {
|
||||||
|
type hw
|
||||||
|
card {
|
||||||
|
@func getenv
|
||||||
|
vars [
|
||||||
|
ALSA_CTL_CARD
|
||||||
|
ALSA_CARD
|
||||||
|
]
|
||||||
|
default {
|
||||||
|
@func refer
|
||||||
|
name defaults.ctl.card
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ctl.hw {
|
ctl.hw {
|
||||||
@args[ CARD ]
|
@args[ CARD ]
|
||||||
@args.CARD {
|
@args.CARD {
|
||||||
|
|
@ -308,25 +349,35 @@ ctl.shm {
|
||||||
ctl $CTL
|
ctl $CTL
|
||||||
}
|
}
|
||||||
|
|
||||||
ctl.default {
|
#
|
||||||
|
# RawMidi interface
|
||||||
|
#
|
||||||
|
|
||||||
|
rawmidi.default {
|
||||||
type hw
|
type hw
|
||||||
card {
|
card {
|
||||||
@func getenv
|
@func getenv
|
||||||
vars [
|
vars [
|
||||||
ALSA_CTL_CARD
|
ALSA_RAWMIDI_CARD
|
||||||
ALSA_CARD
|
ALSA_CARD
|
||||||
]
|
]
|
||||||
default {
|
default {
|
||||||
@func refer
|
@func refer
|
||||||
name defaults.ctl.card
|
name defaults.rawmidi.card
|
||||||
|
}
|
||||||
|
}
|
||||||
|
device {
|
||||||
|
@func igetenv
|
||||||
|
vars [
|
||||||
|
ALSA_RAWMIDI_DEVICE
|
||||||
|
]
|
||||||
|
default {
|
||||||
|
@func refer
|
||||||
|
name defaults.rawmidi.device
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# RawMidi interface
|
|
||||||
#
|
|
||||||
|
|
||||||
rawmidi.hw {
|
rawmidi.hw {
|
||||||
@args [ CARD DEV SUBDEV ]
|
@args [ CARD DEV SUBDEV ]
|
||||||
@args.CARD {
|
@args.CARD {
|
||||||
|
|
@ -370,31 +421,6 @@ rawmidi.hw {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rawmidi.default {
|
|
||||||
type hw
|
|
||||||
card {
|
|
||||||
@func getenv
|
|
||||||
vars [
|
|
||||||
ALSA_RAWMIDI_CARD
|
|
||||||
ALSA_CARD
|
|
||||||
]
|
|
||||||
default {
|
|
||||||
@func refer
|
|
||||||
name defaults.rawmidi.card
|
|
||||||
}
|
|
||||||
}
|
|
||||||
device {
|
|
||||||
@func igetenv
|
|
||||||
vars [
|
|
||||||
ALSA_RAWMIDI_DEVICE
|
|
||||||
]
|
|
||||||
default {
|
|
||||||
@func refer
|
|
||||||
name defaults.rawmidi.device
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
rawmidi.virtual {
|
rawmidi.virtual {
|
||||||
@args [ MERGE ]
|
@args [ MERGE ]
|
||||||
@args.MERGE {
|
@args.MERGE {
|
||||||
|
|
@ -421,6 +447,31 @@ seq.hw {
|
||||||
# HwDep interface
|
# HwDep interface
|
||||||
#
|
#
|
||||||
|
|
||||||
|
hwdep.default {
|
||||||
|
type hw
|
||||||
|
card {
|
||||||
|
@func getenv
|
||||||
|
vars [
|
||||||
|
ALSA_HWDEP_CARD
|
||||||
|
ALSA_CARD
|
||||||
|
]
|
||||||
|
default {
|
||||||
|
@func refer
|
||||||
|
name defaults.hwdep.card
|
||||||
|
}
|
||||||
|
}
|
||||||
|
device {
|
||||||
|
@func igetenv
|
||||||
|
vars [
|
||||||
|
ALSA_HWDEP_DEVICE
|
||||||
|
]
|
||||||
|
default {
|
||||||
|
@func refer
|
||||||
|
name defaults.hwdep.device
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
hwdep.hw {
|
hwdep.hw {
|
||||||
@args [ CARD DEV ]
|
@args [ CARD DEV ]
|
||||||
@args.CARD {
|
@args.CARD {
|
||||||
|
|
@ -455,41 +506,41 @@ hwdep.hw {
|
||||||
device $DEV
|
device $DEV
|
||||||
}
|
}
|
||||||
|
|
||||||
hwdep.default {
|
|
||||||
type hw
|
|
||||||
card {
|
|
||||||
@func getenv
|
|
||||||
vars [
|
|
||||||
ALSA_HWDEP_CARD
|
|
||||||
ALSA_CARD
|
|
||||||
]
|
|
||||||
default {
|
|
||||||
@func refer
|
|
||||||
name defaults.hwdep.card
|
|
||||||
}
|
|
||||||
}
|
|
||||||
device {
|
|
||||||
@func igetenv
|
|
||||||
vars [
|
|
||||||
ALSA_HWDEP_DEVICE
|
|
||||||
]
|
|
||||||
default {
|
|
||||||
@func refer
|
|
||||||
name defaults.hwdep.device
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Timer interface
|
# Timer interface
|
||||||
#
|
#
|
||||||
|
|
||||||
|
timer_query.default {
|
||||||
|
type hw
|
||||||
|
}
|
||||||
|
|
||||||
timer_query.hw {
|
timer_query.hw {
|
||||||
type hw
|
type hw
|
||||||
}
|
}
|
||||||
|
|
||||||
timer_query.default {
|
timer.default {
|
||||||
type hw
|
type hw
|
||||||
|
class {
|
||||||
|
@func refer
|
||||||
|
name defaults.timer.class
|
||||||
|
}
|
||||||
|
sclass {
|
||||||
|
@func refer
|
||||||
|
name defaults.timer.sclass
|
||||||
|
}
|
||||||
|
card {
|
||||||
|
@func refer
|
||||||
|
name defaults.timer.card
|
||||||
|
}
|
||||||
|
device {
|
||||||
|
@func refer
|
||||||
|
name defaults.timer.device
|
||||||
|
}
|
||||||
|
subdevice {
|
||||||
|
@func refer
|
||||||
|
name defaults.timer.subdevice
|
||||||
|
}
|
||||||
|
hint.description "Default direct hardware timer device"
|
||||||
}
|
}
|
||||||
|
|
||||||
timer.hw {
|
timer.hw {
|
||||||
|
|
@ -536,28 +587,3 @@ timer.hw {
|
||||||
device $DEV
|
device $DEV
|
||||||
subdevice $SUBDEV
|
subdevice $SUBDEV
|
||||||
}
|
}
|
||||||
|
|
||||||
timer.default {
|
|
||||||
type hw
|
|
||||||
class {
|
|
||||||
@func refer
|
|
||||||
name defaults.timer.class
|
|
||||||
}
|
|
||||||
sclass {
|
|
||||||
@func refer
|
|
||||||
name defaults.timer.sclass
|
|
||||||
}
|
|
||||||
card {
|
|
||||||
@func refer
|
|
||||||
name defaults.timer.card
|
|
||||||
}
|
|
||||||
device {
|
|
||||||
@func refer
|
|
||||||
name defaults.timer.device
|
|
||||||
}
|
|
||||||
subdevice {
|
|
||||||
@func refer
|
|
||||||
name defaults.timer.subdevice
|
|
||||||
}
|
|
||||||
hint.description "Default direct hardware timer device"
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,7 @@ HDA-Intel.pcm.front.0 {
|
||||||
name "PCM Playback Volume"
|
name "PCM Playback Volume"
|
||||||
card $CARD
|
card $CARD
|
||||||
}
|
}
|
||||||
hint {
|
hint.device 0
|
||||||
description "Front speakers and multichannel output"
|
|
||||||
device 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# default with dmix+softvol & dsnoop
|
# default with dmix+softvol & dsnoop
|
||||||
|
|
@ -54,7 +51,6 @@ HDA-Intel.pcm.default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hint {
|
hint {
|
||||||
description "Default dmix+softvol + dsnoop device"
|
|
||||||
device_output {
|
device_output {
|
||||||
@func refer
|
@func refer
|
||||||
name defaults.pcm.dmix.device
|
name defaults.pcm.dmix.device
|
||||||
|
|
@ -140,10 +136,7 @@ HDA-Intel.pcm.iec958.0 {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hint {
|
hint.device 1
|
||||||
description "IEC958 (S/PDIF) Output"
|
|
||||||
device 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<confdir:pcm/modem.conf>
|
<confdir:pcm/modem.conf>
|
||||||
|
|
@ -156,5 +149,5 @@ HDA-Intel.pcm.modem.0 {
|
||||||
type hw
|
type hw
|
||||||
card $CARD
|
card $CARD
|
||||||
device 6
|
device 6
|
||||||
hint 0
|
hint.show off
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ pcm.!center_lfe {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
type empty
|
||||||
|
slave.pcm {
|
||||||
@func refer
|
@func refer
|
||||||
name {
|
name {
|
||||||
@func concat
|
@func concat
|
||||||
|
|
@ -45,3 +47,11 @@ pcm.!center_lfe {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.basic
|
||||||
|
}
|
||||||
|
description "Center and Subwoofer speakers"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ pcm.!dmix {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@args.DEV {
|
@args.DEV {
|
||||||
type string
|
type integer
|
||||||
default {
|
default {
|
||||||
@func refer
|
@func refer
|
||||||
name defaults.pcm.dmix.device
|
name defaults.pcm.dmix.device
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@args.SUBDEV {
|
@args.SUBDEV {
|
||||||
type string
|
type integer
|
||||||
default -1
|
default -1
|
||||||
}
|
}
|
||||||
@args.FORMAT {
|
@args.FORMAT {
|
||||||
|
|
@ -120,6 +120,10 @@ pcm.!dmix {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hint {
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.extended
|
||||||
|
}
|
||||||
description "Direct sample mixing device"
|
description "Direct sample mixing device"
|
||||||
device $DEV
|
device $DEV
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,14 @@ pcm.!dsnoop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@args.DEV {
|
@args.DEV {
|
||||||
type string
|
type integer
|
||||||
default {
|
default {
|
||||||
@func refer
|
@func refer
|
||||||
name defaults.pcm.dsnoop.device
|
name defaults.pcm.dsnoop.device
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@args.SUBDEV {
|
@args.SUBDEV {
|
||||||
type string
|
type integer
|
||||||
default -1
|
default -1
|
||||||
}
|
}
|
||||||
@args.FORMAT {
|
@args.FORMAT {
|
||||||
|
|
@ -120,6 +120,10 @@ pcm.!dsnoop {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hint {
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.extended
|
||||||
|
}
|
||||||
description "Direct sample snooping device"
|
description "Direct sample snooping device"
|
||||||
device $DEV
|
device $DEV
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ pcm.!front {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
type empty
|
||||||
|
slave.pcm {
|
||||||
@func refer
|
@func refer
|
||||||
name {
|
name {
|
||||||
@func concat
|
@func concat
|
||||||
|
|
@ -45,3 +47,11 @@ pcm.!front {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.basic
|
||||||
|
}
|
||||||
|
description "Front speakers"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,8 @@ pcm.!iec958 {
|
||||||
# fs=48000Hz, clock accuracy=1000ppm
|
# fs=48000Hz, clock accuracy=1000ppm
|
||||||
default 0x02
|
default 0x02
|
||||||
}
|
}
|
||||||
|
type empty
|
||||||
|
slave.pcm {
|
||||||
@func refer
|
@func refer
|
||||||
name {
|
name {
|
||||||
@func concat
|
@func concat
|
||||||
|
|
@ -70,3 +72,11 @@ pcm.!iec958 {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.basic
|
||||||
|
}
|
||||||
|
description "IEC958 (S/PDIF) Digital Audio Output"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ pcm.!phoneline {
|
||||||
".pcm.modem." $DEV ":CARD=" $CARD
|
".pcm.modem." $DEV ":CARD=" $CARD
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
hint 0
|
hint.show off
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
@ -102,5 +102,5 @@ pcm.!modem {
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
hint 0
|
hint.show off
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ pcm.!rear {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
type empty
|
||||||
|
slave.pcm {
|
||||||
@func refer
|
@func refer
|
||||||
name {
|
name {
|
||||||
@func concat
|
@func concat
|
||||||
|
|
@ -45,3 +47,11 @@ pcm.!rear {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.basic
|
||||||
|
}
|
||||||
|
description "Rear speakers"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ pcm.!side {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
type empty
|
||||||
|
slave.pcm {
|
||||||
@func refer
|
@func refer
|
||||||
name {
|
name {
|
||||||
@func concat
|
@func concat
|
||||||
|
|
@ -45,3 +47,11 @@ pcm.!side {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hint {
|
||||||
|
show {
|
||||||
|
@func refer
|
||||||
|
name defaults.namehint.basic
|
||||||
|
}
|
||||||
|
description "Side speakers"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ pcm.!surround40 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
type empty
|
||||||
|
slave.pcm {
|
||||||
@func refer
|
@func refer
|
||||||
name {
|
name {
|
||||||
@func concat
|
@func concat
|
||||||
|
|
@ -50,3 +52,5 @@ pcm.!surround40 {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hint.description "4.0 Surround output to Front and Rear speakers"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,4 +59,5 @@ pcm.!surround41 {
|
||||||
ttable.2.2 1
|
ttable.2.2 1
|
||||||
ttable.3.3 1
|
ttable.3.3 1
|
||||||
ttable.4.5 1
|
ttable.4.5 1
|
||||||
|
hint.description "4.1 Surround output to Front, Rear and Subwoofer speakers"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,4 +59,5 @@ pcm.!surround50 {
|
||||||
ttable.2.2 1
|
ttable.2.2 1
|
||||||
ttable.3.3 1
|
ttable.3.3 1
|
||||||
ttable.4.4 1
|
ttable.4.4 1
|
||||||
|
hint.description "5.0 Surround output to Front, Center and Rear speakers"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ pcm.!surround51 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
type empty
|
||||||
|
slave.pcm {
|
||||||
@func refer
|
@func refer
|
||||||
name {
|
name {
|
||||||
@func concat
|
@func concat
|
||||||
|
|
@ -52,3 +54,5 @@ pcm.!surround51 {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hint.description "5.1 Surround output to Front, Center, Rear and Subwoofer speakers"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,8 @@ pcm.!surround71 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
type empty
|
||||||
|
slave.pcm {
|
||||||
@func refer
|
@func refer
|
||||||
name {
|
name {
|
||||||
@func concat
|
@func concat
|
||||||
|
|
@ -54,3 +56,5 @@ pcm.!surround71 {
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
hint.description "7.1 Surround output to Front, Center, Side, Rear and Woofer speakers"
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -493,16 +493,6 @@ static int snd_func_iops(snd_config_t **dst,
|
||||||
}
|
}
|
||||||
if (i == idx) {
|
if (i == idx) {
|
||||||
idx++;
|
idx++;
|
||||||
#if 1
|
|
||||||
{
|
|
||||||
snd_output_t *out;
|
|
||||||
fprintf(stderr, "********* ID '%s':\n", id);
|
|
||||||
snd_output_stdio_attach(&out, stderr, 0);
|
|
||||||
snd_config_save(n, out);
|
|
||||||
snd_output_close(out);
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
err = snd_config_get_integer(n, &val);
|
err = snd_config_get_integer(n, &val);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
SNDERR("invalid integer for id %s", id);
|
SNDERR("invalid integer for id %s", id);
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ struct hint_list {
|
||||||
long device_input;
|
long device_input;
|
||||||
long device_output;
|
long device_output;
|
||||||
int stream;
|
int stream;
|
||||||
|
int show_all;
|
||||||
|
char *longname;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -80,10 +82,11 @@ static void zero_handler(const char *file ATTRIBUTE_UNUSED,
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *get_dev_name1(struct hint_list *list)
|
static int get_dev_name1(struct hint_list *list, char **res)
|
||||||
{
|
{
|
||||||
|
*res = NULL;
|
||||||
if (list->device < 0)
|
if (list->device < 0)
|
||||||
return NULL;
|
return 0;
|
||||||
switch (list->iface) {
|
switch (list->iface) {
|
||||||
case SND_CTL_ELEM_IFACE_HWDEP:
|
case SND_CTL_ELEM_IFACE_HWDEP:
|
||||||
{
|
{
|
||||||
|
|
@ -91,8 +94,9 @@ static char *get_dev_name1(struct hint_list *list)
|
||||||
snd_hwdep_info_alloca(&info);
|
snd_hwdep_info_alloca(&info);
|
||||||
snd_hwdep_info_set_device(info, list->device);
|
snd_hwdep_info_set_device(info, list->device);
|
||||||
if (snd_ctl_hwdep_info(list->ctl, info) < 0)
|
if (snd_ctl_hwdep_info(list->ctl, info) < 0)
|
||||||
return NULL;
|
return 0;
|
||||||
return strdup(snd_hwdep_info_get_name(info));
|
*res = strdup(snd_hwdep_info_get_name(info));
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
case SND_CTL_ELEM_IFACE_PCM:
|
case SND_CTL_ELEM_IFACE_PCM:
|
||||||
{
|
{
|
||||||
|
|
@ -101,15 +105,16 @@ static char *get_dev_name1(struct hint_list *list)
|
||||||
snd_pcm_info_set_device(info, list->device);
|
snd_pcm_info_set_device(info, list->device);
|
||||||
snd_pcm_info_set_stream(info, list->stream ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK);
|
snd_pcm_info_set_stream(info, list->stream ? SND_PCM_STREAM_CAPTURE : SND_PCM_STREAM_PLAYBACK);
|
||||||
if (snd_ctl_pcm_info(list->ctl, info) < 0)
|
if (snd_ctl_pcm_info(list->ctl, info) < 0)
|
||||||
return NULL;
|
return 0;
|
||||||
switch (snd_pcm_info_get_class(info)) {
|
switch (snd_pcm_info_get_class(info)) {
|
||||||
case SND_PCM_CLASS_MODEM:
|
case SND_PCM_CLASS_MODEM:
|
||||||
case SND_PCM_CLASS_DIGITIZER:
|
case SND_PCM_CLASS_DIGITIZER:
|
||||||
return NULL;
|
return -ENODEV;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return strdup(snd_pcm_info_get_name(info));
|
*res = strdup(snd_pcm_info_get_name(info));
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
case SND_CTL_ELEM_IFACE_RAWMIDI:
|
case SND_CTL_ELEM_IFACE_RAWMIDI:
|
||||||
{
|
{
|
||||||
|
|
@ -118,11 +123,12 @@ static char *get_dev_name1(struct hint_list *list)
|
||||||
snd_rawmidi_info_set_device(info, list->device);
|
snd_rawmidi_info_set_device(info, list->device);
|
||||||
snd_rawmidi_info_set_stream(info, list->stream ? SND_RAWMIDI_STREAM_INPUT : SND_RAWMIDI_STREAM_OUTPUT);
|
snd_rawmidi_info_set_stream(info, list->stream ? SND_RAWMIDI_STREAM_INPUT : SND_RAWMIDI_STREAM_OUTPUT);
|
||||||
if (snd_ctl_rawmidi_info(list->ctl, info) < 0)
|
if (snd_ctl_rawmidi_info(list->ctl, info) < 0)
|
||||||
return NULL;
|
return 0;
|
||||||
return strdup(snd_rawmidi_info_get_name(info));
|
*res = strdup(snd_rawmidi_info_get_name(info));
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -132,49 +138,60 @@ static char *get_dev_name(struct hint_list *list)
|
||||||
|
|
||||||
list->device = list->device_input >= 0 ? list->device_input : list->device;
|
list->device = list->device_input >= 0 ? list->device_input : list->device;
|
||||||
list->stream = 1;
|
list->stream = 1;
|
||||||
str1 = get_dev_name1(list);
|
if (get_dev_name1(list, &str1) < 0)
|
||||||
|
return NULL;
|
||||||
list->device = list->device_output >= 0 ? list->device_input : list->device;
|
list->device = list->device_output >= 0 ? list->device_input : list->device;
|
||||||
list->stream = 0;
|
list->stream = 0;
|
||||||
str2 = get_dev_name1(list);
|
if (get_dev_name1(list, &str2) < 0) {
|
||||||
|
if (str1)
|
||||||
|
free(str1);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (str1 != NULL || str2 != NULL) {
|
if (str1 != NULL || str2 != NULL) {
|
||||||
if (str1 != NULL && str2 != NULL) {
|
if (str1 != NULL && str2 != NULL) {
|
||||||
if (strcmp(str1, str2) == 0) {
|
if (strcmp(str1, str2) == 0) {
|
||||||
free(str1);
|
res = malloc(strlen(list->longname) + strlen(str2) + 3);
|
||||||
return str2;
|
|
||||||
}
|
|
||||||
res = realloc(str2, strlen(str2) + strlen(str1) + 4);
|
|
||||||
if (res != NULL) {
|
if (res != NULL) {
|
||||||
|
strcpy(res, list->longname);
|
||||||
|
strcat(res, ", ");
|
||||||
|
strcat(res, str2);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
res = malloc(strlen(list->longname) + strlen(str2) + strlen(str1) + 6);
|
||||||
|
if (res != NULL) {
|
||||||
|
strcpy(res, list->longname);
|
||||||
|
strcat(res, ", ");
|
||||||
|
strcat(res, str2);
|
||||||
strcat(res, " / ");
|
strcat(res, " / ");
|
||||||
strcat(res, str1);
|
strcat(res, str1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
free(str2);
|
||||||
free(str1);
|
free(str1);
|
||||||
return res;
|
return res;
|
||||||
} else {
|
|
||||||
free(str2);
|
|
||||||
free(str1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (str1 != NULL) {
|
if (str1 != NULL) {
|
||||||
res = realloc(str1, strlen(str1) + 16);
|
str2 = list->iface == SND_CTL_ELEM_IFACE_PCM ? "Capture" : "Input";
|
||||||
|
} else {
|
||||||
|
str1 = str2;
|
||||||
|
str2 = list->iface == SND_CTL_ELEM_IFACE_PCM ? "Playback" : "Output";
|
||||||
|
}
|
||||||
|
res = malloc(strlen(list->longname) + strlen(str1) + 19);
|
||||||
if (res == NULL) {
|
if (res == NULL) {
|
||||||
free(str1);
|
free(str1);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
strcpy(res, list->longname);
|
||||||
|
strcat(res, ", ");
|
||||||
|
strcat(res, str1);
|
||||||
strcat(res, " {");
|
strcat(res, " {");
|
||||||
strcat(res, list->iface == SND_CTL_ELEM_IFACE_PCM ? "Capture" : "Input");
|
strcat(res, list->iface == SND_CTL_ELEM_IFACE_PCM ? "Capture" : "Input");
|
||||||
strcat(res, "}");
|
strcat(res, "}");
|
||||||
|
free(str1);
|
||||||
return res;
|
return res;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
res = realloc(str2, strlen(str2) + 16);
|
return strdup(list->longname);
|
||||||
if (res == NULL) {
|
|
||||||
free(str2);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
strcat(res, " {");
|
|
||||||
strcat(res, list->iface == SND_CTL_ELEM_IFACE_PCM ? "Playback" : "Output");
|
|
||||||
strcat(res, "}");
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -188,11 +205,11 @@ static int try_config(struct hint_list *list,
|
||||||
const char *name)
|
const char *name)
|
||||||
{
|
{
|
||||||
snd_lib_error_handler_t eh;
|
snd_lib_error_handler_t eh;
|
||||||
snd_config_t *res, *cfg, *n;
|
snd_config_t *res = NULL, *cfg, *n;
|
||||||
snd_config_iterator_t i, next;
|
snd_config_iterator_t i, next;
|
||||||
char *buf, *buf1 = NULL, *buf2;
|
char *buf, *buf1 = NULL, *buf2;
|
||||||
const char *str;
|
const char *str;
|
||||||
int err;
|
int err = 0, level;
|
||||||
long dev = list->device;
|
long dev = list->device;
|
||||||
|
|
||||||
list->device_input = -1;
|
list->device_input = -1;
|
||||||
|
|
@ -200,6 +217,13 @@ static int try_config(struct hint_list *list,
|
||||||
buf = malloc(BUF_SIZE);
|
buf = malloc(BUF_SIZE);
|
||||||
if (buf == NULL)
|
if (buf == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
sprintf(buf, "%s.%s", base, name);
|
||||||
|
/* look for redirection */
|
||||||
|
if (snd_config_search(snd_config, buf, &cfg) >= 0 &&
|
||||||
|
snd_config_get_string(cfg, &str) >= 0 &&
|
||||||
|
((strncmp(base, str, strlen(base)) == 0 &&
|
||||||
|
str[strlen(base)] == '.') || strchr(str, '.') == NULL))
|
||||||
|
goto __skip_add;
|
||||||
if (list->card >= 0 && list->device >= 0)
|
if (list->card >= 0 && list->device >= 0)
|
||||||
sprintf(buf, "%s:CARD=%s,DEV=%i", name, snd_ctl_card_info_get_id(list->info), list->device);
|
sprintf(buf, "%s:CARD=%s,DEV=%i", name, snd_ctl_card_info_get_id(list->info), list->device);
|
||||||
else if (list->card >= 0)
|
else if (list->card >= 0)
|
||||||
|
|
@ -211,17 +235,40 @@ static int try_config(struct hint_list *list,
|
||||||
err = snd_config_search_definition(snd_config, base, buf, &res);
|
err = snd_config_search_definition(snd_config, base, buf, &res);
|
||||||
snd_lib_error_set_handler(eh);
|
snd_lib_error_set_handler(eh);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
return err;
|
goto __skip_add;
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
if (snd_config_get_type(res) != SND_CONFIG_TYPE_COMPOUND)
|
if (snd_config_get_type(res) != SND_CONFIG_TYPE_COMPOUND)
|
||||||
goto __cleanup;
|
goto __cleanup;
|
||||||
if (snd_config_search(res, "type", NULL) < 0)
|
if (snd_config_search(res, "type", NULL) < 0)
|
||||||
goto __cleanup;
|
goto __cleanup;
|
||||||
|
|
||||||
|
#if 0 /* for debug purposes */
|
||||||
|
{
|
||||||
|
snd_output_t *out;
|
||||||
|
fprintf(stderr, "********* PCM '%s':\n", buf);
|
||||||
|
snd_output_stdio_attach(&out, stderr, 0);
|
||||||
|
snd_config_save(res, out);
|
||||||
|
snd_output_close(out);
|
||||||
|
fprintf(stderr, "\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
cfg = res;
|
cfg = res;
|
||||||
|
level = 0;
|
||||||
__hint:
|
__hint:
|
||||||
|
level++;
|
||||||
if (snd_config_search(cfg, "hint", &cfg) >= 0) {
|
if (snd_config_search(cfg, "hint", &cfg) >= 0) {
|
||||||
if (snd_config_get_type(cfg) == SND_CONFIG_TYPE_COMPOUND) {
|
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
|
||||||
if (snd_config_search(cfg, "description", &n) >= 0 &&
|
SNDERR("hint (%s) must be a compound", buf);
|
||||||
|
err = -EINVAL;
|
||||||
|
goto __cleanup;
|
||||||
|
}
|
||||||
|
if (level == 1 &&
|
||||||
|
snd_config_search(cfg, "show", &n) >= 0 &&
|
||||||
|
snd_config_get_bool(n) <= 0)
|
||||||
|
goto __skip_add;
|
||||||
|
if (buf1 == NULL &&
|
||||||
|
snd_config_search(cfg, "description", &n) >= 0 &&
|
||||||
snd_config_get_string(n, &str) >= 0) {
|
snd_config_get_string(n, &str) >= 0) {
|
||||||
buf1 = strdup(str);
|
buf1 = strdup(str);
|
||||||
if (buf1 == NULL) {
|
if (buf1 == NULL) {
|
||||||
|
|
@ -231,42 +278,33 @@ static int try_config(struct hint_list *list,
|
||||||
}
|
}
|
||||||
if (snd_config_search(cfg, "device", &n) >= 0) {
|
if (snd_config_search(cfg, "device", &n) >= 0) {
|
||||||
if (snd_config_get_integer(n, &dev) < 0) {
|
if (snd_config_get_integer(n, &dev) < 0) {
|
||||||
|
SNDERR("(%s) device must be an integer", buf);
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto __cleanup;
|
goto __cleanup;
|
||||||
}
|
}
|
||||||
|
list->device_input = -1;
|
||||||
|
list->device_output = -1;
|
||||||
}
|
}
|
||||||
if (snd_config_search(cfg, "device_input", &n) >= 0) {
|
if (snd_config_search(cfg, "device_input", &n) >= 0) {
|
||||||
if (snd_config_get_integer(n, &list->device_input) < 0) {
|
if (snd_config_get_integer(n, &list->device_input) < 0) {
|
||||||
|
SNDERR("(%s) device_input must be an integer", buf);
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto __cleanup;
|
goto __cleanup;
|
||||||
}
|
}
|
||||||
|
list->device_output = -1;
|
||||||
}
|
}
|
||||||
if (snd_config_search(cfg, "device_output", &n) >= 0) {
|
if (snd_config_search(cfg, "device_output", &n) >= 0) {
|
||||||
if (snd_config_get_integer(n, &list->device_output) < 0) {
|
if (snd_config_get_integer(n, &list->device_output) < 0) {
|
||||||
|
SNDERR("(%s) device_output must be an integer", buf);
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
goto __cleanup;
|
goto __cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (snd_config_get_bool(cfg) == 0) {
|
} else if (level == 1 && !list->show_all)
|
||||||
err = -EXDEV;
|
goto __skip_add;
|
||||||
goto __cleanup;
|
|
||||||
}
|
|
||||||
goto __hint_ok;
|
|
||||||
}
|
|
||||||
if (snd_config_search(cfg, "slave", &cfg) >= 0 &&
|
if (snd_config_search(cfg, "slave", &cfg) >= 0 &&
|
||||||
snd_config_search(cfg, base, &cfg) >= 0)
|
snd_config_search(cfg, base, &cfg) >= 0)
|
||||||
goto __hint;
|
goto __hint;
|
||||||
__hint_ok:
|
|
||||||
#if 0 /* for debug purposes */
|
|
||||||
{
|
|
||||||
snd_output_t *out;
|
|
||||||
fprintf(stderr, "********* PCM '%s':\n", buf);
|
|
||||||
snd_output_stdio_attach(&out, stderr, 0);
|
|
||||||
snd_config_save(res, out);
|
|
||||||
snd_output_close(out);
|
|
||||||
printf("\n");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
snd_config_delete(res);
|
snd_config_delete(res);
|
||||||
res = NULL;
|
res = NULL;
|
||||||
if (strchr(buf, ':') != NULL)
|
if (strchr(buf, ':') != NULL)
|
||||||
|
|
@ -291,16 +329,14 @@ static int try_config(struct hint_list *list,
|
||||||
__ok:
|
__ok:
|
||||||
err = 0;
|
err = 0;
|
||||||
__cleanup:
|
__cleanup:
|
||||||
if (res)
|
|
||||||
snd_config_delete(res);
|
|
||||||
if (err >= 0) {
|
if (err >= 0) {
|
||||||
list->device = dev;
|
list->device = dev;
|
||||||
str = get_dev_name(list);
|
str = list->card >= 0 ? get_dev_name(list) : NULL;
|
||||||
if (str != NULL) {
|
if (str != NULL) {
|
||||||
buf2 = realloc((char *)str, (buf1 == NULL ? 0 : strlen(buf1)) + 2 + strlen(str) + 1);
|
buf2 = realloc((char *)str, (buf1 == NULL ? 0 : strlen(buf1)) + 1 + strlen(str) + 1);
|
||||||
if (buf2 != NULL) {
|
if (buf2 != NULL) {
|
||||||
if (buf1 != NULL) {
|
if (buf1 != NULL) {
|
||||||
strcat(buf2, ": ");
|
strcat(buf2, "\n");
|
||||||
strcat(buf2, buf1);
|
strcat(buf2, buf1);
|
||||||
free(buf1);
|
free(buf1);
|
||||||
}
|
}
|
||||||
|
|
@ -313,6 +349,8 @@ static int try_config(struct hint_list *list,
|
||||||
err = hint_list_add(list, buf, buf1);
|
err = hint_list_add(list, buf, buf1);
|
||||||
}
|
}
|
||||||
__skip_add:
|
__skip_add:
|
||||||
|
if (res)
|
||||||
|
snd_config_delete(res);
|
||||||
if (buf1)
|
if (buf1)
|
||||||
free(buf1);
|
free(buf1);
|
||||||
free(buf);
|
free(buf);
|
||||||
|
|
@ -348,8 +386,6 @@ static int add_card(struct hint_list *list, int card, snd_ctl_elem_iface_t iface
|
||||||
list->info = info;
|
list->info = info;
|
||||||
if (iface > SND_CTL_ELEM_IFACE_LAST)
|
if (iface > SND_CTL_ELEM_IFACE_LAST)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
if (snd_card_get_name(card, (char **)&str) < 0)
|
|
||||||
return 0;
|
|
||||||
base = snd_ctl_iface_conf_name(iface);
|
base = snd_ctl_iface_conf_name(iface);
|
||||||
err = snd_config_search(snd_config, base, &conf);
|
err = snd_config_search(snd_config, base, &conf);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
|
@ -399,7 +435,6 @@ static int add_card(struct hint_list *list, int card, snd_ctl_elem_iface_t iface
|
||||||
}
|
}
|
||||||
err = 0;
|
err = 0;
|
||||||
__error:
|
__error:
|
||||||
if (err < 0)
|
|
||||||
snd_ctl_close(list->ctl);
|
snd_ctl_close(list->ctl);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
@ -421,6 +456,9 @@ static int add_card(struct hint_list *list, int card, snd_ctl_elem_iface_t iface
|
||||||
* myplug "plug:front:Do all conversions for front speakers"<br>
|
* myplug "plug:front:Do all conversions for front speakers"<br>
|
||||||
* }
|
* }
|
||||||
* </code>
|
* </code>
|
||||||
|
*
|
||||||
|
* Special variables: defaults.namehint.showall specifies if all device
|
||||||
|
* definitions are accepted (boolean type).
|
||||||
*/
|
*/
|
||||||
int snd_device_name_hint(int card, snd_ctl_elem_iface_t iface, char ***hints)
|
int snd_device_name_hint(int card, snd_ctl_elem_iface_t iface, char ***hints)
|
||||||
{
|
{
|
||||||
|
|
@ -439,6 +477,10 @@ int snd_device_name_hint(int card, snd_ctl_elem_iface_t iface, char ***hints)
|
||||||
list.list = NULL;
|
list.list = NULL;
|
||||||
list.count = list.allocated = 0;
|
list.count = list.allocated = 0;
|
||||||
list.iface = iface;
|
list.iface = iface;
|
||||||
|
list.show_all = 0;
|
||||||
|
list.longname = NULL;
|
||||||
|
if (snd_config_search(snd_config, "defaults.namehint.showall", &conf) >= 0)
|
||||||
|
list.show_all = snd_config_get_bool(conf) > 0;
|
||||||
if (card >= 0) {
|
if (card >= 0) {
|
||||||
err = add_card(&list, card, iface);
|
err = add_card(&list, card, iface);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -446,6 +488,9 @@ int snd_device_name_hint(int card, snd_ctl_elem_iface_t iface, char ***hints)
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto __error;
|
goto __error;
|
||||||
while (card >= 0) {
|
while (card >= 0) {
|
||||||
|
err = snd_card_get_longname(card, &list.longname);
|
||||||
|
if (err < 0)
|
||||||
|
goto __error;
|
||||||
err = add_card(&list, card, iface);
|
err = add_card(&list, card, iface);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto __error;
|
goto __error;
|
||||||
|
|
@ -470,12 +515,16 @@ int snd_device_name_hint(int card, snd_ctl_elem_iface_t iface, char ***hints)
|
||||||
__error:
|
__error:
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
snd_device_name_free_hint(list.list);
|
snd_device_name_free_hint(list.list);
|
||||||
|
if (list.longname)
|
||||||
|
free(list.longname);
|
||||||
return err;
|
return err;
|
||||||
} else {
|
} else {
|
||||||
err = hint_list_add(&list, NULL, NULL);
|
err = hint_list_add(&list, NULL, NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto __error;
|
goto __error;
|
||||||
*hints = list.list;
|
*hints = list.list;
|
||||||
|
if (list.longname)
|
||||||
|
free(list.longname);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,9 @@ endif
|
||||||
if BUILD_PCM_PLUGIN_NULL
|
if BUILD_PCM_PLUGIN_NULL
|
||||||
libpcm_la_SOURCES += pcm_null.c
|
libpcm_la_SOURCES += pcm_null.c
|
||||||
endif
|
endif
|
||||||
|
if BUILD_PCM_PLUGIN_EMPTY
|
||||||
|
libpcm_la_SOURCES += pcm_empty.c
|
||||||
|
endif
|
||||||
if BUILD_PCM_PLUGIN_SHARE
|
if BUILD_PCM_PLUGIN_SHARE
|
||||||
libpcm_la_SOURCES += pcm_share.c
|
libpcm_la_SOURCES += pcm_share.c
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -1983,7 +1983,7 @@ snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler)
|
||||||
|
|
||||||
static char *build_in_pcms[] = {
|
static char *build_in_pcms[] = {
|
||||||
"adpcm", "alaw", "copy", "dmix", "file", "hooks", "hw", "ladspa", "lfloat",
|
"adpcm", "alaw", "copy", "dmix", "file", "hooks", "hw", "ladspa", "lfloat",
|
||||||
"linear", "meter", "mulaw", "multi", "null", "plug", "rate", "route", "share",
|
"linear", "meter", "mulaw", "multi", "null", "empty", "plug", "rate", "route", "share",
|
||||||
"shm", "dsnoop", "dshare", "asym", "iec958", "softvol", NULL
|
"shm", "dsnoop", "dshare", "asym", "iec958", "softvol", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue