From: Jaroslav Kysela Date: Thu, 12 Oct 2006 14:27:23 +0000 (+0200) Subject: pcm config files cleanups and name hint extension X-Git-Tag: v1.0.14rc1~18 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=d7916981bfe14f0aa52cbcccf0cba38d06d01c36;p=alsa-lib.git pcm config files cleanups and name hint extension - remove device 0/subdevice 0 from configuration files (it's default) - name_hint - fixed parsing slaves - obtain device numbers directly from 'type hw' configurations to avoid poluting of configurations scripts with hint.device lines --- diff --git a/src/conf/cards/AACI.conf b/src/conf/cards/AACI.conf index 2ebec2a7..748586a0 100644 --- a/src/conf/cards/AACI.conf +++ b/src/conf/cards/AACI.conf @@ -11,7 +11,6 @@ AACI.pcm.front.0 { } type hw card $CARD - device 0 } diff --git a/src/conf/cards/ATIIXP-MODEM.conf b/src/conf/cards/ATIIXP-MODEM.conf index 0fff603b..6e52af05 100644 --- a/src/conf/cards/ATIIXP-MODEM.conf +++ b/src/conf/cards/ATIIXP-MODEM.conf @@ -13,11 +13,10 @@ ATIIXP-MODEM.pcm.modem.0 { slave.pcm { type hw card $CARD - device 0 } slave.channels 2 slave.format S16_LE ttable.0.1 1 ttable.1.0 0 - hint 0 + hint.show off } diff --git a/src/conf/cards/ATIIXP-SPDMA.conf b/src/conf/cards/ATIIXP-SPDMA.conf index e8899e92..5c80815d 100644 --- a/src/conf/cards/ATIIXP-SPDMA.conf +++ b/src/conf/cards/ATIIXP-SPDMA.conf @@ -11,7 +11,6 @@ ATIIXP-SPDMA.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop @@ -48,7 +47,6 @@ ATIIXP-SPDMA.pcm.surround40.0 { slave.pcm { type hw card $CARD - device 0 channels 4 } hooks.0 { @@ -92,7 +90,6 @@ ATIIXP-SPDMA.pcm.surround51.0 { slave.pcm { type hw card $CARD - device 0 channels 6 } hooks.0 { diff --git a/src/conf/cards/ATIIXP.conf b/src/conf/cards/ATIIXP.conf index 911eb5de..38d80234 100644 --- a/src/conf/cards/ATIIXP.conf +++ b/src/conf/cards/ATIIXP.conf @@ -11,7 +11,6 @@ ATIIXP.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop @@ -48,7 +47,6 @@ ATIIXP.pcm.surround40.0 { slave.pcm { type hw card $CARD - device 0 channels 4 } hooks.0 { @@ -92,7 +90,6 @@ ATIIXP.pcm.surround51.0 { slave.pcm { type hw card $CARD - device 0 channels 6 } hooks.0 { @@ -166,21 +163,18 @@ ATIIXP.pcm.iec958.0 { hook_args [ { name "IEC958 Playback AC97-SPSA" - device 0 lock true preserve true value 3 } { name "IEC958 Playback Default" - device 0 lock true preserve true value [ $AES0 $AES1 $AES2 $AES3 ] } { name "IEC958 Playback Switch" - device 0 lock true preserve true value true diff --git a/src/conf/cards/AU8810.conf b/src/conf/cards/AU8810.conf index b5b8386d..24d46c34 100644 --- a/src/conf/cards/AU8810.conf +++ b/src/conf/cards/AU8810.conf @@ -11,7 +11,6 @@ AU8810.pcm.front.0 { } type hw card $CARD - device 0 } diff --git a/src/conf/cards/AU8820.conf b/src/conf/cards/AU8820.conf index 1aa8c854..07890254 100644 --- a/src/conf/cards/AU8820.conf +++ b/src/conf/cards/AU8820.conf @@ -11,5 +11,4 @@ AU8820.pcm.front.0 { } type hw card $CARD - device 0 } diff --git a/src/conf/cards/AU8830.conf b/src/conf/cards/AU8830.conf index 976f870c..39e66d50 100644 --- a/src/conf/cards/AU8830.conf +++ b/src/conf/cards/AU8830.conf @@ -11,7 +11,6 @@ AU8830.pcm.front.0 { } type hw card $CARD - device 0 } diff --git a/src/conf/cards/Audigy.conf b/src/conf/cards/Audigy.conf index e43610ae..ea1e53da 100644 --- a/src/conf/cards/Audigy.conf +++ b/src/conf/cards/Audigy.conf @@ -13,14 +13,12 @@ Audigy.pcm.front.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -37,7 +35,6 @@ Audigy.pcm.front.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true @@ -55,7 +52,6 @@ Audigy.pcm.front.0 { ] } - } @@ -69,14 +65,12 @@ Audigy.pcm.rear.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -106,14 +100,12 @@ Audigy.pcm.center_lfe.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -130,7 +122,6 @@ Audigy.pcm.center_lfe.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true @@ -257,7 +248,6 @@ Audigy.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { @@ -266,7 +256,6 @@ Audigy.pcm.iec958.0 { { interface PCM name "IEC958 Playback Default" - device 0 lock true preserve true optional true @@ -288,7 +277,6 @@ Audigy.pcm.iec958.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -305,7 +293,6 @@ Audigy.pcm.iec958.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true diff --git a/src/conf/cards/Audigy2.conf b/src/conf/cards/Audigy2.conf index d8bfa0fc..0290f6f8 100644 --- a/src/conf/cards/Audigy2.conf +++ b/src/conf/cards/Audigy2.conf @@ -13,14 +13,12 @@ Audigy2.pcm.front.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -37,7 +35,6 @@ Audigy2.pcm.front.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true @@ -55,7 +52,6 @@ Audigy2.pcm.front.0 { ] } - } @@ -69,14 +65,12 @@ Audigy2.pcm.rear.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -106,14 +100,12 @@ Audigy2.pcm.center_lfe.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -130,7 +122,6 @@ Audigy2.pcm.center_lfe.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true @@ -160,14 +151,12 @@ Audigy2.pcm.side.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -184,7 +173,6 @@ Audigy2.pcm.side.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true @@ -369,7 +357,6 @@ Audigy2.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { @@ -378,7 +365,6 @@ Audigy2.pcm.iec958.0 { { interface PCM name "IEC958 Playback Default" - device 0 preserve true optional true value [ $AES0 $AES1 $AES2 $AES3 ] @@ -398,7 +384,6 @@ Audigy2.pcm.iec958.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -415,7 +400,6 @@ Audigy2.pcm.iec958.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true diff --git a/src/conf/cards/Aureon51.conf b/src/conf/cards/Aureon51.conf index 996beda5..1b8ee855 100644 --- a/src/conf/cards/Aureon51.conf +++ b/src/conf/cards/Aureon51.conf @@ -59,7 +59,6 @@ Aureon51.pcm.center_lfe.0 { type hw card $CARD device 2 - subdevice 0 } diff --git a/src/conf/cards/Aureon71.conf b/src/conf/cards/Aureon71.conf index 38d47202..8a88cce4 100644 --- a/src/conf/cards/Aureon71.conf +++ b/src/conf/cards/Aureon71.conf @@ -46,7 +46,6 @@ Aureon71.pcm.rear.0 { type hw card $CARD device 2 - subdevice 0 } diff --git a/src/conf/cards/CA0106.conf b/src/conf/cards/CA0106.conf index 46adb319..9d21770f 100644 --- a/src/conf/cards/CA0106.conf +++ b/src/conf/cards/CA0106.conf @@ -34,7 +34,6 @@ CA0106.pcm.front.0 { } type hw card $CARD - device 0 } @@ -241,7 +240,6 @@ CA0106.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/CMI8338-SWIEC.conf b/src/conf/cards/CMI8338-SWIEC.conf index 98eda2c9..af3a579f 100644 --- a/src/conf/cards/CMI8338-SWIEC.conf +++ b/src/conf/cards/CMI8338-SWIEC.conf @@ -12,7 +12,6 @@ CMI8338-SWIEC.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop diff --git a/src/conf/cards/CMI8338.conf b/src/conf/cards/CMI8338.conf index de087d6c..144fc9b0 100644 --- a/src/conf/cards/CMI8338.conf +++ b/src/conf/cards/CMI8338.conf @@ -11,7 +11,6 @@ CMI8338.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop diff --git a/src/conf/cards/CMI8738-MC6.conf b/src/conf/cards/CMI8738-MC6.conf index f38488ec..171c7728 100644 --- a/src/conf/cards/CMI8738-MC6.conf +++ b/src/conf/cards/CMI8738-MC6.conf @@ -11,7 +11,6 @@ CMI8738-MC6.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop diff --git a/src/conf/cards/CMI8738-MC8.conf b/src/conf/cards/CMI8738-MC8.conf index d33a61a3..a5bf6cb4 100644 --- a/src/conf/cards/CMI8738-MC8.conf +++ b/src/conf/cards/CMI8738-MC8.conf @@ -13,7 +13,6 @@ CMI8738-MC8.pcm.front.0 { slave.pcm { type hw card $CARD - device 0 } control { name "PCM Playback Volume" diff --git a/src/conf/cards/CS46xx.conf b/src/conf/cards/CS46xx.conf index 36b616b5..7b957c95 100644 --- a/src/conf/cards/CS46xx.conf +++ b/src/conf/cards/CS46xx.conf @@ -11,7 +11,6 @@ CS46xx.pcm.front.0 { } type hw card $CARD - device 0 } # default with plughw/dsnoop @@ -209,7 +208,6 @@ CS46xx.pcm.iec958.0 { # for compatibility with older drivers interface PCM name "IEC958 Playback PCM Stream" - device 0 lock true preserve true optional true diff --git a/src/conf/cards/EMU10K1.conf b/src/conf/cards/EMU10K1.conf index 589c5d4a..7a7ebf54 100644 --- a/src/conf/cards/EMU10K1.conf +++ b/src/conf/cards/EMU10K1.conf @@ -13,14 +13,12 @@ EMU10K1.pcm.front.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -37,7 +35,6 @@ EMU10K1.pcm.front.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true @@ -67,14 +64,12 @@ EMU10K1.pcm.rear.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -104,7 +99,6 @@ EMU10K1.pcm.center_lfe.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems @@ -135,7 +129,6 @@ EMU10K1.pcm.center_lfe.0 { # } { interface PCM - device 0 name "EMU10K1 PCM Send Volume" index { @func private_pcm_subdevice } lock true @@ -152,7 +145,6 @@ EMU10K1.pcm.center_lfe.0 { } { interface PCM - device 0 name "EMU10K1 PCM Send Routing" index { @func private_pcm_subdevice } lock true diff --git a/src/conf/cards/EMU10K1X.conf b/src/conf/cards/EMU10K1X.conf index 9a72b529..b5fc708c 100644 --- a/src/conf/cards/EMU10K1X.conf +++ b/src/conf/cards/EMU10K1X.conf @@ -34,7 +34,6 @@ EMU10K1X.pcm.front.0 { } type hw card $CARD - device 0 } @@ -169,7 +168,6 @@ EMU10K1X.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/ENS1370.conf b/src/conf/cards/ENS1370.conf index ec28d2e0..32e4782e 100644 --- a/src/conf/cards/ENS1370.conf +++ b/src/conf/cards/ENS1370.conf @@ -48,7 +48,6 @@ ENS1370.pcm.rear.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/ENS1371.conf b/src/conf/cards/ENS1371.conf index 0348f4e8..a6df4251 100644 --- a/src/conf/cards/ENS1371.conf +++ b/src/conf/cards/ENS1371.conf @@ -11,7 +11,6 @@ ENS1371.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop @@ -119,7 +118,6 @@ ENS1371.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/ES1968.conf b/src/conf/cards/ES1968.conf index 6c95383c..a6ee1192 100644 --- a/src/conf/cards/ES1968.conf +++ b/src/conf/cards/ES1968.conf @@ -9,5 +9,4 @@ ES1968.pcm.front.0 { } type hw card $CARD - device 0 } diff --git a/src/conf/cards/FM801.conf b/src/conf/cards/FM801.conf index 5a0adae7..997b2184 100644 --- a/src/conf/cards/FM801.conf +++ b/src/conf/cards/FM801.conf @@ -11,7 +11,6 @@ FM801.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop @@ -70,7 +69,6 @@ FM801.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/HDA-Intel.conf b/src/conf/cards/HDA-Intel.conf index a5fafdf3..229f664e 100644 --- a/src/conf/cards/HDA-Intel.conf +++ b/src/conf/cards/HDA-Intel.conf @@ -13,13 +13,11 @@ HDA-Intel.pcm.front.0 { slave.pcm { type hw card $CARD - device 0 } control { name "PCM Playback Volume" card $CARD } - hint.device 0 } # default with dmix+softvol & dsnoop @@ -50,16 +48,6 @@ HDA-Intel.pcm.default { strings [ "dsnoop:" $CARD ] } } - hint { - device_output { - @func refer - name defaults.pcm.dmix.device - } - device_input { - @func refer - name defaults.pcm.dsnoop.device - } - } } diff --git a/src/conf/cards/ICE1724.conf b/src/conf/cards/ICE1724.conf index 41b16ffe..7f153320 100644 --- a/src/conf/cards/ICE1724.conf +++ b/src/conf/cards/ICE1724.conf @@ -59,7 +59,6 @@ ICE1724.pcm.center_lfe.0 { type hw card $CARD device 2 - subdevice 0 } diff --git a/src/conf/cards/ICH-MODEM.conf b/src/conf/cards/ICH-MODEM.conf index 9f6c76f1..b96b5aaf 100644 --- a/src/conf/cards/ICH-MODEM.conf +++ b/src/conf/cards/ICH-MODEM.conf @@ -11,6 +11,5 @@ ICH-MODEM.pcm.modem.0 { } type hw card $CARD - device 0 - hint 0 + hint.show off } diff --git a/src/conf/cards/ICH.conf b/src/conf/cards/ICH.conf index d21638b4..47ffef96 100644 --- a/src/conf/cards/ICH.conf +++ b/src/conf/cards/ICH.conf @@ -13,7 +13,6 @@ ICH.pcm.front.0 { slave.pcm { type hw card $CARD - device 0 } control { name "PCM Playback Volume" @@ -64,7 +63,6 @@ ICH.pcm.surround40.0 { slave.pcm { type hw card $CARD - device 0 channels 4 } hooks.0 { @@ -123,7 +121,6 @@ ICH.pcm.surround51.0 { slave.pcm { type hw card $CARD - device 0 channels 6 } hooks.0 { @@ -197,7 +194,6 @@ ICH.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/ICH4.conf b/src/conf/cards/ICH4.conf index e867ea71..1bf5605b 100644 --- a/src/conf/cards/ICH4.conf +++ b/src/conf/cards/ICH4.conf @@ -13,7 +13,6 @@ ICH4.pcm.front.0 { slave.pcm { type hw card $CARD - device 0 } control { name "PCM Playback Volume" @@ -64,7 +63,6 @@ ICH4.pcm.surround40.0 { slave.pcm { type hw card $CARD - device 0 channels 4 } hooks.0 { @@ -115,7 +113,6 @@ ICH4.pcm.surround51.0 { slave.pcm { type hw card $CARD - device 0 channels 6 } hooks.0 { @@ -194,7 +191,6 @@ ICH4.pcm.iec958.0 { hook_args [ { name "IEC958 Playback AC97-SPSA" - device 0 lock true preserve true value 3 @@ -202,14 +198,12 @@ ICH4.pcm.iec958.0 { } { name "IEC958 Playback Default" - device 0 lock true preserve true value [ $AES0 $AES1 $AES2 $AES3 ] } { name "IEC958 Playback Switch" - device 0 lock true preserve true value true diff --git a/src/conf/cards/Maestro3.conf b/src/conf/cards/Maestro3.conf index b5f2bcbf..2916cf49 100644 --- a/src/conf/cards/Maestro3.conf +++ b/src/conf/cards/Maestro3.conf @@ -9,7 +9,6 @@ Maestro3.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop diff --git a/src/conf/cards/NFORCE.conf b/src/conf/cards/NFORCE.conf index 0e051aef..a6040797 100644 --- a/src/conf/cards/NFORCE.conf +++ b/src/conf/cards/NFORCE.conf @@ -13,7 +13,6 @@ NFORCE.pcm.front.0 { slave.pcm { type hw card $CARD - device 0 } control { name "PCM Playback Volume" @@ -64,7 +63,6 @@ NFORCE.pcm.surround40.0 { slave.pcm { type hw card $CARD - device 0 channels 4 } hooks.0 { @@ -123,7 +121,6 @@ NFORCE.pcm.surround51.0 { slave.pcm { type hw card $CARD - device 0 channels 6 } hooks.0 { @@ -204,21 +201,18 @@ NFORCE.pcm.iec958.0 { hook_args [ { name "IEC958 Playback AC97-SPSA" - device 0 lock true preserve true value 0 } { name "IEC958 Playback Default" - device 0 lock true preserve true value [ $AES0 $AES1 $AES2 $AES3 ] } { name "IEC958 Playback Switch" - device 0 lock true preserve true value true diff --git a/src/conf/cards/PC-Speaker.conf b/src/conf/cards/PC-Speaker.conf index 37c23d07..892ef3a9 100644 --- a/src/conf/cards/PC-Speaker.conf +++ b/src/conf/cards/PC-Speaker.conf @@ -11,7 +11,6 @@ PC-Speaker.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix & null diff --git a/src/conf/cards/PMac.conf b/src/conf/cards/PMac.conf index 15ba699d..920a2093 100644 --- a/src/conf/cards/PMac.conf +++ b/src/conf/cards/PMac.conf @@ -11,7 +11,6 @@ PMac.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop diff --git a/src/conf/cards/PMacToonie.conf b/src/conf/cards/PMacToonie.conf index 498b140f..772c7c94 100644 --- a/src/conf/cards/PMacToonie.conf +++ b/src/conf/cards/PMacToonie.conf @@ -13,7 +13,6 @@ PMacToonie.pcm.front.0 { slave.pcm { type hw card $CARD - device 0 } control { name "PCM Playback Volume" diff --git a/src/conf/cards/RME9636.conf b/src/conf/cards/RME9636.conf index d45c1b28..e8dc5fad 100644 --- a/src/conf/cards/RME9636.conf +++ b/src/conf/cards/RME9636.conf @@ -11,7 +11,6 @@ RME9636.pcm.front.0 { } type hw card $CARD - device 0 } # FIXME: This configuration is not valid for double-speed rates. @@ -42,7 +41,6 @@ RME9636.pcm.iec958.0 { pcm { type hw card $CARD - device 0 } channels 18 } diff --git a/src/conf/cards/RME9652.conf b/src/conf/cards/RME9652.conf index 20d640c4..1147d810 100644 --- a/src/conf/cards/RME9652.conf +++ b/src/conf/cards/RME9652.conf @@ -11,7 +11,6 @@ RME9652.pcm.front.0 { } type hw card $CARD - device 0 } # FIXME: This configuration is not valid for double-speed rates. @@ -42,7 +41,6 @@ RME9652.pcm.iec958.0 { pcm { type hw card $CARD - device 0 } channels 26 } diff --git a/src/conf/cards/SI7018.conf b/src/conf/cards/SI7018.conf index ace72d0f..15972a46 100644 --- a/src/conf/cards/SI7018.conf +++ b/src/conf/cards/SI7018.conf @@ -13,7 +13,6 @@ SI7018.pcm.front.0 { } type hw card $CARD - device 0 } @@ -27,7 +26,6 @@ SI7018.pcm.rear.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/TRID4DWAVENX.conf b/src/conf/cards/TRID4DWAVENX.conf index e17e07f1..bbf6b7cb 100644 --- a/src/conf/cards/TRID4DWAVENX.conf +++ b/src/conf/cards/TRID4DWAVENX.conf @@ -11,7 +11,6 @@ TRID4DWAVENX.pcm.front.0 { } type hw card $CARD - device 0 } @@ -25,7 +24,6 @@ TRID4DWAVENX.pcm.rear.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/VIA686A.conf b/src/conf/cards/VIA686A.conf index f15b62d9..e4a06f23 100644 --- a/src/conf/cards/VIA686A.conf +++ b/src/conf/cards/VIA686A.conf @@ -14,7 +14,6 @@ VIA686A.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop @@ -63,28 +62,24 @@ VIA686A.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems hook_args [ { name "IEC958 Playback AC97-SPSA" - device 0 lock true preserve true value 0 } { name "IEC958 Playback Default" - device 0 lock true preserve true value [ $AES0 $AES1 $AES2 $AES3 ] } { name "IEC958 Playback Switch" - device 0 lock true preserve true value true diff --git a/src/conf/cards/VIA8233.conf b/src/conf/cards/VIA8233.conf index b2ec9452..668bfd9e 100644 --- a/src/conf/cards/VIA8233.conf +++ b/src/conf/cards/VIA8233.conf @@ -11,7 +11,6 @@ VIA8233.pcm.front.0 { } type hw card $CARD - device 0 } # default with softvol/dsnoop @@ -29,7 +28,6 @@ VIA8233.pcm.default { slave.pcm { type hw card $CARD - device 0 } control { name "PCM Playback Volume" @@ -65,7 +63,6 @@ VIA8233.pcm.surround40.0 { hook_args [ { name "Channel Mode" - device 0 preserve true value "4ch" lock true @@ -80,7 +77,6 @@ VIA8233.pcm.surround40.0 { } { name "Surround Down Mix" - device 0 preserve true value off lock true @@ -111,7 +107,6 @@ VIA8233.pcm.surround51.0 { hook_args [ { name "Channel Mode" - device 0 preserve true value "6ch" lock true @@ -132,7 +127,6 @@ VIA8233.pcm.surround51.0 { } { name "Surround Down Mix" - device 0 preserve true value off lock true @@ -140,7 +134,6 @@ VIA8233.pcm.surround51.0 { } { name "Center/LFE Down Mix" - device 0 preserve true value off lock true @@ -173,7 +166,6 @@ VIA8233.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 subdevice 3 } hooks.0 { diff --git a/src/conf/cards/VIA8233A.conf b/src/conf/cards/VIA8233A.conf index 637fee9c..97d2a7da 100644 --- a/src/conf/cards/VIA8233A.conf +++ b/src/conf/cards/VIA8233A.conf @@ -11,7 +11,6 @@ VIA8233A.pcm.front.0 { } type hw card $CARD - device 0 } # default with dmix/dsnoop @@ -48,7 +47,6 @@ VIA8233A.pcm.surround40.0 { slave.pcm { type hw card $CARD - device 0 channels 4 } hooks.0 { @@ -56,7 +54,6 @@ VIA8233A.pcm.surround40.0 { hook_args [ { name "Swap Surround Slot" - device 0 lock true preserve true value false @@ -100,7 +97,6 @@ VIA8233A.pcm.surround51.0 { slave.pcm { type hw card $CARD - device 0 channels 6 } hooks.0 { @@ -108,7 +104,6 @@ VIA8233A.pcm.surround51.0 { hook_args [ { name "Swap Surround Slot" - device 0 lock true preserve true value true @@ -182,28 +177,24 @@ VIA8233A.pcm.iec958.0 { hook_args [ { name "IEC958 Playback AC97-SPSA" - device 0 lock true preserve true value 3 } { name "IEC958 Playback Default" - device 0 lock true preserve true value [ $AES0 $AES1 $AES2 $AES3 ] } { name "IEC958 Playback Switch" - device 0 lock true preserve true value true } { name "IEC958 Output Switch" - device 0 lock true preserve true value true diff --git a/src/conf/cards/VIA8237.conf b/src/conf/cards/VIA8237.conf index a0985b0d..404e1907 100644 --- a/src/conf/cards/VIA8237.conf +++ b/src/conf/cards/VIA8237.conf @@ -11,7 +11,6 @@ VIA8237.pcm.front.0 { } type hw card $CARD - device 0 } # default with softvol/dsnoop @@ -29,7 +28,6 @@ VIA8237.pcm.default { slave.pcm { type hw card $CARD - device 0 } control { name "PCM Playback Volume" @@ -65,7 +63,6 @@ VIA8237.pcm.surround40.0 { hook_args [ { name "Channel Mode" - device 0 preserve true value "4ch" lock true @@ -73,7 +70,6 @@ VIA8237.pcm.surround40.0 { } { name "Surround Down Mix" - device 0 preserve true value off lock true @@ -112,7 +108,6 @@ VIA8237.pcm.surround51.0 { hook_args [ { name "Channel Mode" - device 0 preserve true value "6ch" lock true @@ -120,7 +115,6 @@ VIA8237.pcm.surround51.0 { } { name "Surround Down Mix" - device 0 preserve true value off lock true @@ -128,7 +122,6 @@ VIA8237.pcm.surround51.0 { } { name "Center/LFE Down Mix" - device 0 preserve true value off lock true @@ -163,7 +156,6 @@ VIA8237.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 subdevice 3 } hooks.0 { diff --git a/src/conf/cards/VX222.conf b/src/conf/cards/VX222.conf index 11cb4cda..3385f25b 100644 --- a/src/conf/cards/VX222.conf +++ b/src/conf/cards/VX222.conf @@ -11,7 +11,6 @@ VX222.pcm.front.0 { } type hw card $CARD - device 0 } @@ -37,7 +36,6 @@ VX222.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/VXPocket.conf b/src/conf/cards/VXPocket.conf index bdce1376..fe44ff53 100644 --- a/src/conf/cards/VXPocket.conf +++ b/src/conf/cards/VXPocket.conf @@ -11,7 +11,6 @@ VXPocket.pcm.front.0 { } type hw card $CARD - device 0 } @@ -37,7 +36,6 @@ VXPocket.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/VXPocket440.conf b/src/conf/cards/VXPocket440.conf index 2aa96f8b..197c2d6c 100644 --- a/src/conf/cards/VXPocket440.conf +++ b/src/conf/cards/VXPocket440.conf @@ -11,7 +11,6 @@ VXPocket440.pcm.front.0 { } type hw card $CARD - device 0 } @@ -86,7 +85,6 @@ VXPocket440.pcm.iec958.0 { slave.pcm { type hw card $CARD - device 0 } hooks.0 { type ctl_elems diff --git a/src/conf/cards/YMF744.conf b/src/conf/cards/YMF744.conf index 6243a09a..84dbcbec 100644 --- a/src/conf/cards/YMF744.conf +++ b/src/conf/cards/YMF744.conf @@ -11,7 +11,6 @@ YMF744.pcm.front.0 { } type hw card $CARD - device 0 } diff --git a/src/conf/pcm/center_lfe.conf b/src/conf/pcm/center_lfe.conf index 228c6195..4ef6f497 100644 --- a/src/conf/pcm/center_lfe.conf +++ b/src/conf/pcm/center_lfe.conf @@ -53,5 +53,6 @@ pcm.!center_lfe { name defaults.namehint.basic } description "Center and Subwoofer speakers" + device $DEV } } diff --git a/src/conf/pcm/default.conf b/src/conf/pcm/default.conf index fcee2989..98db3e0d 100644 --- a/src/conf/pcm/default.conf +++ b/src/conf/pcm/default.conf @@ -18,25 +18,40 @@ pcm.!default { } } } - # use card-specific definition if exists - @func refer - name { - @func concat - strings [ - "cards." - { - @func card_driver + type empty + slave.pcm { + # use card-specific definition if exists + @func refer + name { + @func concat + strings [ + "cards." + { + @func card_driver + card $CARD + } + ".pcm.default1:CARD=" $CARD + ] + } + default { + # use plughw as default + type plug + slave.pcm { + type hw card $CARD } - ".pcm.default:CARD=" $CARD - ] + hint.device 0 + } } - default { - # use plughw as default - type plug - slave.pcm { - type hw - card $CARD + hint { + description "Default Audio Device" + device_output { + @func refer + name defaults.pcm.dmix.device + } + device_input { + @func refer + name defaults.pcm.dsnoop.device } } } diff --git a/src/conf/pcm/front.conf b/src/conf/pcm/front.conf index ba928481..7aff0cbf 100644 --- a/src/conf/pcm/front.conf +++ b/src/conf/pcm/front.conf @@ -53,5 +53,6 @@ pcm.!front { name defaults.namehint.basic } description "Front speakers" + device $DEV } } diff --git a/src/conf/pcm/iec958.conf b/src/conf/pcm/iec958.conf index 9be622e9..ac139b5e 100644 --- a/src/conf/pcm/iec958.conf +++ b/src/conf/pcm/iec958.conf @@ -78,5 +78,6 @@ pcm.!iec958 { name defaults.namehint.basic } description "IEC958 (S/PDIF) Digital Audio Output" + device $DEV } } diff --git a/src/conf/pcm/rear.conf b/src/conf/pcm/rear.conf index 952a1d65..85c70aab 100644 --- a/src/conf/pcm/rear.conf +++ b/src/conf/pcm/rear.conf @@ -53,5 +53,6 @@ pcm.!rear { name defaults.namehint.basic } description "Rear speakers" + device $DEV } } diff --git a/src/conf/pcm/side.conf b/src/conf/pcm/side.conf index 2d86c7fe..4a81af09 100644 --- a/src/conf/pcm/side.conf +++ b/src/conf/pcm/side.conf @@ -53,5 +53,6 @@ pcm.!side { name defaults.namehint.basic } description "Side speakers" + device $DEV } } diff --git a/src/conf/pcm/surround40.conf b/src/conf/pcm/surround40.conf index 8733f8f7..361ccaa1 100644 --- a/src/conf/pcm/surround40.conf +++ b/src/conf/pcm/surround40.conf @@ -52,5 +52,8 @@ pcm.!surround40 { ] } } - hint.description "4.0 Surround output to Front and Rear speakers" + hint { + description "4.0 Surround output to Front and Rear speakers" + device $DEV + } } diff --git a/src/conf/pcm/surround41.conf b/src/conf/pcm/surround41.conf index 69facf10..10e486e2 100644 --- a/src/conf/pcm/surround41.conf +++ b/src/conf/pcm/surround41.conf @@ -59,5 +59,8 @@ pcm.!surround41 { ttable.2.2 1 ttable.3.3 1 ttable.4.5 1 - hint.description "4.1 Surround output to Front, Rear and Subwoofer speakers" + hint { + description "4.1 Surround output to Front, Rear and Subwoofer speakers" + device $DEV + } } diff --git a/src/conf/pcm/surround50.conf b/src/conf/pcm/surround50.conf index c033fe35..7b7b17e1 100644 --- a/src/conf/pcm/surround50.conf +++ b/src/conf/pcm/surround50.conf @@ -59,5 +59,8 @@ pcm.!surround50 { ttable.2.2 1 ttable.3.3 1 ttable.4.4 1 - hint.description "5.0 Surround output to Front, Center and Rear speakers" + hint { + description "5.0 Surround output to Front, Center and Rear speakers" + device $DEV + } } diff --git a/src/conf/pcm/surround51.conf b/src/conf/pcm/surround51.conf index 3cd07909..3a7543f9 100644 --- a/src/conf/pcm/surround51.conf +++ b/src/conf/pcm/surround51.conf @@ -54,5 +54,8 @@ pcm.!surround51 { ] } } - hint.description "5.1 Surround output to Front, Center, Rear and Subwoofer speakers" + hint { + description "5.1 Surround output to Front, Center, Rear and Subwoofer speakers" + device $DEV + } } diff --git a/src/conf/pcm/surround71.conf b/src/conf/pcm/surround71.conf index 41a63654..eb2360b1 100644 --- a/src/conf/pcm/surround71.conf +++ b/src/conf/pcm/surround71.conf @@ -56,5 +56,8 @@ pcm.!surround71 { ] } } - hint.description "7.1 Surround output to Front, Center, Side, Rear and Woofer speakers" + hint { + description "7.1 Surround output to Front, Center, Side, Rear and Woofer speakers" + device $DEV + } } diff --git a/src/control/namehint.c b/src/control/namehint.c index 23ae7396..01dcf2d5 100644 --- a/src/control/namehint.c +++ b/src/control/namehint.c @@ -185,7 +185,7 @@ static char *get_dev_name(struct hint_list *list) strcat(res, ", "); strcat(res, str1); strcat(res, " {"); - strcat(res, list->iface == SND_CTL_ELEM_IFACE_PCM ? "Capture" : "Input"); + strcat(res, str2); strcat(res, "}"); free(str1); return res; @@ -205,7 +205,7 @@ static int try_config(struct hint_list *list, const char *name) { snd_lib_error_handler_t eh; - snd_config_t *res = NULL, *cfg, *n; + snd_config_t *res = NULL, *cfg, *cfg1, *n; snd_config_iterator_t i, next; char *buf, *buf1 = NULL, *buf2; const char *str; @@ -253,11 +253,26 @@ static int try_config(struct hint_list *list, } #endif - cfg = res; + cfg1 = res; level = 0; __hint: level++; - if (snd_config_search(cfg, "hint", &cfg) >= 0) { + if (snd_config_search(cfg1, "type", &cfg) >= 0 && + snd_config_get_string(cfg, &str) >= 0 && + strcmp(str, "hw") == 0) { + dev = 0; + list->device_input = -1; + list->device_output = -1; + if (snd_config_search(cfg1, "device", &cfg) >= 0) { + if (snd_config_get_integer(cfg, &dev) < 0) { + SNDERR("(%s) device must be an integer", buf); + err = -EINVAL; + goto __cleanup; + } + } + } + + if (snd_config_search(cfg1, "hint", &cfg) >= 0) { if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) { SNDERR("hint (%s) must be a compound", buf); err = -EINVAL; @@ -302,8 +317,8 @@ static int try_config(struct hint_list *list, } } else if (level == 1 && !list->show_all) goto __skip_add; - if (snd_config_search(cfg, "slave", &cfg) >= 0 && - snd_config_search(cfg, base, &cfg) >= 0) + if (snd_config_search(cfg1, "slave", &cfg) >= 0 && + snd_config_search(cfg, base, &cfg1) >= 0) goto __hint; snd_config_delete(res); res = NULL;