[alsa-devel] Split a 7.1 device into 4 stereo devices

Raymond Yau superquad.vortex2 at gmail.com
Wed Jul 9 17:32:02 CEST 2014


>
> I have a 7.1 sound device and speaker-test -c8 can output on each
> speaker. But what I would like to do is using it as 4 stereo devices so
> I could play different sounds on each of them.
>
> Ideally I would like to avoid dmix and friends to be able to have
> gapless and bit-perfect output.
>
> On IRC "debianuser" said it is possible with hdajackretask to make it
> appear as 4 different hw devices in "aplay -l" but we didn't succeed
> doing that. Anyone knows what configuration is needed for that?
>
> Here is my setting:
> http://www.alsa-project.org/db/?f=bf0744873d5e6d42d3adc0076c5f66189e9191b7
>
The easy way is to use jackd and alsa jack plugin

If you really need  need four stereo devices, you need to customized
snd_hda multiout_analog_open, snd_hda multiout_analog_prepare and snd_hda
multiout_analog_cleanup similar to those  alt_analog_capture_xxx function
to use substream->number to provide four stereo devices

static const struct hda_pcm_stream pcm_analog_playback = {
.substreams = 4,
.channels_min = 2,
.channels_max = 2,
/* NID is set in build_pcms */
.ops = {
.open = playback_pcm_open,
.close = playback_pcm_close,
.prepare = playback_pcm_prepare,
.cleanup = playback_pcm_cleanup
},
};

Since only those four retaskable jacks support HP, you may need to use
input jacks if you want four headphones instead of four line out jackd


More information about the Alsa-devel mailing list