All of lore.kernel.org
 help / color / mirror / Atom feed
* Split a 7.1 device into 4 stereo devices
@ 2014-07-08 15:18 Xavier Claessens
  2014-07-08 18:26 ` Anssi Hannula
  2014-07-09 15:32 ` Raymond Yau
  0 siblings, 2 replies; 3+ messages in thread
From: Xavier Claessens @ 2014-07-08 15:18 UTC (permalink / raw)
  To: alsa-devel


Hello,

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

Regards,
Xavier Claessens.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Split a 7.1 device into 4 stereo devices
  2014-07-08 15:18 Split a 7.1 device into 4 stereo devices Xavier Claessens
@ 2014-07-08 18:26 ` Anssi Hannula
  2014-07-09 15:32 ` Raymond Yau
  1 sibling, 0 replies; 3+ messages in thread
From: Anssi Hannula @ 2014-07-08 18:26 UTC (permalink / raw)
  To: Xavier Claessens, alsa-devel

08.07.2014 18:18, Xavier Claessens kirjoitti:
> 
> Hello,
> 
> 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

I guess this really belongs on alsa-user@ list, but oh well...

No idea about hdajackretask, but you can use e.g. "dshare" plugin.

Simple example below with 6ch split to three stereo devices, see
documentation/Google for more information on options. You don't see the
result in "aplay -l" but in "aplay -L".


pcm_slave.shared_dev {
        pcm "hw:CARD=PCH,DEV=7"
        channels 6
        rate 48000
}

pcm.kas {
        type dshare
        ipc_key 119922141
        slave shared_dev
        bindings {
                0 0
                1 1
        }
        hint.description "Channels 0 and 1"
}

pcm.mo {
        type dshare
        ipc_key 119922141
        slave shared_dev
        bindings {
                0 2
                1 3
        }
        hint.description "Channels 2 and 3"
}

pcm.foobar {
        type dshare
        ipc_key 119922141
        slave shared_dev
        bindings {
                0 4
                1 5
        }
        hint.description "Channels 4 and 5"
}


-- 
Anssi Hannula

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Split a 7.1 device into 4 stereo devices
  2014-07-08 15:18 Split a 7.1 device into 4 stereo devices Xavier Claessens
  2014-07-08 18:26 ` Anssi Hannula
@ 2014-07-09 15:32 ` Raymond Yau
  1 sibling, 0 replies; 3+ messages in thread
From: Raymond Yau @ 2014-07-09 15:32 UTC (permalink / raw)
  To: Xavier Claessens; +Cc: alsa-devel

>
> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-07-09 15:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-08 15:18 Split a 7.1 device into 4 stereo devices Xavier Claessens
2014-07-08 18:26 ` Anssi Hannula
2014-07-09 15:32 ` Raymond Yau

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.