[alsa-devel] ASoC: pxa2xx-ssp
Hi!
What is needed for [0] to be accepted on mainline linux?
[0]http://opensource.wolfsonmicro.com/cgi-bin/gitweb.cgi?p=linux-2.6-asoc.git;a...
On Thu, 2008-10-23 at 22:54 -0200, Daniel Ribeiro wrote:
Hi!
What is needed for [0] to be accepted on mainline linux?
[0]http://opensource.wolfsonmicro.com/cgi-bin/gitweb.cgi?p=linux-2.6-asoc.git;a...
When I last worked on this it was in need of updates for SSP register IO, clk API and more testing. It has the IO and clk stuff now.
Does this code work well on your platform/board ?
If so, I guess we could scratch off the more testing part and consider it for the next merge window. Iirc it was also waiting on some pxa dependencies going upstream, so it may wait a little longer.
I'm sure it's on Mark's long todo list....
Liam
On Fri, Oct 24, 2008 at 04:54:38PM +0100, Liam Girdwood wrote:
If so, I guess we could scratch off the more testing part and consider it for the next merge window. Iirc it was also waiting on some pxa dependencies going upstream, so it may wait a little longer.
Yes, the only reason it's not been submitted yet is the cross tree merging with ARM. The last of that stuff should have gone in in the current merge window - it should have gone in for .27 but rmk bumped out a bunch of things at the last minute.
I'm not too worried about the testing since it's not currently in mainline so there won't be any regressions from it, though obviously any testing is good.
I'm sure it's on Mark's long todo list....
Yeah, I was going to look at it sometime next week hopefully since -rc1 is out now.
Em Sex, 2008-10-24 às 16:54 +0100, Liam Girdwood escreveu:
On Thu, 2008-10-23 at 22:54 -0200, Daniel Ribeiro wrote:
Hi!
What is needed for [0] to be accepted on mainline linux?
[0]http://opensource.wolfsonmicro.com/cgi-bin/gitweb.cgi?p=linux-2.6-asoc.git;a...
When I last worked on this it was in need of updates for SSP register IO, clk API and more testing. It has the IO and clk stuff now.
Does this code work well on your platform/board ?
Not as it is.
My sound codec needs 32bit ssp frames, even considering that it only supports 16bit mono/stereo audio. I guess that it works with I2S emulation mode, which pxa2xx-ssp.c dont support yet.
After some time trying to understand the very poorly documented I2S/SSP emulation on the pxa manual, i ended up with [1]. It works perfectly on my board, with SND_SOC_DAIFMT_MSB.
To ease your reading, attached is a diff against [0]. It is updated to build on the latest linus tree and handles DAIFMT_I2S and DAIFMT_MSB differently.
If so, I guess we could scratch off the more testing part and consider it for the next merge window. Iirc it was also waiting on some pxa dependencies going upstream, so it may wait a little longer.
I'm sure it's on Mark's long todo list....
Liam
[1]http://git.openezx.org/?p=openezx.git;a=blob;f=sound/soc/pxa/pxa2xx-ssp.c;h=...
On Sat, Oct 25, 2008 at 03:32:47AM -0200, Daniel Ribeiro wrote:
To ease your reading, attached is a diff against [0]. It is updated to build on the latest linus tree and handles DAIFMT_I2S and DAIFMT_MSB differently.
Please work against the pxa-ssp driver, not the pxa2xx-ssp driver. There are no plans to merge the pxa2xx-ssp driver - the pxa-ssp should be able to cover everything, perhaps with a couple of functions selected per-CPU, but it's not been tested on pxa2xx yet. It should hopefully be making its way upstream today or tomorrow.
Em Seg, 2008-10-27 às 12:47 +0000, Mark Brown escreveu:
On Sat, Oct 25, 2008 at 03:32:47AM -0200, Daniel Ribeiro wrote:
To ease your reading, attached is a diff against [0]. It is updated to build on the latest linus tree and handles DAIFMT_I2S and DAIFMT_MSB differently.
Please work against the pxa-ssp driver, not the pxa2xx-ssp driver. There are no plans to merge the pxa2xx-ssp driver - the pxa-ssp should be able to cover everything, perhaps with a couple of functions selected per-CPU, but it's not been tested on pxa2xx yet. It should hopefully be making its way upstream today or tomorrow.
Ok, i will rebase my work on pxa-ssp.c. But a first look shows that pxa_ssp_hw_params sets the ssp frame size depending on the audio stream format even for I2S mode. I think it will not work, as I2S needs to stick to 32bit frame size. Is there anybody using SND_SOC_DAIFMT_I2S with this driver? I will send you a patch later today. Thanks for the reply! :)
On Mon, Oct 27, 2008 at 11:19:34AM -0200, Daniel Ribeiro wrote:
Ok, i will rebase my work on pxa-ssp.c. But a first look shows that pxa_ssp_hw_params sets the ssp frame size depending on the audio stream format even for I2S mode. I think it will not work, as I2S needs to stick to 32bit frame size.
That's not a general requirement of I2S - many devices are OK with scaling the number of bit clocks with the data.
Is there anybody using SND_SOC_DAIFMT_I2S with this driver?
I'd go so far as to say that most of the testing has been in I2S mode. Other modes have been tested but most of the usage is with I2S.
I suspect that what you need to do here to interoperate well with your codec is to set things up to use TDM so that the extra clocks are generated by what the CPU believes are idle TDM slots.
I will send you a patch later today. Thanks for the reply! :)
When submitting patches please do try to submit separate patches for separate logical changes - for example, your previous patch mixed in changes for recent PXA APIs with changes in the behaviour of the code.
Em Seg, 2008-10-27 às 13:44 +0000, Mark Brown escreveu:
On Mon, Oct 27, 2008 at 11:19:34AM -0200, Daniel Ribeiro wrote:
Ok, i will rebase my work on pxa-ssp.c. But a first look shows that pxa_ssp_hw_params sets the ssp frame size depending on the audio stream format even for I2S mode. I think it will not work, as I2S needs to stick to 32bit frame size.
That's not a general requirement of I2S - many devices are OK with scaling the number of bit clocks with the data.
Is there anybody using SND_SOC_DAIFMT_I2S with this driver?
I'd go so far as to say that most of the testing has been in I2S mode. Other modes have been tested but most of the usage is with I2S.
I suspect that what you need to do here to interoperate well with your codec is to set things up to use TDM so that the extra clocks are generated by what the CPU believes are idle TDM slots.
Im trying to setup as you said.
I get correct audio if use one tdm_slot and mono audio, but i couldnt get stereo audio working correctly without changing the ssp frame size.
Here are my test results for stereo S16_LE audio:
set_tdm_slot(cpu_dai, 1, 2), SSCR0_Datasize(16): Only left channel works.
set_tdm_slot(cpu_dai, 2, 2), SSCR0_Datasize(16): No I/O.
set_tdm_slot(cpu_dai, 3, 2), SSCR0_Datasize(16): Only left channel works.
set_tdm_slot(cpu_dai, 1, 1), SSCR0_Datasize(16) | SSCR0_EDSS: Both channels work.
What could be wrong? Can you suggest me how to setup the tdm slots so i can get both channels? On my board CLK and FRM are driven by the codec, pxa is slave. I have no specs for the codec, only a 2.4 kernel driver that works with (SSCR0_Datasize(16) | SSCR0_EDSS | SSCR0_SlotsPerFrm(1)).
I will send you a patch later today. Thanks for the reply! :)
When submitting patches please do try to submit separate patches for separate logical changes - for example, your previous patch mixed in changes for recent PXA APIs with changes in the behaviour of the code.
That was not a patch submission. :)
On Thu, Oct 30, 2008 at 09:40:17AM -0200, Daniel Ribeiro wrote:
Here are my test results for stereo S16_LE audio:
set_tdm_slot(cpu_dai, 1, 2), SSCR0_Datasize(16): Only left channel works.
set_tdm_slot(cpu_dai, 2, 2), SSCR0_Datasize(16): No I/O.
Could you expand on what you mean by "No I/O" here - do you get silent output or does DMA not work either?
set_tdm_slot(cpu_dai, 3, 2), SSCR0_Datasize(16): Only left channel works.
set_tdm_slot(cpu_dai, 1, 1), SSCR0_Datasize(16) | SSCR0_EDSS: Both channels work.
Just a thought, but you should also be able to get things working by adding a constraint on the format in your machine driver to force use of 32 bit - see things like the WM8903 driver for examples of how to this. Ideally that shouldn't be required, though.
On my board CLK and FRM are driven by the codec, pxa is slave. I have no specs for the codec, only a 2.4 kernel driver that works with (SSCR0_Datasize(16) | SSCR0_EDSS | SSCR0_SlotsPerFrm(1)).
Which codec is this? Could you post the driver?
BTW, your mail client is doing some really strange indentation here and indenting the first line of each paragraph by a tab which looks like how some other clients do quotation.
Em Qui, 2008-10-30 às 12:06 +0000, Mark Brown escreveu:
On Thu, Oct 30, 2008 at 09:40:17AM -0200, Daniel Ribeiro wrote:
Here are my test results for stereo S16_LE audio:
set_tdm_slot(cpu_dai, 1, 2), SSCR0_Datasize(16): Only left channel works.
+ Silent output on right channel.
set_tdm_slot(cpu_dai, 2, 2), SSCR0_Datasize(16): No I/O.
Could you expand on what you mean by "No I/O" here - do you get silent output or does DMA not work either?
DMA dont work.
set_tdm_slot(cpu_dai, 3, 2), SSCR0_Datasize(16): Only left channel works.
+ Silent output on right channel.
set_tdm_slot(cpu_dai, 1, 1), SSCR0_Datasize(16) | SSCR0_EDSS: Both channels work.
Just a thought, but you should also be able to get things working by adding a constraint on the format in your machine driver to force use of 32 bit - see things like the WM8903 driver for examples of how to this. Ideally that shouldn't be required, though.
I havent tried this yet, but if I set the codec driver to S32_LE shouldnt it change the audio data format? According to the information I have on this codec it only works with 16 bits audio format.
On my board CLK and FRM are driven by the codec, pxa is slave. I have no specs for the codec, only a 2.4 kernel driver that works with (SSCR0_Datasize(16) | SSCR0_EDSS | SSCR0_SlotsPerFrm(1)).
Which codec is this? Could you post the driver?
Its a motorola ASIC called PCAP2, it does a lot more than sound, and is used on almost all Motorola phones (including WinCE and P2K phones) from 2004~2007.
http://git.openezx.org/?p=openezx.git;a=blob;f=sound/soc/codecs/pcap2.c;h=d5...
BTW, your mail client is doing some really strange indentation here and indenting the first line of each paragraph by a tab which looks like how some other clients do quotation.
Sorry, im used to indent each paragraph with a tab, its not my mail client, its me. :)
participants (3)
-
Daniel Ribeiro
-
Liam Girdwood
-
Mark Brown