All of lore.kernel.org
 help / color / mirror / Atom feed
* Does ASoC support sound card with multiple interfaces?
@ 2012-01-02 15:06 Ashish Chavan
  2012-01-02 20:16 ` Mark Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Ashish Chavan @ 2012-01-02 15:06 UTC (permalink / raw)
  To: alsa-devel

Hi,
  I have a codec with multiple TX and RX channels. In ASoC tree, I have
seen examples where these kind of codecs are implemented as multichannel
codecs. Instead I want it to be treated as card with multiple
interfaces, e.g. Instead of one interface with eight TX channels, I need
it to behave it as card with four stereo playback interfaces. The
primary aim for doing this is that multiple applications should be able
to play/record simultaneously. AFAIK, In case of a multichannel card, if
it is opened by one application for stereo playback, there is no way to
use rest of the unused channels by other applications.

Is it easily possible to achieve what I am trying to? Any pointers to
example driver source will greatly help!

BTW all three i.e., platform, machine as well as codec driver are to be
implemented. I am aware of the fact that this requirement may affect all
three.


Thanks in advance,

-- Ashish
|| GNU FAN ||

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

* Re: Does ASoC support sound card with multiple interfaces?
  2012-01-02 15:06 Does ASoC support sound card with multiple interfaces? Ashish Chavan
@ 2012-01-02 20:16 ` Mark Brown
  2012-01-04  5:36   ` Ashish Chavan
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Brown @ 2012-01-02 20:16 UTC (permalink / raw)
  To: Ashish Chavan; +Cc: alsa-devel

On Mon, Jan 02, 2012 at 08:36:13PM +0530, Ashish Chavan wrote:

Always CC maintainers!

>   I have a codec with multiple TX and RX channels. In ASoC tree, I have
> seen examples where these kind of codecs are implemented as multichannel
> codecs. Instead I want it to be treated as card with multiple

Yes, this is totally supported.  There are quite a few examples of this
in the tree.  Your CODEC driver should just implement one DAI per audio
interface.

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

* Re: Does ASoC support sound card with multiple interfaces?
  2012-01-02 20:16 ` Mark Brown
@ 2012-01-04  5:36   ` Ashish Chavan
  2012-01-04  5:47     ` Rajeev kumar
  0 siblings, 1 reply; 7+ messages in thread
From: Ashish Chavan @ 2012-01-04  5:36 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel, ; Liam Girdwood

> >   I have a codec with multiple TX and RX channels. In ASoC tree, I have
> > seen examples where these kind of codecs are implemented as multichannel
> > codecs. Instead I want it to be treated as card with multiple
> 
> Yes, this is totally supported.  There are quite a few examples of this
> in the tree.  Your CODEC driver should just implement one DAI per audio
> interface.
> 

Thanks.

I am looking at some of the examples in the tree and have a small query.
I want to know how alsa-utils (aplay, arecord) will behave when a codec
driver supports multiple DAIs. For example, let's assume that a codec
driver implements two DAIs, both capable of doing stereo playback. Then
I try to play two files simultaneously using aplay, e.g.

$ aplay x.wav
$ aplay y.wav

AFAIK first "aplay" will result in play back on default interface/DAI
(i.e. 0). What will happen with second aplay? Will it automatically find
a free DAI to playback? or it is mandatory to explicitly specify the
PCM/card # for second aplay?

Similarly what will happen in case of arecord when a codec supports
multiple DAIs capable of capturing?

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

* Re: Does ASoC support sound card with multiple interfaces?
  2012-01-04  5:36   ` Ashish Chavan
@ 2012-01-04  5:47     ` Rajeev kumar
  2012-01-04  7:00       ` Ashish Chavan
  0 siblings, 1 reply; 7+ messages in thread
From: Rajeev kumar @ 2012-01-04  5:47 UTC (permalink / raw)
  To: Ashish Chavan; +Cc: alsa-devel, Mark Brown, ; Liam Girdwood

Hello Ashish

On 1/4/2012 11:06 AM, Ashish Chavan wrote:
>>>    I have a codec with multiple TX and RX channels. In ASoC tree, I have
>>> seen examples where these kind of codecs are implemented as multichannel
>>> codecs. Instead I want it to be treated as card with multiple
>>
>> Yes, this is totally supported.  There are quite a few examples of this
>> in the tree.  Your CODEC driver should just implement one DAI per audio
>> interface.
>>
>
> Thanks.
>
> I am looking at some of the examples in the tree and have a small query.
> I want to know how alsa-utils (aplay, arecord) will behave when a codec
> driver supports multiple DAIs. For example, let's assume that a codec
> driver implements two DAIs, both capable of doing stereo playback. Then
> I try to play two files simultaneously using aplay, e.g.
>
> $ aplay x.wav
> $ aplay y.wav
>
> AFAIK first "aplay" will result in play back on default interface/DAI
> (i.e. 0). What will happen with second aplay? Will it automatically find
> a free DAI to playback?

No,

  or it is mandatory to explicitly specify the
> PCM/card # for second aplay?
>

You need to redirect it . You can use

aplay -Dplughw:0,1 x.wav.

Here '0' indicated card number and '1' indicates device number

~Regards
Rajeev


> Similarly what will happen in case of arecord when a codec supports
> multiple DAIs capable of capturing?
>
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>

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

* Re: Does ASoC support sound card with multiple interfaces?
  2012-01-04  5:47     ` Rajeev kumar
@ 2012-01-04  7:00       ` Ashish Chavan
  2012-01-04  7:03         ` Rajeev kumar
  2012-01-05  6:02         ` Mark Brown
  0 siblings, 2 replies; 7+ messages in thread
From: Ashish Chavan @ 2012-01-04  7:00 UTC (permalink / raw)
  To: Rajeev kumar; +Cc: alsa-devel, Mark Brown, ; Liam Girdwood


> You need to redirect it . You can use
> 
> aplay -Dplughw:0,1 x.wav.
> 
> Here '0' indicated card number and '1' indicates device number

Is it really mandatory to specify card and device id? Isn't there a
middle layer that takes care of using "first free" interface for
playback or recording, if interface is not explicitly specified? As we
register DAIs with ALSA subsystem, it should be fairly easy for alsa-lib
to find out "first free" interface.

I am aware that this wouldn't be practically useful in most cases,
because generally we know beforehand which specific interface to be used
for playback/recording. In such cases, automatic selection of interface
may be confusing to users. But I just want to confirm if this is at all
possible?

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

* Re: Does ASoC support sound card with multiple interfaces?
  2012-01-04  7:00       ` Ashish Chavan
@ 2012-01-04  7:03         ` Rajeev kumar
  2012-01-05  6:02         ` Mark Brown
  1 sibling, 0 replies; 7+ messages in thread
From: Rajeev kumar @ 2012-01-04  7:03 UTC (permalink / raw)
  To: Ashish Chavan; +Cc: alsa-devel, Mark Brown, ; Liam Girdwood

On 1/4/2012 12:30 PM, Ashish Chavan wrote:
>
>> You need to redirect it . You can use
>>
>> aplay -Dplughw:0,1 x.wav.
>>
>> Here '0' indicated card number and '1' indicates device number
>
> Is it really mandatory to specify card and device id? Isn't there a
> middle layer that takes care of using "first free" interface for
> playback or recording, if interface is not explicitly specified? As we
> register DAIs with ALSA subsystem, it should be fairly easy for alsa-lib
> to find out "first free" interface.
>
> I am aware that this wouldn't be practically useful in most cases,
> because generally we know beforehand which specific interface to be used
> for playback/recording. In such cases, automatic selection of interface
> may be confusing to users. But I just want to confirm if this is at all
> possible?
>
>

AFAIK, automatic selection is not there

~Rajeev

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

* Re: Does ASoC support sound card with multiple interfaces?
  2012-01-04  7:00       ` Ashish Chavan
  2012-01-04  7:03         ` Rajeev kumar
@ 2012-01-05  6:02         ` Mark Brown
  1 sibling, 0 replies; 7+ messages in thread
From: Mark Brown @ 2012-01-05  6:02 UTC (permalink / raw)
  To: Ashish Chavan; +Cc: alsa-devel, Rajeev kumar, ; Liam Girdwood

On Wed, Jan 04, 2012 at 12:30:01PM +0530, Ashish Chavan wrote:

> Is it really mandatory to specify card and device id? Isn't there a
> middle layer that takes care of using "first free" interface for
> playback or recording, if interface is not explicitly specified? As we
> register DAIs with ALSA subsystem, it should be fairly easy for alsa-lib
> to find out "first free" interface.

That's not implemented since genuinely identical interfaces should be
implemented by supporting multiple opens on a single device but those
essentailly don't exist in embedded hardware.  Pretty much all embedded
hardware with multiple routes out of the CPU has either distinct fixed
functions for the outputs or independant routing of them so they can't
reliably be used interchangibly.

You could implement it but it'd have to be a system specific option to
use it.

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

end of thread, other threads:[~2012-01-05  6:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-02 15:06 Does ASoC support sound card with multiple interfaces? Ashish Chavan
2012-01-02 20:16 ` Mark Brown
2012-01-04  5:36   ` Ashish Chavan
2012-01-04  5:47     ` Rajeev kumar
2012-01-04  7:00       ` Ashish Chavan
2012-01-04  7:03         ` Rajeev kumar
2012-01-05  6:02         ` Mark Brown

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.