]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Reorganization
authorJaroslav Kysela <perex@perex.cz>
Wed, 13 Jun 2001 12:56:38 +0000 (12:56 +0000)
committerJaroslav Kysela <perex@perex.cz>
Wed, 13 Jun 2001 12:56:38 +0000 (12:56 +0000)
src/alsa.conf

index fd74e10edf5b8a51fc3e284709f11e53bfd8c1d9..1f587e27d26df69304f5e364c9ed73edad291f2e 100644 (file)
@@ -2,30 +2,9 @@
 #  ALSA library configuration file
 #
 
-pcm.default {
-       type plug
-       slave.pcm {
-               type hw
-               card {
-                       @func getenv
-                       @type integer
-                       envname [
-                               ALSA_PCM_CARD
-                               ALSA_CARD
-                       ]
-                       default 0
-               }
-               device {
-                       @func getenv
-                       @type integer
-                       envname [
-                               ALSA_PCM_DEVICE
-                       ]
-                       default 0
-               }
-               subdevice -1
-       }
-}
+#
+#  PCM interface
+#
 
 pcm.hw {
        args [ CARD DEV SUBDEV ]
@@ -121,6 +100,35 @@ pcm.file {
        format $(FORMAT)
 }
 
+pcm.null {
+       type null
+}
+       
+pcm.default {
+       type plug
+       slave.pcm {
+               type hw
+               card {
+                       @func getenv
+                       @type integer
+                       envname [
+                               ALSA_PCM_CARD
+                               ALSA_CARD
+                       ]
+                       default 0
+               }
+               device {
+                       @func getenv
+                       @type integer
+                       envname [
+                               ALSA_PCM_DEVICE
+                       ]
+                       default 0
+               }
+               subdevice -1
+       }
+}
+
 pcm.surround40 {
        args [ CARD DEV ]
        args.CARD {
@@ -165,13 +173,7 @@ pcm.surround40 {
                name {
                        @func concat
                        strings [
-                               "pcm.surround40_" $(DEV) "_"
-                               {
-                                       @func pcm_id
-                                       card $(CARD)
-                                       device 0
-                               }
-                               ":" $(CARD)
+                               "pcm.surround40_" $(DEV) ":CARD=" $(CARD)
                        ]
                }
        }
@@ -194,23 +196,120 @@ pcm.surround51 {
        }
        args.DEV {
                type integer
-               default <@ALSA_SURROUND51_DEVICE:0@>
+               default {
+                       @func getenv
+                       @type integer
+                       envname [
+                               ALSA_SURROUND51_DEVICE
+                       ]
+                       default 0
+               }
+       }
+       redirect {
+               filename {
+                       @func concat
+                       strings [
+                               {
+                                       @func datadir
+                               }
+                               "/cards/"
+                               {
+                                       @func card_strtype
+                                       card $(CARD)
+                               }
+                               ".conf"
+                       ]
+               }
+               name {
+                       @func concat
+                       strings [
+                               "pcm.surround51_" $(DEV) ":CARD=" $(CARD)
+                       ]
+               }
        }
-       type surround
-       card $(CARD)
-       device $(DEVICE)
-       stype "5.1"
-}
-       
-pcm.null {
-       type null
 }
        
-ctl.default {
-       type hw
-       card <@ALSA_CARD:0@>
+pcm.iec958 {
+       args [ CARD DEV AES0 AES1 AES2 AES3 ]
+       args.CARD {
+               type integer
+               default {
+                       @func getenv
+                       @type integer
+                       envname [
+                               ALSA_IEC958_CARD
+                               ALSA_PCM_CARD
+                               ALSA_CARD
+                       ]
+                       default 0
+               }
+       }
+       args.DEV {
+               type integer
+               default {
+                       @func getenv
+                       @type integer
+                       envname [
+                               ALSA_IEC958_DEVICE
+                       ]
+                       default 0
+               }
+       }
+       args.AES0 {
+               type integer
+               # consumer, not-copyright, emphasis-none, mode=0
+               default 0x04
+       }
+       args.AES1 {
+               type integer
+               # original, PCM coder
+               default 0x82
+       }
+       args.AES2 {
+               type integer
+               # source and channel
+               default 0x00
+       }
+       args.AES3 {
+               type integer
+               # fs=48000Hz, clock accuracy=1000ppm
+               default 0x02
+       }
+       redirect {
+               filename {
+                       @func concat
+                       strings [
+                               {
+                                       @func datadir
+                               }
+                               "/cards/"
+                               {
+                                       @func card_strtype
+                                       card $(CARD)
+                               }
+                               ".conf"
+                       ]
+               }
+               name {
+                       @func concat
+                       strings [
+                               "pcm.iec958_" $(DEV) ":"
+                               "CARD=" $(CARD) ","
+                               "AES0=" $(AES0) ","
+                               "AES1=" $(AES1) ","
+                               "AES2=" $(AES2) ","
+                               "AES3=" $(AES3)
+                       ]
+               }
+       }
 }
 
+pcm.spdif "pcm.iec958"
+
+#
+#  Control interface
+#
+       
 ctl.hw {
        args[ CARD ]
        args.CARD {
@@ -233,27 +332,21 @@ ctl.shm {
        ctl $(CTL)
 }
 
-rawmidi.default {
+ctl.default {
        type hw
        card {
                @func getenv
-               @type integer
                envname [
-                       ALSA_RAWMIDI_CARD
                        ALSA_CARD
                ]
                default 0
        }
-       device {
-               @func getenv
-               @type integer
-               envname [
-                       ALSA_RAWMIDI_DEVICE
-               ]
-               default 0
-       }
 }
 
+#
+#  RawMidi interface
+#
+
 rawmidi.hw {
        args [ CARD DEV SUBDEV ]
        args.CARD {
@@ -272,53 +365,35 @@ rawmidi.hw {
        subdevice $(SUBDEV)
 }
 
-seq.default {
+rawmidi.default {
        type hw
+       card {
+               @func getenv
+               @type integer
+               envname [
+                       ALSA_RAWMIDI_CARD
+                       ALSA_CARD
+               ]
+               default 0
+       }
+       device {
+               @func getenv
+               @type integer
+               envname [
+                       ALSA_RAWMIDI_DEVICE
+               ]
+               default 0
+       }
 }
 
-seq.hw {
+#
+#  Sequencer interface
+#
+
+seq.default {
        type hw
 }
 
-pcm.iec958 {
-       args [ PCM AES0 AES1 AES2 AES3 ]
-       args.PCM {
-               type string
-               default default
-       }
-       args.AES0 {
-               type integer
-               # IEC958_AES0_PROFESSIONAL | IEC958_AES0_NONAUDIO |
-               # IEC958_AES0_PRO_EMPHASIS_NONE | IEC958_AES0_PRO_FS_48000
-               default 0x87
-       }
-       args.AES1 {
-               type integer
-               default 0x00
-       }
-       args.AES2 {
-               type integer
-               default 0x00
-       }
-       args.AES3 {
-               type integer
-               default 0x00
-       }
-       type hooks
-       slave.pcm $(PCM)
-       hooks [
-               {
-                       type ctl_elems
-                       args [
-                               name "IEC958 Playback PCM Stream"
-                               subdevice 0
-                               preserve true
-                               lock true
-                               value.0 $(AES0)
-                               value.1 $(AES1)
-                               value.2 $(AES2)
-                               value.3 $(AES3)
-                       ]
-               }
-       ]
+seq.hw {
+       type hw
 }