I am using a multimedia application (XBMC Frodo RC3) that does not allow me to select custom pcm device. It just asks the hardware device (in this case it is hw:0,0).

Given this limitation I have to write an asoundrc (or asound.conf) file where I can configure the hw:0,0 device.

I test the configuration by running:

    speaker-test -D hw:0,0 -c6

This simulates how the XBMC will produce surround sound.

My asound.conf looks like this at the moment:

pcm.surroundsw {
    type    route
    slave {
            pcm surround51
    ttable {
            0.2 1
            1.3 1
            2.1 8
            3.0 8
            4.4 1
            5.5 1

This is the working routing table so when I run speaker-test -Dsurroundsw -c6 I get the desired behavior.

What kind of asound.conf should I write to get the desired behavior when I run speaker-test -D hw:0,0 -c6? This is purely an ALSA configuration problem.


Just define a device named hw, but use ! to ensure that the built-in definition is overridden, and use @args to allow parameters (which are ignored if you don't use them in the definition):

pcm.!hw {
    @args [ CARD DEV SUBDEV ]
    @args.CARD   { type string }
    @args.DEV    { type integer }
    @args.SUBDEV { type integer }
    # normal definition here:
    type route
  • Thank you. This was the answer I was looking. Unfortunately XBMC still ignores my asound.conf and apparently accesses the sound card from somewhere else. I have to keep digging. – Juho Rutila Jan 26 '13 at 20:31

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.