[alsa-devel] ASoC: How to mix multi input ?
Hi Mark, ALSA SoC
I would like to ask you how to mix multi input in ASoC. Renesas sound device(s) can mix multi input to 1 output.
+-+ sound A --> |M| sound B --> |I| --> [ codec ] -> speaker sound C --> |X| +-+
Here, sound A/B/C will be used randomly. Does ALSA SoC already has this kind of system ?
My image about these are like this.
sound A: aplay -D hw:0 ... sound B: aplay -D hw:1 ... sound C: aplay -D hw:2 ... ...
codec will be started if one of A/B/C are started, and it will be stopped if all of A/B/C are stopped.
On Wed, May 20, 2015 at 05:20:06AM +0000, Kuninori Morimoto wrote:
I would like to ask you how to mix multi input in ASoC. Renesas sound device(s) can mix multi input to 1 output.
You mean in DPCM rather than a plain CODEC?
Here, sound A/B/C will be used randomly. Does ALSA SoC already has this kind of system ?
I *think* at least the Intel systems do this already.
My image about these are like this.
sound A: aplay -D hw:0 ... sound B: aplay -D hw:1 ... sound C: aplay -D hw:2 ... ...
codec will be started if one of A/B/C are started, and it will be stopped if all of A/B/C are stopped.
If you connect multiple front ends to one back end this should work (with DAPM routes and so on). If it doesn't work then that's something that should work.
Hi Mark
Thank you for your reply
Here, sound A/B/C will be used randomly. Does ALSA SoC already has this kind of system ?
I *think* at least the Intel systems do this already.
Thank you. I will check it.
I would like to ask you how to mix multi input in ASoC. Renesas sound device(s) can mix multi input to 1 output.
You mean in DPCM rather than a plain CODEC?
(snip)
codec will be started if one of A/B/C are started, and it will be stopped if all of A/B/C are stopped.
If you connect multiple front ends to one back end this should work (with DAPM routes and so on). If it doesn't work then that's something that should work.
I considered about DPCM, but *maybe* this is not goot match for us. If my understanding is correct, and if I used DPCM for this, all of sound A/B/C are start/stop:ed in same time ?
ex) start sound => start A/B/C and codec stop sound => stop A/B/C and codec
I guess it works if it has this connection
data -> [A] -> [B] -> [C] -> codec
We would like to do is like this
+-+ dataA -> [A] -> |M| dataB -> [B] -> |I| -> codec dataC -> [C] -> |X| +-+
init => working: start sound A => working: codec + A start sound B => working: codec + A/B (mixed) stop sound A => working: codec + B start sound C => working: codec + B/C (mixed) stop sound B => working: codec + C stop sound C => working:
I guess current DPCM doesn't support this ?
On Thu, May 21, 2015 at 12:20:06AM +0000, Kuninori Morimoto wrote:
codec will be started if one of A/B/C are started, and it will be stopped if all of A/B/C are stopped.
If you connect multiple front ends to one back end this should work (with DAPM routes and so on). If it doesn't work then that's something that should work.
I considered about DPCM, but *maybe* this is not goot match for us. If my understanding is correct, and if I used DPCM for this, all of sound A/B/C are start/stop:ed in same time ?
ex) start sound => start A/B/C and codec stop sound => stop A/B/C and codec
I guess it works if it has this connection
data -> [A] -> [B] -> [C] -> codec
We would like to do is like this
+-+
dataA -> [A] -> |M| dataB -> [B] -> |I| -> codec dataC -> [C] -> |X| +-+
init => working: start sound A => working: codec + A start sound B => working: codec + A/B (mixed) stop sound A => working: codec + B start sound C => working: codec + B/C (mixed) stop sound B => working: codec + C stop sound C => working:
I guess current DPCM doesn't support this ?
What you're describing is what I'd expect to happen - I'd say if that's not working it's a bug and we should fix it.
Hi Mark
init => working: start sound A => working: codec + A start sound B => working: codec + A/B (mixed) stop sound A => working: codec + B start sound C => working: codec + B/C (mixed) stop sound B => working: codec + C stop sound C => working:
I guess current DPCM doesn't support this ?
What you're describing is what I'd expect to happen - I'd say if that's not working it's a bug and we should fix it.
Thank you. I didn't know this. I will check it
On Fri, 2015-05-22 at 00:01 +0000, Kuninori Morimoto wrote:
Hi Mark
init => working: start sound A => working: codec + A start sound B => working: codec + A/B (mixed) stop sound A => working: codec + B start sound C => working: codec + B/C (mixed) stop sound B => working: codec + C stop sound C => working:
I guess current DPCM doesn't support this ?
What you're describing is what I'd expect to happen - I'd say if that's not working it's a bug and we should fix it.
Thank you. I didn't know this. I will check it
DPCM should work with all the above. It worked on OMAP4 ABE when I last checked OMAP4 over 2 years ago.
Liam
On Fri, May 22, 2015 at 06:59:31PM +0100, Liam Girdwood wrote:
On Fri, 2015-05-22 at 00:01 +0000, Kuninori Morimoto wrote:
init => working: start sound A => working: codec + A start sound B => working: codec + A/B (mixed) stop sound A => working: codec + B start sound C => working: codec + B/C (mixed) stop sound B => working: codec + C stop sound C => working:
DPCM should work with all the above. It worked on OMAP4 ABE when I last checked OMAP4 over 2 years ago.
Yeah, I was pretty sure people had been doing that already and I didn't see anything that might have changed it.
On Thu, May 21, 2015 at 12:20:06AM +0000, Kuninori Morimoto wrote:
Hi Mark
Thank you for your reply
Here, sound A/B/C will be used randomly. Does ALSA SoC already has this kind of system ?
I *think* at least the Intel systems do this already.
Thank you. I will check it.
I would like to ask you how to mix multi input in ASoC. Renesas sound device(s) can mix multi input to 1 output.
You mean in DPCM rather than a plain CODEC?
(snip)
codec will be started if one of A/B/C are started, and it will be stopped if all of A/B/C are stopped.
If you connect multiple front ends to one back end this should work (with DAPM routes and so on). If it doesn't work then that's something that should work.
I considered about DPCM, but *maybe* this is not goot match for us. If my understanding is correct, and if I used DPCM for this, all of sound A/B/C are start/stop:ed in same time ?
ex) start sound => start A/B/C and codec stop sound => stop A/B/C and codec
I guess it works if it has this connection
data -> [A] -> [B] -> [C] -> codec
We would like to do is like this
+-+
dataA -> [A] -> |M| dataB -> [B] -> |I| -> codec dataC -> [C] -> |X| +-+
init => working: start sound A => working: codec + A start sound B => working: codec + A/B (mixed) stop sound A => working: codec + B start sound C => working: codec + B/C (mixed) stop sound B => working: codec + C stop sound C => working:
I guess current DPCM doesn't support this ?
it does, you have to declare A, B, C as FE then introduce a digital mixer (real or virtual, depending on the system) and the a BE which is your HW DAI here and connects to codec
This works very well and you can start/stop A, B, C independently. Codec will be on as along as any of the inputs is On.
See the sound/soc/intel/atom for reference
Hi Vinod
init => working: start sound A => working: codec + A start sound B => working: codec + A/B (mixed) stop sound A => working: codec + B start sound C => working: codec + B/C (mixed) stop sound B => working: codec + C stop sound C => working:
I guess current DPCM doesn't support this ?
it does, you have to declare A, B, C as FE then introduce a digital mixer (real or virtual, depending on the system) and the a BE which is your HW DAI here and connects to codec
This works very well and you can start/stop A, B, C independently. Codec will be on as along as any of the inputs is On.
See the sound/soc/intel/atom for reference
Thank you ! I will check it
participants (4)
-
Kuninori Morimoto
-
Liam Girdwood
-
Mark Brown
-
Vinod Koul