Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
3 edited title
| link

Need help understanding Understanding what "channels", "buffer_size", "period_size", "bindings" and "ipc_key" stand for in .asoundrc

2 added 5 characters in body
source | link
  • channels : does it stand for audio channel numbers? Like if I'm gonna use mono or stereo? Say, if my soundcard has 8 input ports and 8 output ports on it, if I were to use mono configuration should I set a value of 16 - 8 inputs + 8 outputs or 8 - 8 input-output pairs (and in case I were to use stereo configuration, should I set a value of 8 - 4 inputs + 4 outputs or 4 - 4 input-output pairs)?
  • buffer_size : I dunnodon't know anything except that making these sizes smaller is needed to ensure lower latency. What exactly does this mean?
  • period_size : again this has to be related to latency?
  • bindings : are these the ones that maps channels to the ports? For mono configuration I used [ <index_number> ]. Can I use [ <index_number1> <index_number2> ] for stereo configuration and likewise?
  • ipc_key : I understand it is a given unique number, same for each PCM device defined from the same slave. Supposing I add a new soundcard detected as hw:2,0, and go ahead to define PCM devices in the same manner as above, I will have to assign a different value for this parameter there (say 2222) for each PCM device defined from the new slave?
  • channels : does it stand for audio channel numbers? Like if I'm gonna use mono or stereo? Say, if my soundcard has 8 input ports and 8 output ports on it, if I were to use mono configuration should I set a value of 16 - 8 inputs + 8 outputs or 8 - 8 input-output pairs (and in case I were to use stereo configuration, should I set a value of 8 - 4 inputs + 4 outputs or 4 - 4 input-output pairs)?
  • buffer_size : I dunno anything except that making these sizes smaller is needed to ensure lower latency. What exactly does this mean?
  • period_size : again this has to be related to latency?
  • bindings : are these the ones that maps channels to the ports? For mono configuration I used [ <index_number> ]. Can I use [ <index_number1> <index_number2> ] for stereo configuration and likewise?
  • ipc_key : I understand it is a given unique number, same for each PCM device defined from the same slave. Supposing I add a new soundcard detected as hw:2,0, and go ahead to define PCM devices in the same manner as above, I will have to assign a different value for this parameter there (say 2222) for each PCM device defined from the new slave?
  • channels : does it stand for audio channel numbers? Like if I'm gonna use mono or stereo? Say, if my soundcard has 8 input ports and 8 output ports on it, if I were to use mono configuration should I set a value of 16 - 8 inputs + 8 outputs or 8 - 8 input-output pairs (and in case I were to use stereo configuration, should I set a value of 8 - 4 inputs + 4 outputs or 4 - 4 input-output pairs)?
  • buffer_size : I don't know anything except that making these sizes smaller is needed to ensure lower latency. What exactly does this mean?
  • period_size : again this has to be related to latency?
  • bindings : are these the ones that maps channels to the ports? For mono configuration I used [ <index_number> ]. Can I use [ <index_number1> <index_number2> ] for stereo configuration and likewise?
  • ipc_key : I understand it is a given unique number, same for each PCM device defined from the same slave. Supposing I add a new soundcard detected as hw:2,0, and go ahead to define PCM devices in the same manner as above, I will have to assign a different value for this parameter there (say 2222) for each PCM device defined from the new slave?
1
source | link

Need help understanding what "channels", "buffer_size", "period_size", "bindings" and "ipc_key" stand for in .asoundrc

To setup my USB soundcard for my Linux PC, I started to learn about ALSA and about writing configuration files. After much effort, I was able to write one and get it working. The following is my .asoundrc stored in my home folder:

pcm.!default {
    type plug
    slave {
       pcm "hw:1,0"
    }
}

ctl.!default {
    type hw
    card 1
}

pcm_slave.maudiomtrackeight1 {
    pcm "hw:1,0"
    channels 8
    rate 44100
    buffer_size 4096
    period_size 1024
}

pcm.outch1 {
    type dshare
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 0 ]
    hint.description "M-Audio M-Track Eight output/playback channel 1"
}

pcm.inch1 {
    type dsnoop
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 0 ]
    hint.description "M-Audio M-Track Eight input/capture channel 1"
}

pcm.outch2 {
    type dshare
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 1 ]
    hint.description "M-Audio M-Track Eight output/playback channel 2"
}

pcm.inch2 {
    type dsnoop
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 1 ]
    hint.description "M-Audio M-Track Eight input/capture channel 2"
}

pcm.outch3 {
    type dshare
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 2 ]
    hint.description "M-Audio M-Track Eight output/playback channel 3"
}

pcm.inch3 {
    type dsnoop
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 2 ]
    hint.description "M-Audio M-Track Eight input/capture channel 3"
}

pcm.outch4 {
    type dshare
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 3 ]
    hint.description "M-Audio M-Track Eight output/playback channel 4"
}

pcm.inch4 {
    type dsnoop
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 3 ]
    hint.description "M-Audio M-Track Eight input/capture channel 4"
}

pcm.outch5 {
    type dshare
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 4 ]
    hint.description "M-Audio M-Track Eight output/playback channel 5"
}

pcm.inch5 {
    type dsnoop
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 4 ]
    hint.description "M-Audio M-Track Eight input/capture channel 5"
}

pcm.outch6 {
    type dshare
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 5 ]
    hint.description "M-Audio M-Track Eight output/playback channel 6"
}

pcm.inch6 {
    type dsnoop
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 5 ]
    hint.description "M-Audio M-Track Eight input/capture channel 6"
}

pcm.outch7 {
    type dshare
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 6 ]
    hint.description "M-Audio M-Track Eight output/playback channel 7"
}

pcm.inch7 {
    type dsnoop
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 6 ]
    hint.description "M-Audio M-Track Eight input/capture channel 7"
}

pcm.outch8 {
    type dshare
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 7 ]
    hint.description "M-Audio M-Track Eight output/playback channel 8"
}

pcm.inch8 {
    type dsnoop
    ipc_key 1111
    slave maudiomtrackeight1
    bindings [ 7 ]
    hint.description "M-Audio M-Track Eight input/capture channel 8"
}

Though I was able to grasp most of the concepts, I was unable to understand the following:

  • channels : does it stand for audio channel numbers? Like if I'm gonna use mono or stereo? Say, if my soundcard has 8 input ports and 8 output ports on it, if I were to use mono configuration should I set a value of 16 - 8 inputs + 8 outputs or 8 - 8 input-output pairs (and in case I were to use stereo configuration, should I set a value of 8 - 4 inputs + 4 outputs or 4 - 4 input-output pairs)?
  • buffer_size : I dunno anything except that making these sizes smaller is needed to ensure lower latency. What exactly does this mean?
  • period_size : again this has to be related to latency?
  • bindings : are these the ones that maps channels to the ports? For mono configuration I used [ <index_number> ]. Can I use [ <index_number1> <index_number2> ] for stereo configuration and likewise?
  • ipc_key : I understand it is a given unique number, same for each PCM device defined from the same slave. Supposing I add a new soundcard detected as hw:2,0, and go ahead to define PCM devices in the same manner as above, I will have to assign a different value for this parameter there (say 2222) for each PCM device defined from the new slave?

I could try and experiment a bit to understand the rest, but still some stuffs couldn't be cleared. The fact that not many tutorials and lack of good official ALSA documentation is not helping the cause either. Can someone throw some light on this?