1

The details of my setup are as follows:

Built-in Intel HD card (card0), to which all my existing applications use by default. Generally stereo output going out to the card from stereo files and streaming applications.

I've now added a USB sound card (card1: xCORE-200, from XMOS) and have a non-standard array of 8 outputs: 4 tweeters, 4 speakers. They are symmetrical, so that 2 tweeters/2 speakers on the Left side and 2 tweeters/2 speakers on the Right side. The channel array looks like this:

[0, 1, FrontRightTweeter, RearRightTweeter, LeftRearTweeter, LeftFrontTweeter, 6, 7, 8, 9, RightFrontSpeaker, RightRearSpeaker, LeftRearSpeaker, LeftFrontSpeaker, 14, 15]

The crossover is already handled, so I would like to simply remap all stereo sources so that the Left goes to the whole new Left side and the Right goes to the whole new Right side.

Also, from manual testing I've always had to significantly lower the volume (by ~90%) of the source to get a reasonable level out of my new speaker setup. So I need to be able to do this on the fly as well.

I've looked at several examples using ALSA via .asoundrc and PulseAudio modules, and I can't seem to connect all the pieces together successfully - especially going from fewer channel sources to more channels (it's usually the other way around). I'm looking for either an example .asoundrc or PulseAudio module config (whichever makes more sense) that can achieve the channel remapping and volume lowering that I'm shooting for. Thanks!

1

This is possible with the ttable option of the route plugin, which is also integrated in the plug plugin:

pcm.MyLittleDevice {
    type plug
    slave {
        pcm "hw:1"
        channels 16
    }
    ttable [
        [ 0 0 0 0 1 1 0 0 0 0 0 0 1 1 0 0 ]
        [ 0 0 1 1 0 0 0 0 0 0 1 1 0 0 0 0 ]
    ]
}

To reduce the volume, replace the 1s with smaller values.

0

Thanks to @CL. , this is the solution I came up with:

pcm.xcoreremapped {
    type plug
    hint {
        show on
        description "Remapping stereo to 8-ch speaker array."
    }
    slave {
        pcm "hw:1,0"
        channels 16
    }
    ttable [
        [ 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 ]
        [ 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 0.05 ]
    ]
}

0.05 lowers the volume level on each channel to about where I want it to be. And I ended up remapping to all channels to make configuration easier - I didn't have to worry about getting the mapping right and there seemed to be no harm remapping to unused channels, though I will monitor a potential performance hit.

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.