* overrun in case of record
@ 2011-09-06 9:34 Rajeev kumar
2011-09-06 18:01 ` Mark Brown
0 siblings, 1 reply; 16+ messages in thread
From: Rajeev kumar @ 2011-09-06 9:34 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel@alsa-project.org, rajeev-dlh.kumar,
lrg@slimlogic.co.uk
Hello Mark
I am testing my audio driver on spear platform.During recording I am
getting two issues.
1. Overrun issue
2. pcm_read error
I am using arecord for capturing data.
#arecord -f dat > t
overrun!!! (at least 32.949 ms long)
Overrun issue: The issue is only reproducible if we try to record for
more than 40 sec.The strange part is that Instead of overrun condition
generated,
it will record complete data for 10sec.(This is verified with the number
of bytes recorded).
So could you please let me know whether this is an error condition or
just a warning.
pcm_read error: For this I have seen a bug is locked in the
bugzila(*Bug 472469* <show_bug.cgi?id=472469> -arecord: input/output
error ). and the status is closed saying insufficient data.
Could you please let me know what is the meaning of this bug? Is it
like, data is not available in the buffer and pcm_read from the user
space fails? But why this situation will
arise?
Best Regards
Rajeev
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: overrun in case of record
2011-09-06 9:34 overrun in case of record Rajeev kumar
@ 2011-09-06 18:01 ` Mark Brown
2011-09-07 4:14 ` Rajeev kumar
0 siblings, 1 reply; 16+ messages in thread
From: Mark Brown @ 2011-09-06 18:01 UTC (permalink / raw)
To: Rajeev kumar; +Cc: alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
On Tue, Sep 06, 2011 at 03:04:44PM +0530, Rajeev kumar wrote:
> I am using arecord for capturing data.
> #arecord -f dat > t
> overrun!!! (at least 32.949 ms long)
>
> Overrun issue: The issue is only reproducible if we try to record
> for more than 40 sec.The strange part is that Instead of overrun
> condition generated,
> it will record complete data for 10sec.(This is verified with the
> number of bytes recorded).
> So could you please let me know whether this is an error condition
> or just a warning.
An overrun means that your driver is producing data faster than the
application is reading it and ran out of buffer space. This may mean
that you're running at the wrong sample rate, or it may mean that your
system is just too slow to do recordings.
> pcm_read error: For this I have seen a bug is locked in the
> bugzila(*Bug 472469* <show_bug.cgi?id=472469> -arecord: input/output
> error ). and the status is closed saying insufficient data.
> Could you please let me know what is the meaning of this bug? Is it
> like, data is not available in the buffer and pcm_read from the user
> space fails? But why this situation will
> arise?
You'll need to investigate the bug.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: overrun in case of record
2011-09-06 18:01 ` Mark Brown
@ 2011-09-07 4:14 ` Rajeev kumar
2011-09-07 8:35 ` Clemens Ladisch
2011-11-17 13:35 ` Exporting playback and capture capability to user space Rajeev kumar
0 siblings, 2 replies; 16+ messages in thread
From: Rajeev kumar @ 2011-09-07 4:14 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
Hello Mark
On 9/6/2011 11:31 PM, Mark Brown wrote:
>> pcm_read error: For this I have seen a bug is locked in the
>> > bugzila(*Bug 472469*<show_bug.cgi?id=472469> -arecord: input/output
>> > error ). and the status is closed saying insufficient data.
>> > Could you please let me know what is the meaning of this bug? Is it
>> > like, data is not available in the buffer and pcm_read from the user
>> > space fails? But why this situation will
>> > arise?
> You'll need to investigate the bug.
> .
>
I analyzed the bug and found that if I use arecord in non-blocking
mode, it works fine.
#arecord -f dat --nonblock > t
Working in a non-blocking mode means there is no data available in ring
buffer and returning -EAGAIN from the alsa, so application is
wating for data to arrive in the ring buffer. Now it is not clear to me
why this situation will arise?
I have checked the clock and all the clock are intact. The calculation
for number of bytes received in a sec is correct.
Best Regards
Rajeev
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: overrun in case of record
2011-09-07 4:14 ` Rajeev kumar
@ 2011-09-07 8:35 ` Clemens Ladisch
2011-11-17 13:35 ` Exporting playback and capture capability to user space Rajeev kumar
1 sibling, 0 replies; 16+ messages in thread
From: Clemens Ladisch @ 2011-09-07 8:35 UTC (permalink / raw)
To: Rajeev kumar; +Cc: alsa-devel@alsa-project.org, Mark Brown, lrg@slimlogic.co.uk
Rajeev kumar wrote:
> I analyzed the bug and found that if I use arecord in non-blocking
> mode, it works fine.
In theory, with a correct driver, using non-blocking mode should not
make any difference.
All the symptoms indicate that the pointer callback and/or the calling
of snd_pcm_period_elapsed is somehow wrong.
Regards,
Clemens
^ permalink raw reply [flat|nested] 16+ messages in thread
* Exporting playback and capture capability to user space
2011-09-07 4:14 ` Rajeev kumar
2011-09-07 8:35 ` Clemens Ladisch
@ 2011-11-17 13:35 ` Rajeev kumar
2011-11-17 15:19 ` Mark Brown
2011-11-21 5:49 ` Rajeev kumar
1 sibling, 2 replies; 16+ messages in thread
From: Rajeev kumar @ 2011-11-17 13:35 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
Hello Mark
I have a single codec with playback and capture capability. We are using
it for different i2s controller. Below are the details for that.
case 1: I2S controller-1: with playback and capture capability
case 2: I2S controller-2: with playback capability only
case 3: I2S controller-3: with capture capability only.
We are registering all the I2S controller with there respective capability.
In command 'aplay -l' or 'cat /proc/asound/pcm', among playback devices,
capture device is also listed. This is true in case-1 but for case-2
and case-3 also it is showing the same behavior. According to my
understanding it should not show the list of all devices i.e. in case of
controller having playback capability it should show only playback
devices not capture devices and vice versa. Please correct me if I am wrong.
So my questions are
1. How to separate playback and capture devices in case-2 and case-3.
Are we need to register different codec for different i2s controller?
2. Is it codec capability only which is exported to user space ?
Best Regards
Rajeev
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-11-17 13:35 ` Exporting playback and capture capability to user space Rajeev kumar
@ 2011-11-17 15:19 ` Mark Brown
2011-11-21 5:49 ` Rajeev kumar
1 sibling, 0 replies; 16+ messages in thread
From: Mark Brown @ 2011-11-17 15:19 UTC (permalink / raw)
To: Rajeev kumar; +Cc: alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
On Thu, Nov 17, 2011 at 07:05:46PM +0530, Rajeev kumar wrote:
> In command 'aplay -l' or 'cat /proc/asound/pcm', among playback
> devices, capture device is also listed. This is true in case-1 but
This is the intended behaviour, capture only PCMs are still PCMs.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-11-17 13:35 ` Exporting playback and capture capability to user space Rajeev kumar
2011-11-17 15:19 ` Mark Brown
@ 2011-11-21 5:49 ` Rajeev kumar
2011-11-21 6:23 ` Vinod Koul
2011-11-21 10:55 ` Mark Brown
1 sibling, 2 replies; 16+ messages in thread
From: Rajeev kumar @ 2011-11-21 5:49 UTC (permalink / raw)
To: Mark Brown; +Cc: alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
Hello Mark
Could you please help me by answering these questions?
Best Regards
Rajeev
On 11/17/2011 7:05 PM, Rajeev kumar wrote:
> Hello Mark
>
> I have a single codec with playback and capture capability. We are using
> it for different i2s controller. Below are the details for that.
>
> case 1: I2S controller-1: with playback and capture capability
> case 2: I2S controller-2: with playback capability only
> case 3: I2S controller-3: with capture capability only.
>
> We are registering all the I2S controller with there respective capability.
>
> In command 'aplay -l' or 'cat /proc/asound/pcm', among playback devices,
> capture device is also listed. This is true in case-1 but for case-2 and
> case-3 also it is showing the same behavior. According to my
> understanding it should not show the list of all devices i.e. in case of
> controller having playback capability it should show only playback
> devices not capture devices and vice versa. Please correct me if I am
> wrong.
>
> So my questions are
> 1. How to separate playback and capture devices in case-2 and case-3.
> Are we need to register different codec for different i2s controller?
>
> 2. Is it codec capability only which is exported to user space ?
>
>
> Best Regards
> Rajeev
>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-11-21 5:49 ` Rajeev kumar
@ 2011-11-21 6:23 ` Vinod Koul
2011-11-22 4:27 ` Rajeev kumar
2011-11-21 10:55 ` Mark Brown
1 sibling, 1 reply; 16+ messages in thread
From: Vinod Koul @ 2011-11-21 6:23 UTC (permalink / raw)
To: Rajeev kumar; +Cc: alsa-devel@alsa-project.org, Mark Brown, lrg@slimlogic.co.uk
On Mon, 2011-11-21 at 11:19 +0530, Rajeev kumar wrote:
> Hello Mark
>
> Could you please help me by answering these questions?
>
> Best Regards
> Rajeev
>
Pls don't top-post!!
> On 11/17/2011 7:05 PM, Rajeev kumar wrote:
> > Hello Mark
> >
> > I have a single codec with playback and capture capability. We are using
> > it for different i2s controller. Below are the details for that.
> >
> > case 1: I2S controller-1: with playback and capture capability
> > case 2: I2S controller-2: with playback capability only
> > case 3: I2S controller-3: with capture capability only.
> >
> > We are registering all the I2S controller with there respective capability.
> >
> > In command 'aplay -l' or 'cat /proc/asound/pcm', among playback devices,
> > capture device is also listed. This is true in case-1 but for case-2 and
> > case-3 also it is showing the same behavior. According to my
> > understanding it should not show the list of all devices i.e. in case of
> > controller having playback capability it should show only playback
> > devices not capture devices and vice versa. Please correct me if I am
> > wrong.
> >
> > So my questions are
> > 1. How to separate playback and capture devices in case-2 and case-3.
> > Are we need to register different codec for different i2s controller?
How asoc builds this is based on dailinks you have provided. If for the
device 2 and device 3 the cpu and codec dais support both playback and
capture devices, it will go ahead and register these device.
The fact that for device 2 and device 3 capture is also registered
suggests me that your cpu dais are not correct.
Would help if you post your code, esp the codec, cpu dais and dialinks.
--
~Vinod
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-11-21 5:49 ` Rajeev kumar
2011-11-21 6:23 ` Vinod Koul
@ 2011-11-21 10:55 ` Mark Brown
1 sibling, 0 replies; 16+ messages in thread
From: Mark Brown @ 2011-11-21 10:55 UTC (permalink / raw)
To: Rajeev kumar; +Cc: alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
On Mon, Nov 21, 2011 at 11:19:10AM +0530, Rajeev kumar wrote:
> Could you please help me by answering these questions?
I replied to your mail on the day it was originally posted.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-11-21 6:23 ` Vinod Koul
@ 2011-11-22 4:27 ` Rajeev kumar
2011-11-22 13:08 ` Mark Brown
2011-12-02 10:50 ` Rajeev kumar
0 siblings, 2 replies; 16+ messages in thread
From: Rajeev kumar @ 2011-11-22 4:27 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel@alsa-project.org, Mark Brown, lrg@slimlogic.co.uk
Hello Vinod, Mark
On 11/21/2011 11:53 AM, Vinod Koul wrote:
> On Mon, 2011-11-21 at 11:19 +0530, Rajeev kumar wrote:
>> Hello Mark
>>
>> Could you please help me by answering these questions?
>>
>> Best Regards
>> Rajeev
>>
> Pls don't top-post!!
>> On 11/17/2011 7:05 PM, Rajeev kumar wrote:
>>> Hello Mark
>>>
>>> I have a single codec with playback and capture capability. We are using
>>> it for different i2s controller. Below are the details for that.
>>>
>>> case 1: I2S controller-1: with playback and capture capability
>>> case 2: I2S controller-2: with playback capability only
>>> case 3: I2S controller-3: with capture capability only.
>>>
>>> We are registering all the I2S controller with there respective capability.
>>>
>>> In command 'aplay -l' or 'cat /proc/asound/pcm', among playback devices,
>>> capture device is also listed. This is true in case-1 but for case-2 and
>>> case-3 also it is showing the same behavior. According to my
>>> understanding it should not show the list of all devices i.e. in case of
>>> controller having playback capability it should show only playback
>>> devices not capture devices and vice versa. Please correct me if I am
>>> wrong.
>>>
>>> So my questions are
>>> 1. How to separate playback and capture devices in case-2 and case-3.
>>> Are we need to register different codec for different i2s controller?
> How asoc builds this is based on dailinks you have provided. If for the
> device 2 and device 3 the cpu and codec dais support both playback and
> capture devices, it will go ahead and register these device.
> The fact that for device 2 and device 3 capture is also registered
> suggests me that your cpu dais are not correct.
>
> Would help if you post your code, esp the codec, cpu dais and dialinks.
>
Codec dai:
static struct snd_soc_dai_driver sta529_dai = {
.name = "sta529-audio",
.playback = {
.stream_name = "Playback",
.channels_min = 2,
.channels_max = 2,
.rates = SPEAR_PCM_RATES,
.formats = SPEAR_PCM_FORMAT,
},
.capture = {
.stream_name = "Capture",
.channels_min = 2,
.channels_max = 2,
.rates = SPEAR_PCM_RATES,
.formats = SPEAR_PCM_FORMAT,
},
.ops = &sta529_dai_ops,
};
cpu dai: In case of cpu dai, we are passing the playback and capture
capability from the platform code and depending on the capability we are
filling the cpu dai structure in probe function, like
if (cap & PLAY) {
/* Fill Playback capability */
}
if (cap & RECORD) {
/* Fill Capture capability */
}
dai links:
static struct snd_soc_dai_link spear_evb_dai[] = {
{
.name = "sta529-pcm0",
.stream_name = "I2S Playback",
.cpu_dai_name = "designware-i2s.0",
.platform_name = "spear-pcm-audio",
.codec_dai_name = "sta529-audio",
.codec_name = "sta529-codec.0-001a",
.ops = &sta529_ops,
}, {
.name = "sta529-pcm1",
.stream_name = "I2S Capture",
.cpu_dai_name = "designware-i2s.1",
.platform_name = "spear-pcm-audio",
.codec_dai_name = "sta529-audio",
.codec_name = "sta529-codec.0-001a",
.ops = &sta529_ops,
},
};
static struct snd_soc_card spear_snd_card = {
.name = "spear-evb",
.dai_link = spear_evb_dai,
.num_links = ARRAY_SIZE(spear_evb_dai),
};
Best Regards
~Rajeev
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-11-22 4:27 ` Rajeev kumar
@ 2011-11-22 13:08 ` Mark Brown
2011-11-23 4:36 ` Rajeev kumar
2011-12-02 10:50 ` Rajeev kumar
1 sibling, 1 reply; 16+ messages in thread
From: Mark Brown @ 2011-11-22 13:08 UTC (permalink / raw)
To: Rajeev kumar; +Cc: Vinod Koul, alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
On Tue, Nov 22, 2011 at 09:57:51AM +0530, Rajeev kumar wrote:
>
> static struct snd_soc_dai_driver sta529_dai = {
> .rates = SPEAR_PCM_RATES,
> .formats = SPEAR_PCM_FORMAT,
This looks wrong...
> cpu dai: In case of cpu dai, we are passing the playback and capture
> capability from the platform code and depending on the capability we
> are filling the cpu dai structure in probe function, like
Why are you doing this? Your driver should export the capabilities of
the hardware and let the machine driver pick any specific configuration
that's needed.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-11-22 13:08 ` Mark Brown
@ 2011-11-23 4:36 ` Rajeev kumar
0 siblings, 0 replies; 16+ messages in thread
From: Rajeev kumar @ 2011-11-23 4:36 UTC (permalink / raw)
To: Mark Brown; +Cc: Vinod Koul, alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
Hello Mark
On 11/22/2011 6:38 PM, Mark Brown wrote:
> On Tue, Nov 22, 2011 at 09:57:51AM +0530, Rajeev kumar wrote:
>
>>
>> static struct snd_soc_dai_driver sta529_dai = {
>
>> .rates = SPEAR_PCM_RATES,
>> .formats = SPEAR_PCM_FORMAT,
>
> This looks wrong...
>
Agreed, This should be STA529_RATES and STA529_FORMATS.
>> cpu dai: In case of cpu dai, we are passing the playback and capture
>> capability from the platform code and depending on the capability we
>> are filling the cpu dai structure in probe function, like
>
> Why are you doing this? Your driver should export the capabilities of
> the hardware and let the machine driver pick any specific configuration
> that's needed.
>
This is needed because we have a single cpu driver for three different
I2S controller having different capability(as I explained in the first
mail.). So capabilities are passed from the platform code and get filled
in the probe part of the i2s controller.
Best Regards
~Rajeev
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-11-22 4:27 ` Rajeev kumar
2011-11-22 13:08 ` Mark Brown
@ 2011-12-02 10:50 ` Rajeev kumar
2011-12-02 11:50 ` Vinod Koul
2012-01-09 6:31 ` Rajeev kumar
1 sibling, 2 replies; 16+ messages in thread
From: Rajeev kumar @ 2011-12-02 10:50 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel@alsa-project.org, Mark Brown, lrg@slimlogic.co.uk
Hello Vinod,
On 11/22/2011 9:57 AM, Rajeev kumar wrote:
> Hello Vinod, Mark
>
>
> On 11/21/2011 11:53 AM, Vinod Koul wrote:
>> On Mon, 2011-11-21 at 11:19 +0530, Rajeev kumar wrote:
>>> Hello Mark
>>>
>>> Could you please help me by answering these questions?
>>>
>>> Best Regards
>>> Rajeev
>>>
>> Pls don't top-post!!
>>> On 11/17/2011 7:05 PM, Rajeev kumar wrote:
>>>> Hello Mark
>>>>
>>>> I have a single codec with playback and capture capability. We are
>>>> using
>>>> it for different i2s controller. Below are the details for that.
>>>>
>>>> case 1: I2S controller-1: with playback and capture capability
>>>> case 2: I2S controller-2: with playback capability only
>>>> case 3: I2S controller-3: with capture capability only.
>>>>
>>>> We are registering all the I2S controller with there respective
>>>> capability.
>>>>
>>>> In command 'aplay -l' or 'cat /proc/asound/pcm', among playback
>>>> devices,
>>>> capture device is also listed. This is true in case-1 but for case-2
>>>> and
>>>> case-3 also it is showing the same behavior. According to my
>>>> understanding it should not show the list of all devices i.e. in
>>>> case of
>>>> controller having playback capability it should show only playback
>>>> devices not capture devices and vice versa. Please correct me if I am
>>>> wrong.
>>>>
>>>> So my questions are
>>>> 1. How to separate playback and capture devices in case-2 and case-3.
>>>> Are we need to register different codec for different i2s controller?
>> How asoc builds this is based on dailinks you have provided. If for the
>> device 2 and device 3 the cpu and codec dais support both playback and
>> capture devices, it will go ahead and register these device.
>> The fact that for device 2 and device 3 capture is also registered
>> suggests me that your cpu dais are not correct.
>>
>> Would help if you post your code, esp the codec, cpu dais and dialinks.
>>
>
> Codec dai:
>
> static struct snd_soc_dai_driver sta529_dai = {
> .name = "sta529-audio",
> .playback = {
> .stream_name = "Playback",
> .channels_min = 2,
> .channels_max = 2,
> .rates = SPEAR_PCM_RATES,
> .formats = SPEAR_PCM_FORMAT,
> },
> .capture = {
> .stream_name = "Capture",
> .channels_min = 2,
> .channels_max = 2,
> .rates = SPEAR_PCM_RATES,
> .formats = SPEAR_PCM_FORMAT,
> },
> .ops = &sta529_dai_ops,
> };
>
> cpu dai: In case of cpu dai, we are passing the playback and capture
> capability from the platform code and depending on the capability we are
> filling the cpu dai structure in probe function, like
>
> if (cap & PLAY) {
>
> /* Fill Playback capability */
> }
>
> if (cap & RECORD) {
> /* Fill Capture capability */
> }
>
> dai links:
>
> static struct snd_soc_dai_link spear_evb_dai[] = {
> {
> .name = "sta529-pcm0",
> .stream_name = "I2S Playback",
> .cpu_dai_name = "designware-i2s.0",
> .platform_name = "spear-pcm-audio",
> .codec_dai_name = "sta529-audio",
> .codec_name = "sta529-codec.0-001a",
> .ops = &sta529_ops,
> }, {
> .name = "sta529-pcm1",
> .stream_name = "I2S Capture",
> .cpu_dai_name = "designware-i2s.1",
> .platform_name = "spear-pcm-audio",
> .codec_dai_name = "sta529-audio",
> .codec_name = "sta529-codec.0-001a",
> .ops = &sta529_ops,
> },
> };
>
> static struct snd_soc_card spear_snd_card = {
> .name = "spear-evb",
> .dai_link = spear_evb_dai,
> .num_links = ARRAY_SIZE(spear_evb_dai),
> };
>
I had actually missed the last mail by mark. I dont know why? . So sorry
for replying on the top of this mail.
Vinod, have you gone through the cpu_dai, codec_dai and dailink ? Could
you please make any suggestion?
Best Regards
~Rajeev
> Best Regards
> ~Rajeev
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-12-02 10:50 ` Rajeev kumar
@ 2011-12-02 11:50 ` Vinod Koul
2012-01-09 6:31 ` Rajeev kumar
1 sibling, 0 replies; 16+ messages in thread
From: Vinod Koul @ 2011-12-02 11:50 UTC (permalink / raw)
To: Rajeev kumar; +Cc: alsa-devel@alsa-project.org, Mark Brown, lrg@slimlogic.co.uk
On Fri, 2011-12-02 at 16:20 +0530, Rajeev kumar wrote:
> > cpu dai: In case of cpu dai, we are passing the playback and capture
> > capability from the platform code and depending on the capability we
> are
> > filling the cpu dai structure in probe function, like
Unless we find what is being passed, its hard to comment.
As I said previously this will happen when you are reporting cpu dai
wrongly, so hack there to fix your issue
--
~Vinod
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2011-12-02 10:50 ` Rajeev kumar
2011-12-02 11:50 ` Vinod Koul
@ 2012-01-09 6:31 ` Rajeev kumar
2012-01-12 8:45 ` Rajeev kumar
1 sibling, 1 reply; 16+ messages in thread
From: Rajeev kumar @ 2012-01-09 6:31 UTC (permalink / raw)
To: Vinod Koul; +Cc: alsa-devel@alsa-project.org, Mark Brown, lrg@slimlogic.co.uk
On 12/2/2011 4:20 PM, Rajeev kumar wrote:
> Hello Vinod,
>
> On 11/22/2011 9:57 AM, Rajeev kumar wrote:
>> Hello Vinod, Mark
>>
>>
>> On 11/21/2011 11:53 AM, Vinod Koul wrote:
>>> On Mon, 2011-11-21 at 11:19 +0530, Rajeev kumar wrote:
>>>> Hello Mark
>>>>
>>>> Could you please help me by answering these questions?
>>>>
>>>> Best Regards
>>>> Rajeev
>>>>
>>> Pls don't top-post!!
>>>> On 11/17/2011 7:05 PM, Rajeev kumar wrote:
>>>>> Hello Mark
>>>>>
>>>>> I have a single codec with playback and capture capability. We are
>>>>> using
>>>>> it for different i2s controller. Below are the details for that.
>>>>>
>>>>> case 1: I2S controller-1: with playback and capture capability
>>>>> case 2: I2S controller-2: with playback capability only
>>>>> case 3: I2S controller-3: with capture capability only.
>>>>>
>>>>> We are registering all the I2S controller with there respective
>>>>> capability.
>>>>>
>>>>> In command 'aplay -l' or 'cat /proc/asound/pcm', among playback
>>>>> devices,
>>>>> capture device is also listed. This is true in case-1 but for case-2
>>>>> and
>>>>> case-3 also it is showing the same behavior. According to my
>>>>> understanding it should not show the list of all devices i.e. in
>>>>> case of
>>>>> controller having playback capability it should show only playback
>>>>> devices not capture devices and vice versa. Please correct me if I am
>>>>> wrong.
>>>>>
>>>>> So my questions are
>>>>> 1. How to separate playback and capture devices in case-2 and case-3.
>>>>> Are we need to register different codec for different i2s controller?
>>> How asoc builds this is based on dailinks you have provided. If for the
>>> device 2 and device 3 the cpu and codec dais support both playback and
>>> capture devices, it will go ahead and register these device.
>>> The fact that for device 2 and device 3 capture is also registered
>>> suggests me that your cpu dais are not correct.
>>>
>>> Would help if you post your code, esp the codec, cpu dais and dialinks.
>>>
>>
>> Codec dai:
>>
>> static struct snd_soc_dai_driver sta529_dai = {
>> .name = "sta529-audio",
>> .playback = {
>> .stream_name = "Playback",
>> .channels_min = 2,
>> .channels_max = 2,
>> .rates = SPEAR_PCM_RATES,
>> .formats = SPEAR_PCM_FORMAT,
>> },
>> .capture = {
>> .stream_name = "Capture",
>> .channels_min = 2,
>> .channels_max = 2,
>> .rates = SPEAR_PCM_RATES,
>> .formats = SPEAR_PCM_FORMAT,
>> },
>> .ops = &sta529_dai_ops,
>> };
>>
>> cpu dai: In case of cpu dai, we are passing the playback and capture
>> capability from the platform code and depending on the capability we are
>> filling the cpu dai structure in probe function, like
>>
>> if (cap & PLAY) {
>>
>> /* Fill Playback capability */
>> }
>>
>> if (cap & RECORD) {
>> /* Fill Capture capability */
>> }
>>
>> dai links:
>>
>> static struct snd_soc_dai_link spear_evb_dai[] = {
>> {
>> .name = "sta529-pcm0",
>> .stream_name = "I2S Playback",
>> .cpu_dai_name = "designware-i2s.0",
>> .platform_name = "spear-pcm-audio",
>> .codec_dai_name = "sta529-audio",
>> .codec_name = "sta529-codec.0-001a",
>> .ops = &sta529_ops,
>> }, {
>> .name = "sta529-pcm1",
>> .stream_name = "I2S Capture",
>> .cpu_dai_name = "designware-i2s.1",
>> .platform_name = "spear-pcm-audio",
>> .codec_dai_name = "sta529-audio",
>> .codec_name = "sta529-codec.0-001a",
>> .ops = &sta529_ops,
>> },
>> };
>>
>> static struct snd_soc_card spear_snd_card = {
>> .name = "spear-evb",
>> .dai_link = spear_evb_dai,
>> .num_links = ARRAY_SIZE(spear_evb_dai),
>> };
>>
>
> I had actually missed the last mail by mark. I dont know why? . So sorry
> for replying on the top of this mail.
>
> Vinod, have you gone through the cpu_dai, codec_dai and dailink ? Could
> you please make any suggestion?
>
Ping
> Best Regards
> ~Rajeev
>
>
>
>> Best Regards
>> ~Rajeev
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Exporting playback and capture capability to user space
2012-01-09 6:31 ` Rajeev kumar
@ 2012-01-12 8:45 ` Rajeev kumar
0 siblings, 0 replies; 16+ messages in thread
From: Rajeev kumar @ 2012-01-12 8:45 UTC (permalink / raw)
To: Mark Brown; +Cc: Vinod Koul, alsa-devel@alsa-project.org, lrg@slimlogic.co.uk
Hello Mark
On 1/9/2012 12:01 PM, Rajeev kumar wrote:
> On 12/2/2011 4:20 PM, Rajeev kumar wrote:
>> Hello Vinod,
>>
>> On 11/22/2011 9:57 AM, Rajeev kumar wrote:
>>> Hello Vinod, Mark
>>>
>>>
>>> On 11/21/2011 11:53 AM, Vinod Koul wrote:
>>>> On Mon, 2011-11-21 at 11:19 +0530, Rajeev kumar wrote:
>>>>> Hello Mark
>>>>>
>>>>> Could you please help me by answering these questions?
>>>>>
>>>>> Best Regards
>>>>> Rajeev
>>>>>
>>>> Pls don't top-post!!
>>>>> On 11/17/2011 7:05 PM, Rajeev kumar wrote:
>>>>>> Hello Mark
>>>>>>
>>>>>> I have a single codec with playback and capture capability. We are
>>>>>> using
>>>>>> it for different i2s controller. Below are the details for that.
>>>>>>
>>>>>> case 1: I2S controller-1: with playback and capture capability
>>>>>> case 2: I2S controller-2: with playback capability only
>>>>>> case 3: I2S controller-3: with capture capability only.
>>>>>>
>>>>>> We are registering all the I2S controller with there respective
>>>>>> capability.
>>>>>>
>>>>>> In command 'aplay -l' or 'cat /proc/asound/pcm', among playback
>>>>>> devices,
>>>>>> capture device is also listed. This is true in case-1 but for case-2
>>>>>> and
>>>>>> case-3 also it is showing the same behavior. According to my
>>>>>> understanding it should not show the list of all devices i.e. in
>>>>>> case of
>>>>>> controller having playback capability it should show only playback
>>>>>> devices not capture devices and vice versa. Please correct me if I am
>>>>>> wrong.
>>>>>>
>>>>>> So my questions are
>>>>>> 1. How to separate playback and capture devices in case-2 and case-3.
>>>>>> Are we need to register different codec for different i2s controller?
>>>> How asoc builds this is based on dailinks you have provided. If for the
>>>> device 2 and device 3 the cpu and codec dais support both playback and
>>>> capture devices, it will go ahead and register these device.
>>>> The fact that for device 2 and device 3 capture is also registered
>>>> suggests me that your cpu dais are not correct.
>>>>
>>>> Would help if you post your code, esp the codec, cpu dais and dialinks.
>>>>
>>>
>>> Codec dai:
>>>
>>> static struct snd_soc_dai_driver sta529_dai = {
>>> .name = "sta529-audio",
>>> .playback = {
>>> .stream_name = "Playback",
>>> .channels_min = 2,
>>> .channels_max = 2,
>>> .rates = SPEAR_PCM_RATES,
>>> .formats = SPEAR_PCM_FORMAT,
>>> },
>>> .capture = {
>>> .stream_name = "Capture",
>>> .channels_min = 2,
>>> .channels_max = 2,
>>> .rates = SPEAR_PCM_RATES,
>>> .formats = SPEAR_PCM_FORMAT,
>>> },
>>> .ops = &sta529_dai_ops,
>>> };
>>>
>>> cpu dai: In case of cpu dai, we are passing the playback and capture
>>> capability from the platform code and depending on the capability we are
>>> filling the cpu dai structure in probe function, like
>>>
>>> if (cap & PLAY) {
>>>
>>> /* Fill Playback capability */
>>> }
>>>
>>> if (cap & RECORD) {
>>> /* Fill Capture capability */
>>> }
>>>
>>> dai links:
>>>
>>> static struct snd_soc_dai_link spear_evb_dai[] = {
>>> {
>>> .name = "sta529-pcm0",
>>> .stream_name = "I2S Playback",
>>> .cpu_dai_name = "designware-i2s.0",
>>> .platform_name = "spear-pcm-audio",
>>> .codec_dai_name = "sta529-audio",
>>> .codec_name = "sta529-codec.0-001a",
>>> .ops = &sta529_ops,
>>> }, {
>>> .name = "sta529-pcm1",
>>> .stream_name = "I2S Capture",
>>> .cpu_dai_name = "designware-i2s.1",
>>> .platform_name = "spear-pcm-audio",
>>> .codec_dai_name = "sta529-audio",
>>> .codec_name = "sta529-codec.0-001a",
>>> .ops = &sta529_ops,
>>> },
>>> };
>>>
>>> static struct snd_soc_card spear_snd_card = {
>>> .name = "spear-evb",
>>> .dai_link = spear_evb_dai,
>>> .num_links = ARRAY_SIZE(spear_evb_dai),
>>> };
>>>
>>
>> I had actually missed the last mail by mark. I dont know why? . So sorry
>> for replying on the top of this mail.
>>
>> Vinod, have you gone through the cpu_dai, codec_dai and dailink ? Could
>> you please make any suggestion?
>>
>
> Ping
>
The o/p of the cat /proc/asound/pcm does not depends on the &ing of the
capability of i2s controller and codec. I was going through the
soc-core.c and it seems that the capability exposed to user space only
depends on the codec. If codec has both playback and capture capability
,then in user space both will be exported and hence cat /proc/asound/pcm
will show two different devices one for playback and other for capture.
In case codec has only playback capability, the o/p of the cat
/proc/asound/pcm will contain only playback device.
So in case of three different i2s controller with different capability,
separate codec are required.
Please correct me if I am wrong.
Best Regards
Rajeev
>> Best Regards
>> ~Rajeev
>>
>>
>>
>>> Best Regards
>>> ~Rajeev
>>
>
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2012-01-12 8:45 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-06 9:34 overrun in case of record Rajeev kumar
2011-09-06 18:01 ` Mark Brown
2011-09-07 4:14 ` Rajeev kumar
2011-09-07 8:35 ` Clemens Ladisch
2011-11-17 13:35 ` Exporting playback and capture capability to user space Rajeev kumar
2011-11-17 15:19 ` Mark Brown
2011-11-21 5:49 ` Rajeev kumar
2011-11-21 6:23 ` Vinod Koul
2011-11-22 4:27 ` Rajeev kumar
2011-11-22 13:08 ` Mark Brown
2011-11-23 4:36 ` Rajeev kumar
2011-12-02 10:50 ` Rajeev kumar
2011-12-02 11:50 ` Vinod Koul
2012-01-09 6:31 ` Rajeev kumar
2012-01-12 8:45 ` Rajeev kumar
2011-11-21 10:55 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).