0

My plan is to use the 4 analog outputs of my 7.1 USB sound card (AUREON XFIRE 8.0 HD) as individual stereo pairs to create a multi-room audio setup using Ubuntu 22.04 and Shairport Sync.

I have the following .asoundrc to create virtual devices that I can use in Shairport Sync (or any other source supporting ALSA):

pcm.stereoA {
    # 0 - Front Left
    # 1 - Front Right
    type route;
    slave.pcm "hw:1,0";
    slave.channels 8;
    ttable.0.0 1;
    ttable.1.1 1;
}

pcm.stereoB {
    # 2 - Front Center
    # 3 - LFE
    type route;
    slave.pcm "hw:1,0";
    slave.channels 8;
    ttable.0.3 1;
    ttable.1.2 1;
}

pcm.stereoC {
    # 4 - Rear Right
    # 5 - Rear Left
    type route;
    slave.pcm "hw:1,0";
    slave.channels 8;
    ttable.0.4 1;
    ttable.1.5 1;
}

pcm.stereoD {
    # 6 - Side Right
    # 7 - Side Left
    type route;
    slave.pcm "hw:1,0";
    slave.channels 8;
    ttable.0.7 1;
    ttable.1.6 1;
}

The problem now is that this only works for stereoA. For the other outputs, the audio remains silent when being used through Shairport Sync.

However, it works fine when being tested with speaker-test:

speaker-test -D stereoB -c 2

speaker-test 1.2.6

Playback device is stereoB
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 12 to 96000
Period size range from 6 to 48000
Using max buffer size 96000
Periods = 4
was set period_size = 24000
was set buffer_size = 96000
 1 - Front Center
 0 - LFE

I can here the test noise being played on the correct outputs.

Shairport Sync actually also accepts the audio stream when being told to use stereoB as its output_device and looks as if it’s playing (also the audio device is busy when I try to play something else). So my guess it’s that it’s playing on the wrong channels.

How can I fix the channel mapping so that the stereo pairs actually behave like real stereo pairs and are named Front Left and Front Right?

5
  • If that's a true 7.1 system, you can't split it quite this way. There's 7 main speakers + subwoofer. Right now your StereoB is configured to output the theater's front center channel and the subwoofer - this won't sound very nice on a pair of stereo speakers on another room. If you want stereo on a different room, you need to send front R/L channels there as well as your theater system - that's the closest you get to 2 channel stereo with this system. The rest of the channels are one way or another effected, as their purpose is to create the immersive sound of a movie theater. Mar 4, 2023 at 13:47
  • My understanding is that this is actually a 8 channel sound card and the 7.1 surround stuff is done in software. I could be wrong. But I’ll check how the output with the Center and the Sub sounds to make sure. To my initial question, I just found out that the config is actually working. I think when reconnecting to Shairport Sync, the volume was reduced and I didn’t notice.
    – aaronk6
    Mar 4, 2023 at 14:32
  • LOL, "is it plugged in" et co. are still valid questions :-D You're right, the 7.1 is done in Terratech Audio Center. Thx for this, looks like an interesting box. I remember Terratech from early 90s being much touted as The Soundcard Of Choice for Those In The Know, didn't even know they're still around :-) Mar 4, 2023 at 14:39
  • Well, I was ~6 in the early 90s, but I remember having a Terratec sound card in my first PC in the late 90s. The logo (which I believe they haven’t changed ever since) has some strong retro vibes for me!
    – aaronk6
    Mar 4, 2023 at 22:01
  • 1
    I was practically drooling after a Terratec card, having my first PC, making music with Trackers. Too expensive at the time for a youngster fresh outta the army, just old enuff to drink legally :-D Mar 4, 2023 at 22:05

1 Answer 1

1

I found out that my config is actually working perfectly fine. I just didn’t realize that macOS is resetting the volume slider to a fairly low volume when switching between AirPlay targets, which is why I hadn’t heard the audio when testing the different outputs.

What I learned along the way is that you can slightly streamline the config by defining a pcm_slave section and referencing it in the pcm sections.

So I’m leaving my updated config here in case anybody finds it useful:

pcm_slave.outs {
    pcm "hw:1,0";
    channels 8;
}

pcm.stereoA {
    type route;
    slave outs;
    ttable.0.0 1;
    ttable.1.1 1;
}

pcm.stereoB {
    type route;
    slave outs;
    ttable.0.3 1;
    ttable.1.2 1;
}

pcm.stereoC {
    type route;
    slave outs;
    ttable.0.4 1;
    ttable.1.5 1;
}

pcm.stereoD {
    type route;
    slave outs;
    ttable.0.6 1;
    ttable.1.7 1;
}
2
  • Upvoted. Next time maybe put the OS in the question :-) Mar 6, 2023 at 13:59
  • Thanks :-) I just added it!
    – aaronk6
    Mar 7, 2023 at 14:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .