All of lore.kernel.org
 help / color / mirror / Atom feed
* Two codecs using the same I2S bus
@ 2009-12-11 12:29 Niels Langendorff
  2009-12-12 18:05 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Niels Langendorff @ 2009-12-11 12:29 UTC (permalink / raw)
  To: alsa-devel

Hi,

for a samsung based project we have chosen two codecs, one for input, 
the other for output. The two codecs are using the same I2S bus due to 
audio requirements (HF audio in combination with EC)

When having two machine implementations at the same time for the two 
codecs we will run into problems attaching to the I2S bus. A solution is 
to combine the machine implementation into one file, but then I probaly 
have to modify generic kernel code.

I there some solution for this and/or example code

Thanks in advance,


Niels Langendorff

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

* Re: Two codecs using the same I2S bus
  2009-12-11 12:29 Two codecs using the same I2S bus Niels Langendorff
@ 2009-12-12 18:05 ` Mark Brown
  2009-12-12 18:06   ` Mark Brown
  2009-12-12 19:54   ` Niels Langendorff
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Brown @ 2009-12-12 18:05 UTC (permalink / raw)
  To: Niels Langendorff; +Cc: alsa-devel

On Fri, Dec 11, 2009 at 01:29:07PM +0100, Niels Langendorff wrote:

> for a samsung based project we have chosen two codecs, one for input, 
> the other for output. The two codecs are using the same I2S bus due to 
> audio requirements (HF audio in combination with EC)

> When having two machine implementations at the same time for the two 
> codecs we will run into problems attaching to the I2S bus. A solution is 
> to combine the machine implementation into one file, but then I probaly 
> have to modify generic kernel code.

> I there some solution for this and/or example code

This should work with the kernel as-is providing the two CODECs don't
both need register control, just declare DAI links for each of the links
you need from your machine driver.  Nothing will stop you adding one DAI
to multiple links.  You'll need to deal with resource contention issues
in your machine driver but it should have enough hooks already to
support that, or you can just arrange for your application to never try
to do anything unsupported.

If you run into problems doing this please bring them up on the list.

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

* Re: Two codecs using the same I2S bus
  2009-12-12 18:05 ` Mark Brown
@ 2009-12-12 18:06   ` Mark Brown
  2009-12-12 19:54   ` Niels Langendorff
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2009-12-12 18:06 UTC (permalink / raw)
  To: Niels Langendorff; +Cc: alsa-devel

On Sat, Dec 12, 2009 at 06:05:22PM +0000, Mark Brown wrote:
> On Fri, Dec 11, 2009 at 01:29:07PM +0100, Niels Langendorff wrote:

> > I there some solution for this and/or example code
> 
> This should work with the kernel as-is providing the two CODECs don't

Oh, and the OMAP-based Pandora board is an example of doing this.

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

* Re: Two codecs using the same I2S bus
  2009-12-12 18:05 ` Mark Brown
  2009-12-12 18:06   ` Mark Brown
@ 2009-12-12 19:54   ` Niels Langendorff
  2009-12-14 10:33     ` Mark Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Niels Langendorff @ 2009-12-12 19:54 UTC (permalink / raw)
  To: Mark Brown; +Cc: alsa-devel

Hi Mark,

thanks for your response. My comments are in between.

Op 12 dec 2009, om 19:05 heeft Mark Brown het volgende geschreven:

> On Fri, Dec 11, 2009 at 01:29:07PM +0100, Niels Langendorff wrote:
> 
>> for a samsung based project we have chosen two codecs, one for input, 
>> the other for output. The two codecs are using the same I2S bus due to 
>> audio requirements (HF audio in combination with EC)
> 
>> When having two machine implementations at the same time for the two 
>> codecs we will run into problems attaching to the I2S bus. A solution is 
>> to combine the machine implementation into one file, but then I probaly 
>> have to modify generic kernel code.
> 
>> I there some solution for this and/or example code
> 
> This should work with the kernel as-is providing the two CODECs don't
> both need register control, just declare DAI links for each of the links
> you need from your machine driver.  
Both the codecs needs to be reconfigured by writing the registers for every playback/recording, so that is the difficulty.
I will have a look at the OMAP implementation as a good example.

> Nothing will stop you adding one DAI
> to multiple links.  You'll need to deal with resource contention issues
> in your machine driver but it should have enough hooks already to
> support that, or you can just arrange for your application to never try
> to do anything unsupported.
> 
> If you run into problems doing this please bring them up on the list.

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

* Re: Two codecs using the same I2S bus
  2009-12-12 19:54   ` Niels Langendorff
@ 2009-12-14 10:33     ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2009-12-14 10:33 UTC (permalink / raw)
  To: Niels Langendorff; +Cc: alsa-devel

On Sat, Dec 12, 2009 at 08:54:04PM +0100, Niels Langendorff wrote:
> Op 12 dec 2009, om 19:05 heeft Mark Brown het volgende geschreven:
> > On Fri, Dec 11, 2009 at 01:29:07PM +0100, Niels Langendorff wrote:

> > This should work with the kernel as-is providing the two CODECs don't
> > both need register control, just declare DAI links for each of the links
> > you need from your machine driver.  

> Both the codecs needs to be reconfigured by writing the registers for
> every playback/recording, so that is the difficulty.

I see.  The difficulty with more than one register based device is
somewhat orthogonal to the DAIs.  The current approach to such systems
is to have a driver for one of the devices which provides functions
which can be called from the machine drivers - the MAX9877 and TPA6130A2
in mainline are examples.  This doesn't scale so well, though it is
workable for the time being if the devices aren't too complex.

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

end of thread, other threads:[~2009-12-14 10:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-11 12:29 Two codecs using the same I2S bus Niels Langendorff
2009-12-12 18:05 ` Mark Brown
2009-12-12 18:06   ` Mark Brown
2009-12-12 19:54   ` Niels Langendorff
2009-12-14 10:33     ` 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.