diff --git a/src/alsa.conf b/src/alsa.conf index fd74e10e..1f587e27 100644 --- a/src/alsa.conf +++ b/src/alsa.conf @@ -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,6 +332,39 @@ ctl.shm { ctl $(CTL) } +ctl.default { + type hw + card { + @func getenv + envname [ + ALSA_CARD + ] + default 0 + } +} + +# +# RawMidi interface +# + +rawmidi.hw { + args [ CARD DEV SUBDEV ] + args.CARD { + type integer + } + args.DEV { + type integer + } + args.SUBDEV { + type integer + default -1 + } + type hw + card $(CARD) + device $(DEV) + subdevice $(SUBDEV) +} + rawmidi.default { type hw card { @@ -254,23 +386,9 @@ rawmidi.default { } } -rawmidi.hw { - args [ CARD DEV SUBDEV ] - args.CARD { - type integer - } - args.DEV { - type integer - } - args.SUBDEV { - type integer - default -1 - } - type hw - card $(CARD) - device $(DEV) - subdevice $(SUBDEV) -} +# +# Sequencer interface +# seq.default { type hw @@ -279,46 +397,3 @@ seq.default { seq.hw { 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) - ] - } - ] -}