Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ----------------------------------------- #
- # !!! CHANGE "hw:PCH,0" TO YOUR DEVICE !!! #
- # ----------------------------------------- #
- # in `pcm.playback` and `pcm.capture` #
- # ----------------------------------------- #
- # set default resampler
- defaults.pcm.rate_converter "speexrate"
- # Playback
- # --------
- pcm.playback {
- type dmix
- ipc_key 1111
- slave {
- pcm "hw:PCH,0"
- period_size 1024
- buffer_size 4096
- # firefox can't play AAC with buffer size lower than 2048
- # ("failed to init cubeb")
- # defaults for dmix/dsnoop plugins:
- # format S16_LE; rate 48000; channels 2
- }
- }
- pcm.loop_in {
- type dmix
- ipc_key 2222
- slave {
- pcm "hw:Loopback,0,7"
- period_size 1024
- buffer_size 4096
- }
- }
- pcm.duplicate {
- # this 4-channel pcm splits one stream into two
- # (e.g. output to speakers and to the loop device)
- # / if an app opens 4-channel device to write to,
- # then channels 1 and 2 map to `slave a`
- # and channels 3 and 4 map to `slave b`,
- # which is not what this device is intended for;
- # use `duplicate_stereo` in this case /
- type plug
- slave.pcm {
- type multi
- slaves {
- a { channels 2 pcm "playback" }
- b { channels 2 pcm "loop_in" }
- }
- bindings [
- { slave a channel 0 }
- { slave a channel 1 }
- { slave b channel 0 }
- { slave b channel 1 }
- ]
- }
- #~ route_policy "duplicate"
- # -- or --
- ttable [
- [ 1 0 1 0 ] # left -> a.left, b.left
- [ 0 1 0 1 ] # right -> a.right, b.right
- ]
- }
- pcm.duplicate_stereo {
- # this device may fail at some configurations
- # use 4-channel "duplicate" if it fails
- type plug
- slave.pcm "duplicate"
- slave.channels 2
- }
- # Capture
- # -------
- pcm.capture {
- type plug
- slave.pcm {
- type dsnoop
- ipc_key 3333
- slave {
- pcm "hw:PCH,0"
- period_size 1024
- buffer_size 4096
- # lingot fails with buffer size lower than 2048
- # ("cannot set parameters")
- }
- }
- }
- pcm.loop_out {
- # system sounds capture device
- type plug
- slave.pcm {
- type dsnoop
- ipc_key 4444
- slave {
- pcm "hw:Loopback,1,7"
- period_size 1024
- buffer_size 4096
- }
- }
- #~ slave.channels 2
- hint {
- show on
- description "System sounds"
- }
- }
- # The Default
- # --------------------
- # Playback:
- # [source] -> multi ---> /duplicate/ -> dmix -> hardware -> [output]
- # \-> /duplicate/ -> dmix -> *pcm.loop_in* -> (loopback)
- # Capture:
- # [input] -> hardware -> dsnoop -> *pcm.capture* -> [sink]
- # (loopback) -> dsnoop -> *pcm.loop_out* -> [sink]
- pcm.!default {
- type asym
- playback.pcm "duplicate_stereo" # variants: "duplicate_stereo", "duplicate"
- capture.pcm "capture"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement