* Question on Compressed offload session
@ 2014-11-13 3:02 gsantosh
2014-11-13 15:27 ` [alsa-devel] " Pierre-Louis Bossart
0 siblings, 1 reply; 5+ messages in thread
From: gsantosh @ 2014-11-13 3:02 UTC (permalink / raw)
To: alsa-devel-bounces
Cc: Mark Rutland, Rob Herring, ALSA Development Mailing List,
Kuninori Morimoto, Stephen Warren, Linux-sh list, Magnus,
linux-kernel, grant.likely, devicetree, Mark Brown,
Geert Uytterhoeven, Olof Johansson, Kuninori Morimoto
Hi All,
The Question is for the compressed offload session.
For a generic codec driver during the startup function it will set some of
the hw_constraints rule similarly like this.
snd_pcm_hw_constraint_list(substream->runtime, 0,
SNDRV_PCM_HW_PARAM_RATE,
&constraints_12_24);
pcm_lib.c will try to add the rule to the runtime structure by accessing
the pointers which will be initialized during opening of the session,
as The Constraints added by the codec driver will be updated in the
struct snd_pcm_hw_constraints of runtime structure which will be part of
substream handle.
But for the compressed offload I do not see the initialization done for HW
constraints, as done in pcm session
2092int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
2093 struct file *file,
2094 struct snd_pcm_substream **rsubstream)
most of the existing drivers which has the hw_constraint_list code will
not be applicable for compress offload session, how to solve this?
Regards,
Santosh M G.
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora
Forum,a Linux Foundation Collaborative Project
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] Question on Compressed offload session
2014-11-13 3:02 Question on Compressed offload session gsantosh
@ 2014-11-13 15:27 ` Pierre-Louis Bossart
2014-11-14 4:08 ` gsantosh
0 siblings, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2014-11-13 15:27 UTC (permalink / raw)
To: gsantosh, alsa-devel-bounces
Cc: Mark Rutland, Rob Herring, ALSA Development Mailing List,
Kuninori Morimoto, Linux-sh list, Stephen Warren, Magnus,
linux-kernel, Olof Johansson, devicetree, Mark Brown,
Geert Uytterhoeven, grant.likely, Kuninori Morimoto
On 11/12/14, 9:02 PM, gsantosh@codeaurora.org wrote:
> Hi All,
>
> The Question is for the compressed offload session.
>
> For a generic codec driver during the startup function it will set some of
> the hw_constraints rule similarly like this.
>
> snd_pcm_hw_constraint_list(substream->runtime, 0,
> SNDRV_PCM_HW_PARAM_RATE,
> &constraints_12_24);
>
> pcm_lib.c will try to add the rule to the runtime structure by accessing
> the pointers which will be initialized during opening of the session,
> as The Constraints added by the codec driver will be updated in the
>
> struct snd_pcm_hw_constraints of runtime structure which will be part of
> substream handle.
>
> But for the compressed offload I do not see the initialization done for HW
> constraints, as done in pcm session
>
> 2092int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
> 2093 struct file *file,
> 2094 struct snd_pcm_substream **rsubstream)
>
> most of the existing drivers which has the hw_constraint_list code will
> not be applicable for compress offload session, how to solve this?
You can't directly link physical output/input with the decoder/encoder
in general.
For decoders, the sample-rate may not always be known ahead of time,
e.g. with AAC-SBR implicit signaling. There is no way to add constraints
on open, there is an assumption that a sample-rate converter is part of
the chain to take care of the difference between the output of the
offloaded decoder and the back-end actual sampling frequency (same with
number of channels and bit-width btw).
Likewise if you encode the frequency may not be the same as what the
backend provides and some SRC might be needed.
-Pierre
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] Question on Compressed offload session
2014-11-13 15:27 ` [alsa-devel] " Pierre-Louis Bossart
@ 2014-11-14 4:08 ` gsantosh
2014-11-14 16:28 ` Pierre-Louis Bossart
0 siblings, 1 reply; 5+ messages in thread
From: gsantosh @ 2014-11-14 4:08 UTC (permalink / raw)
To: Pierre-Louis Bossart
Cc: gsantosh, alsa-devel-bounces, Mark Rutland, Rob Herring,
ALSA Development Mailing List, Kuninori Morimoto, Stephen Warren,
Linux-sh list, Magnus, linux-kernel, grant.likely, devicetree,
Mark Brown, Geert Uytterhoeven, Olof Johansson, Kuninori Morimoto
> On 11/12/14, 9:02 PM, gsantosh@codeaurora.org wrote:
>> Hi All,
>>
>> The Question is for the compressed offload session.
>>
>> For a generic codec driver during the startup function it will set some
>> of
>> the hw_constraints rule similarly like this.
>>
>> snd_pcm_hw_constraint_list(substream->runtime, 0,
>> SNDRV_PCM_HW_PARAM_RATE,
>> &constraints_12_24);
>>
>> pcm_lib.c will try to add the rule to the runtime structure by accessing
>> the pointers which will be initialized during opening of the session,
>> as The Constraints added by the codec driver will be updated in the
>>
>> struct snd_pcm_hw_constraints of runtime structure which will be part of
>> substream handle.
>>
>> But for the compressed offload I do not see the initialization done for
>> HW
>> constraints, as done in pcm session
>>
>> 2092int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
>> 2093 struct file *file,
>> 2094 struct snd_pcm_substream **rsubstream)
>>
>> most of the existing drivers which has the hw_constraint_list code will
>> not be applicable for compress offload session, how to solve this?
>
> You can't directly link physical output/input with the decoder/encoder
> in general.
> For decoders, the sample-rate may not always be known ahead of time,
> e.g. with AAC-SBR implicit signaling. There is no way to add constraints
> on open, there is an assumption that a sample-rate converter is part of
> the chain to take care of the difference between the output of the
> offloaded decoder and the back-end actual sampling frequency (same with
> number of channels and bit-width btw).
> Likewise if you encode the frequency may not be the same as what the
> backend provides and some SRC might be needed.
> -Pierre
>
I Agree we cannot have a direct link between physical output / input with
decoder / encoder, during compressed playback.
My concern here is, if we have a legacy codec driver which is used for the
PCM out, and in the start up of this codec driver it is adding
hw_constraints list, now the same codec driver is used for the compressed
session FE or PCM session FE,
If the routing is such that compressed FE -> codec the hw_constraints
added by this driver is not valid here,
and legacy drivers needs to be changed,
Now the question comes how to change this drivers?
I can think of following things
if the routing is done for Compressed FE -> codec
1) in Codec driver avoid adding hw_constraint during startup if compressed
session is routed, this recommend for codec driver to know that compress
session is routed to codec which I feel not the correct way to handle this
I was checking how to handle this situation in much better way.
Regards
Santosh
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] Question on Compressed offload session
2014-11-14 4:08 ` gsantosh
@ 2014-11-14 16:28 ` Pierre-Louis Bossart
2014-11-14 17:06 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Pierre-Louis Bossart @ 2014-11-14 16:28 UTC (permalink / raw)
To: gsantosh
Cc: Mark Rutland, Rob Herring, ALSA Development Mailing List,
Kuninori Morimoto, Stephen Warren, Linux-sh list, Magnus,
linux-kernel, Olof Johansson, devicetree, Mark Brown,
Geert Uytterhoeven, grant.likely, alsa-devel-bounces,
Kuninori Morimoto
On 11/13/14, 10:08 PM, gsantosh@codeaurora.org wrote:
>> On 11/12/14, 9:02 PM, gsantosh@codeaurora.org wrote:
>>> Hi All,
>>>
>>> The Question is for the compressed offload session.
>>>
>>> For a generic codec driver during the startup function it will set some
>>> of
>>> the hw_constraints rule similarly like this.
>>>
>>> snd_pcm_hw_constraint_list(substream->runtime, 0,
>>> SNDRV_PCM_HW_PARAM_RATE,
>>> &constraints_12_24);
>>>
>>> pcm_lib.c will try to add the rule to the runtime structure by accessing
>>> the pointers which will be initialized during opening of the session,
>>> as The Constraints added by the codec driver will be updated in the
>>>
>>> struct snd_pcm_hw_constraints of runtime structure which will be part of
>>> substream handle.
>>>
>>> But for the compressed offload I do not see the initialization done for
>>> HW
>>> constraints, as done in pcm session
>>>
>>> 2092int snd_pcm_open_substream(struct snd_pcm *pcm, int stream,
>>> 2093 struct file *file,
>>> 2094 struct snd_pcm_substream **rsubstream)
>>>
>>> most of the existing drivers which has the hw_constraint_list code will
>>> not be applicable for compress offload session, how to solve this?
>>
>> You can't directly link physical output/input with the decoder/encoder
>> in general.
>> For decoders, the sample-rate may not always be known ahead of time,
>> e.g. with AAC-SBR implicit signaling. There is no way to add constraints
>> on open, there is an assumption that a sample-rate converter is part of
>> the chain to take care of the difference between the output of the
>> offloaded decoder and the back-end actual sampling frequency (same with
>> number of channels and bit-width btw).
>> Likewise if you encode the frequency may not be the same as what the
>> backend provides and some SRC might be needed.
>> -Pierre
>>
>
> I Agree we cannot have a direct link between physical output / input with
> decoder / encoder, during compressed playback.
> My concern here is, if we have a legacy codec driver which is used for the
> PCM out, and in the start up of this codec driver it is adding
> hw_constraints list, now the same codec driver is used for the compressed
> session FE or PCM session FE,
> If the routing is such that compressed FE -> codec the hw_constraints
> added by this driver is not valid here,
> and legacy drivers needs to be changed,
> Now the question comes how to change this drivers?
> I can think of following things
> if the routing is done for Compressed FE -> codec
>
> 1) in Codec driver avoid adding hw_constraint during startup if compressed
> session is routed, this recommend for codec driver to know that compress
> session is routed to codec which I feel not the correct way to handle this
>
> I was checking how to handle this situation in much better way.
What exactly do you call a 'legacy codec'? If there is a DAI i am not
sure I understand the problem.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [alsa-devel] Question on Compressed offload session
2014-11-14 16:28 ` Pierre-Louis Bossart
@ 2014-11-14 17:06 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2014-11-14 17:06 UTC (permalink / raw)
To: Pierre-Louis Bossart
Cc: gsantosh, Mark Rutland, Rob Herring,
ALSA Development Mailing List, Kuninori Morimoto, Stephen Warren,
Linux-sh list, Magnus, linux-kernel, Olof Johansson, devicetree,
Geert Uytterhoeven, grant.likely, alsa-devel-bounces,
Kuninori Morimoto
[-- Attachment #1: Type: text/plain, Size: 815 bytes --]
On Fri, Nov 14, 2014 at 10:28:54AM -0600, Pierre-Louis Bossart wrote:
> On 11/13/14, 10:08 PM, gsantosh@codeaurora.org wrote:
> >1) in Codec driver avoid adding hw_constraint during startup if compressed
> >session is routed, this recommend for codec driver to know that compress
> >session is routed to codec which I feel not the correct way to handle this
> >I was checking how to handle this situation in much better way.
> What exactly do you call a 'legacy codec'? If there is a DAI i am not sure I
> understand the problem.
I think what he's trying to say is that there's nothing automatic which
will ensure that constraints on the back end set by the CODEC driver
will be paid attention to. This is true, it's pretty much entirely up
to the machine driver to make sure it gets the back end links right.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-14 17:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-13 3:02 Question on Compressed offload session gsantosh
2014-11-13 15:27 ` [alsa-devel] " Pierre-Louis Bossart
2014-11-14 4:08 ` gsantosh
2014-11-14 16:28 ` Pierre-Louis Bossart
2014-11-14 17:06 ` 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).