Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[ALSA] Splitting a 7.1 sound card into 4 stereo devices.

Need help with peripherals or devices?
Post Reply
Message
Author
Paul Strefling
Posts: 20
Joined: 2009-08-13 13:50

[ALSA] Splitting a 7.1 sound card into 4 stereo devices.

#1 Post by Paul Strefling »

I have currently split up my on board 7.1 HDA-Intel soundcard into 4 stereo pcm devices. I managed this by creating a /etc/asound.conf file based on the following topic.
http://www.musicpd.org/forum/index.php? ... ic=1597.15

Here is asound.conf:

Code: Select all

cat /etc/asound.conf 
pcm_slave.eightchannels {
	pcm "hw:Intel"            # or "hw:1,0" for the second card
        channels 8
}
pcm.stereo1 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 2 3 ]
        }
}
pcm.stereo2 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 4 5 ]
        }
}
pcm.stereo3 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 6 7 ]
        }
}
pcm.stereo4 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 0 1 ]
        }
}

My reason for splitting my card into multiple devices is to use mpd for 4 different rooms in my house. stereo1,2 and 4 work fine. However, stereo3 does not. Notice in the above configuration stereo3 binds to [6 7], the last two channels on the card.

speaker test runs fine on the stereo1,2,4, for example:

Code: Select all

speaker-test -c 6 -D stereo1 -t wav

speaker-test 1.0.23

Playback device is stereo1
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 5440 to 5440
Period size range from 2720 to 2720
Using max buffer size 5440
Periods = 4
was set period_size = 2720
was set buffer_size = 5440
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 8.554363
speaker test on stereo 3 results in the following:

Code: Select all

speaker-test -c 6 -D stereo3 -t wav

speaker-test 1.0.23

Playback device is stereo3
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 5440 to 5440
Period size range from 2720 to 2720
Using max buffer size 5440
Periods = 4
was set period_size = 2720
was set buffer_size = 5440
 0 - Front Left
speaker-test: pcm_local.h:504: snd_pcm_channel_area_addr: Assertion `bitofs % 8 == 0' failed.
Aborted

if I update asound.conf as follows, changing [6 7] to [6]:

Code: Select all

pcm.stereo3 {
        type plug
        slave.pcm {
                type dshare
                ipc_key 87882222
                slave eightchannels
                bindings [ 6 ]
        }
}
Then the speaker test runs fine.

However, if I update asound.conf to [ 7 ] instead of [ 6 ] I get the following:

Code: Select all

speaker-test -c 6 -D stereo3 -t wav

speaker-test 1.0.23

Playback device is stereo3
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 5440 to 5440
Period size range from 2720 to 2720
Using max buffer size 5440
Periods = 4
was set period_size = 2720
was set buffer_size = 5440
 0 - Front Left
speaker-test: pcm_local.h:504: snd_pcm_channel_area_addr: Assertion `bitofs % 8 == 0' failed.
Aborted

At this point in time I considered that perhaps [ 7 ] does not reflect a channel, so I tried a bogus number, [ 8 ] and this was the result:

Code: Select all

speaker-test -c 6 -D stereo3 -t wav

speaker-test 1.0.23

Playback device is stereo3
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
ALSA lib pcm_direct.c:1402:(snd1_pcm_direct_parse_bindings) invalid slave channel number 8 in binding to 0
Playback open error: -22,Invalid argument
ALSA lib pcm_direct.c:1402:(snd1_pcm_direct_parse_bindings) invalid slave channel number 8 in binding to 0
Playback open error: -22,Invalid argument
ALSA lib pcm_direct.c:1402:(snd1_pcm_direct_parse_bindings) invalid slave channel number 8 in binding to 0
Playback open error: -22,Invalid argument
^C

Clearly [ 7 ] does point to something.

asound.conf is documented fairly well at http://alsa.opensrc.org/.asoundrc at I need a little more information. I am not sure where to begin, thus this post.

Thanks in advance.

Reed Young
Posts: 23
Joined: 2010-12-04 23:42

Re: [ALSA] Splitting a 7.1 sound card into 4 stereo devices.

#2 Post by Reed Young »

I'm pretty sure that all you'll do is wreck a speaker if you get your re-programming to "work" on the last channel, because the bass channel is physically different from the other 7. Even though it's unamplified, the output on the .1 channel of any x.1 setup is low-frequency only. And it's not due to processing, it's due to an LRC circuit called a bandpass filter which physically limits the output on that channel, to a low range usu. 60Hz-200Hz which you likely wouldn't hear until it tore the fabric of your speaker. No amount of programming will change the passive circuit elements on that channel or their effects on the electrical circuit.

Personally, I'd probably just get a y-splitter from Radio Shack because I tend to lose patience with projects of this kind when one thing doesn't go as expected, but if you're determined, I think you can get two audio cards to work at once, not easily, but with considerably less effort than it took to split 7.1 into 3. In fact, I have onboard 7.1 HDA-Intel and Sound Blaster Audigy blaring right now! Just compile both into the kernel, and then be prepared to un-mute one of them on startup (which one needs to be un-muted is unpredictable so far, but both work). Use alsamixer rather than the default Gnome volume controller, which failed to show that anything was muted, wasting a lot of my time plugging and un-plugging, when I should have just opened alsamixergui. I know it's not the solution you wanted, but I hope this helps.

Paul Strefling
Posts: 20
Joined: 2009-08-13 13:50

Re: [ALSA] Splitting a 7.1 sound card into 4 stereo devices.

#3 Post by Paul Strefling »

It might very well be that the x.1 channel is physically different. If that is the case then I suppose I will be putting a third sound card in the machine. However, I still want to figure out how to output to it; just to verify that it is not feasible.

Thanks for the reply.

drumlight
Posts: 1
Joined: 2012-02-23 22:15

Re: [ALSA] Splitting a 7.1 sound card into 4 stereo devices.

#4 Post by drumlight »

Aren't you running speaker test with just 6 channels? Try -c 8
ps I don't think the sub output is going to have a hardware LPF and you will be able to use it as a regular speaker output.

Jake

Damn I got the years wrong and this is an old post.

speedownsie
Posts: 1
Joined: 2014-09-05 11:04

Re: [ALSA] Splitting a 7.1 sound card into 4 stereo devices.

#5 Post by speedownsie »

Unmute the channels in alsamixer, by pressing 'm'.

Had the same on a SB0730.

Post Reply