0

I installed a new PCI based soundcard in my PC. It has 8 S/PDIF based I/O pairs with each line numbered 1 to 8 for input as well as output. And I'm trying to use lines 3-8 for input (mics) and 3-8 for output (play) in stereo with :

  • line 3 + line 4 = channel 1 (both input and output),
  • line 5 + line 6 = channel 2 (both input and output),
  • line 7 + line 8 = channel 3 (both input and output).

So, I created the following .asoundrc:

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

ctl.!default {
    type hw
    card 1
}


pcm.play_out_44 {
    type dmix
    ipc_key 1201
    ipc_key_add_uid true
    slave {
        pcm "hw:1,0"
        channels 2
        rate 44100
        format S32_LE
        buffer_size 4096
        period_size 1024
    }
}

pcm.rec_in_44 {
    type dsnoop
    ipc_key 1210
    slave {
        pcm "hw:1,0"
        channels 2
        rate 44100
        buffer_size 4096
        period_size 1024
    }
}


pcm.outch1 {
    type plug
    slave {
        pcm "play_out_44"
        bindings { 
            2 2
            3 3
        }
        hint.description "PCI Card Stereo output/playback channel 1 (from output ports 3 & 4)"
    }
}

pcm.inch1 {
    type plug
    slave {
        pcm "rec_in_44"
        bindings { 
            2 2
            3 3
        }
        hint.description "PCI Card Stereo input/capture channel 1 (from input ports 3 & 4)"
    }
}

pcm.outch2 {
    type plug
    slave {
        pcm "play_out_44"
        bindings { 
            4 4
            5 5
        }
        hint.description "PCI Card Stereo output/playback channel 2 (from output ports 5 & 6)"
    }
}

pcm.inch2 {
    type plug
    slave {
        pcm "rec_in_44"
        bindings { 
            4 4
            5 5
        }
        hint.description "PCI Card Stereo input/capture channel 2 (from input ports 5 & 6)"
    }
}

pcm.outch3 {
    type plug
    slave {
        pcm "play_out_44"
        bindings { 
            6 6
            7 7
        }
        hint.description "PCI Card Stereo output/playback channel 3 (from output ports 7 & 8)"
    }
}

pcm.inch3 {
    type plug
    slave {
        pcm "rec_in_44"
        bindings { 
            6 6
            7 7
        }
        hint.description "PCI Card Stereo input/capture channel 3 (from input ports 7 & 8)"
    }
}

As mentioned here, I created a new dmix type to suit my configuration. But when I try to open Audacity to try and play and capture, none of inch1, inch2, inch3, outch1, outch2, outch3 are available in the recording device or playback device list!

How do I modify or create a .asoundrc for stereo play and stereo capture on my device?

0

I reproduced the problem for the outch plugs with my traditional stereo soundcard. I assume the inch plugs suffer from a similar problem.

The thing is: these plugs don't accept fields bindings and hint. I suppose you don't really need hint and bindings go into dmix or dsnooper (See here)

I you want to debug your setup a little faster, without having to start audacity each time, here's what I would do (and how I diagnosed your problem):

  • give your pcms names that are easy to grep. I renamed yours so they always start with "xx".
  • run aplay -L | grep xx. You should then at least see your pcms. With your stripped down .asoundrc I saw

.

   xxplay_out_44
   xxoutch1
  • Find some wav file, e.g. with locate *.wav | head
  • Play the wav file using one of the pcms discovered in the previous step

.

    > aplay -D xxoutch1  /usr/share/sounds/sound-icons/xylofon.wav 
    ALSA lib pcm.c:7448:(snd_pcm_slave_conf) Unknown field bindings

Now you have a decent error message. If you remove bindings you will see it complain about the hint field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.