* customized IOCTL in pcm platform driver.
@ 2012-10-09 6:30 gsantosh
2012-10-09 6:40 ` Takashi Iwai
0 siblings, 1 reply; 9+ messages in thread
From: gsantosh @ 2012-10-09 6:30 UTC (permalink / raw)
To: alsa-devel; +Cc: tiwai, lrg
Hi All,
will ALSA framework provide any customized IOCTL functionality in PCM
platform driver.
in my system there is a requirement to get some information from DSP to
user space and I am thinking to add IOCTL's, is there any method to
accommodate or how we can address this issue?
Regards,
Santosh
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: customized IOCTL in pcm platform driver.
2012-10-09 6:30 customized IOCTL in pcm platform driver gsantosh
@ 2012-10-09 6:40 ` Takashi Iwai
2012-10-09 6:44 ` gsantosh
0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2012-10-09 6:40 UTC (permalink / raw)
To: gsantosh; +Cc: alsa-devel, lrg
At Mon, 8 Oct 2012 23:30:09 -0700 (PDT),
gsantosh@codeaurora.org wrote:
>
> Hi All,
>
> will ALSA framework provide any customized IOCTL functionality in PCM
> platform driver.
No.
> in my system there is a requirement to get some information from DSP to
> user space and I am thinking to add IOCTL's, is there any method to
> accommodate or how we can address this issue?
You can use hwdep device for any extra methods.
Takashi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: customized IOCTL in pcm platform driver.
2012-10-09 6:40 ` Takashi Iwai
@ 2012-10-09 6:44 ` gsantosh
2012-10-09 6:52 ` Takashi Iwai
0 siblings, 1 reply; 9+ messages in thread
From: gsantosh @ 2012-10-09 6:44 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, lrg, gsantosh
> At Mon, 8 Oct 2012 23:30:09 -0700 (PDT),
> gsantosh@codeaurora.org wrote:
>>
>> Hi All,
>>
>> will ALSA framework provide any customized IOCTL functionality in PCM
>> platform driver.
>
> No.
>
>> in my system there is a requirement to get some information from DSP to
>> user space and I am thinking to add IOCTL's, is there any method to
>> accommodate or how we can address this issue?
>
> You can use hwdep device for any extra methods.
We need to tie this ioctl with the on going DSP session which will be
difficult When used with hwdep interface.
>
>
> Takashi
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: customized IOCTL in pcm platform driver.
2012-10-09 6:44 ` gsantosh
@ 2012-10-09 6:52 ` Takashi Iwai
2012-10-09 7:30 ` gsantosh
0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2012-10-09 6:52 UTC (permalink / raw)
To: gsantosh; +Cc: alsa-devel, lrg
At Mon, 8 Oct 2012 23:44:40 -0700 (PDT),
gsantosh@codeaurora.org wrote:
>
> > At Mon, 8 Oct 2012 23:30:09 -0700 (PDT),
> > gsantosh@codeaurora.org wrote:
> >>
> >> Hi All,
> >>
> >> will ALSA framework provide any customized IOCTL functionality in PCM
> >> platform driver.
> >
> > No.
> >
> >> in my system there is a requirement to get some information from DSP to
> >> user space and I am thinking to add IOCTL's, is there any method to
> >> accommodate or how we can address this issue?
> >
> > You can use hwdep device for any extra methods.
>
> We need to tie this ioctl with the on going DSP session which will be
> difficult When used with hwdep interface.
Hm, how can it be difficult? More specific description is needed to
answer more.
Takashi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: customized IOCTL in pcm platform driver.
2012-10-09 6:52 ` Takashi Iwai
@ 2012-10-09 7:30 ` gsantosh
2012-10-09 7:44 ` Takashi Iwai
0 siblings, 1 reply; 9+ messages in thread
From: gsantosh @ 2012-10-09 7:30 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, lrg, gsantosh
> At Mon, 8 Oct 2012 23:44:40 -0700 (PDT),
> gsantosh@codeaurora.org wrote:
>>
>> > At Mon, 8 Oct 2012 23:30:09 -0700 (PDT),
>> > gsantosh@codeaurora.org wrote:
>> >>
>> >> Hi All,
>> >>
>> >> will ALSA framework provide any customized IOCTL functionality in PCM
>> >> platform driver.
>> >
>> > No.
>> >
>> >> in my system there is a requirement to get some information from DSP
>> to
>> >> user space and I am thinking to add IOCTL's, is there any method to
>> >> accommodate or how we can address this issue?
>> >
>> > You can use hwdep device for any extra methods.
>>
>> We need to tie this ioctl with the on going DSP session which will be
>> difficult When used with hwdep interface.
>
> Hm, how can it be difficult? More specific description is needed to
> answer more.
to communicate with DSP we open up a session and populate that information
in the substream, for this use case during the playback session user space
has to talk to DSP to get some information like time stamp also the time
stamp statistics, to talk to DSP I need to get hold of the proper
substream so that the communication with particular session is possible.
I see adding one IOCTL in the platform driver will solve my issue, but not
finding any way to integrate this in the current framework,
if we use the hwdep, not sure how can I get hold of the substream handle
so I can talk to particular session in DSP.
DSP can support multiple sessions playback even in this case we need to
talk to DSP but the DSP session information will be the part of substream,
I need to get hold of proper substream handle to talk to particular DSP
session.
let me know can we handle this?
>
>
> Takashi
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: customized IOCTL in pcm platform driver.
2012-10-09 7:30 ` gsantosh
@ 2012-10-09 7:44 ` Takashi Iwai
2012-10-09 8:01 ` gsantosh
0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2012-10-09 7:44 UTC (permalink / raw)
To: gsantosh; +Cc: alsa-devel, lrg
At Tue, 9 Oct 2012 00:30:40 -0700 (PDT),
gsantosh@codeaurora.org wrote:
>
> > At Mon, 8 Oct 2012 23:44:40 -0700 (PDT),
> > gsantosh@codeaurora.org wrote:
> >>
> >> > At Mon, 8 Oct 2012 23:30:09 -0700 (PDT),
> >> > gsantosh@codeaurora.org wrote:
> >> >>
> >> >> Hi All,
> >> >>
> >> >> will ALSA framework provide any customized IOCTL functionality in PCM
> >> >> platform driver.
> >> >
> >> > No.
> >> >
> >> >> in my system there is a requirement to get some information from DSP
> >> to
> >> >> user space and I am thinking to add IOCTL's, is there any method to
> >> >> accommodate or how we can address this issue?
> >> >
> >> > You can use hwdep device for any extra methods.
> >>
> >> We need to tie this ioctl with the on going DSP session which will be
> >> difficult When used with hwdep interface.
> >
> > Hm, how can it be difficult? More specific description is needed to
> > answer more.
>
> to communicate with DSP we open up a session and populate that information
> in the substream, for this use case during the playback session user space
> has to talk to DSP to get some information like time stamp also the time
> stamp statistics, to talk to DSP I need to get hold of the proper
> substream so that the communication with particular session is possible.
>
> I see adding one IOCTL in the platform driver will solve my issue, but not
> finding any way to integrate this in the current framework,
>
> if we use the hwdep, not sure how can I get hold of the substream handle
> so I can talk to particular session in DSP.
A PCM substream can be identified simply by a PCM device number and
a PCM substream index. You can make ioctl to pass these information.
Takashi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: customized IOCTL in pcm platform driver.
2012-10-09 7:44 ` Takashi Iwai
@ 2012-10-09 8:01 ` gsantosh
2012-10-09 8:38 ` Takashi Iwai
2012-10-25 4:56 ` gsantosh
0 siblings, 2 replies; 9+ messages in thread
From: gsantosh @ 2012-10-09 8:01 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, lrg, gsantosh
> At Tue, 9 Oct 2012 00:30:40 -0700 (PDT),
> gsantosh@codeaurora.org wrote:
>>
>> > At Mon, 8 Oct 2012 23:44:40 -0700 (PDT),
>> > gsantosh@codeaurora.org wrote:
>> >>
>> >> > At Mon, 8 Oct 2012 23:30:09 -0700 (PDT),
>> >> > gsantosh@codeaurora.org wrote:
>> >> >>
>> >> >> Hi All,
>> >> >>
>> >> >> will ALSA framework provide any customized IOCTL functionality in
>> PCM
>> >> >> platform driver.
>> >> >
>> >> > No.
>> >> >
>> >> >> in my system there is a requirement to get some information from
>> DSP
>> >> to
>> >> >> user space and I am thinking to add IOCTL's, is there any method
>> to
>> >> >> accommodate or how we can address this issue?
>> >> >
>> >> > You can use hwdep device for any extra methods.
>> >>
>> >> We need to tie this ioctl with the on going DSP session which will be
>> >> difficult When used with hwdep interface.
>> >
>> > Hm, how can it be difficult? More specific description is needed to
>> > answer more.
>>
>> to communicate with DSP we open up a session and populate that
>> information
>> in the substream, for this use case during the playback session user
>> space
>> has to talk to DSP to get some information like time stamp also the time
>> stamp statistics, to talk to DSP I need to get hold of the proper
>> substream so that the communication with particular session is possible.
>>
>> I see adding one IOCTL in the platform driver will solve my issue, but
>> not
>> finding any way to integrate this in the current framework,
>>
>> if we use the hwdep, not sure how can I get hold of the substream handle
>> so I can talk to particular session in DSP.
>
> A PCM substream can be identified simply by a PCM device number and
> a PCM substream index. You can make ioctl to pass these information.
>
Can you point to any code reference doing this operation?
did you mean accessing the sub-stream handle in user space or in the
kernel driver.
>
> Takashi
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: customized IOCTL in pcm platform driver.
2012-10-09 8:01 ` gsantosh
@ 2012-10-09 8:38 ` Takashi Iwai
2012-10-25 4:56 ` gsantosh
1 sibling, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2012-10-09 8:38 UTC (permalink / raw)
To: gsantosh; +Cc: alsa-devel, lrg
At Tue, 9 Oct 2012 01:01:42 -0700 (PDT),
gsantosh@codeaurora.org wrote:
>
> > At Tue, 9 Oct 2012 00:30:40 -0700 (PDT),
> > gsantosh@codeaurora.org wrote:
> >>
> >> > At Mon, 8 Oct 2012 23:44:40 -0700 (PDT),
> >> > gsantosh@codeaurora.org wrote:
> >> >>
> >> >> > At Mon, 8 Oct 2012 23:30:09 -0700 (PDT),
> >> >> > gsantosh@codeaurora.org wrote:
> >> >> >>
> >> >> >> Hi All,
> >> >> >>
> >> >> >> will ALSA framework provide any customized IOCTL functionality in
> >> PCM
> >> >> >> platform driver.
> >> >> >
> >> >> > No.
> >> >> >
> >> >> >> in my system there is a requirement to get some information from
> >> DSP
> >> >> to
> >> >> >> user space and I am thinking to add IOCTL's, is there any method
> >> to
> >> >> >> accommodate or how we can address this issue?
> >> >> >
> >> >> > You can use hwdep device for any extra methods.
> >> >>
> >> >> We need to tie this ioctl with the on going DSP session which will be
> >> >> difficult When used with hwdep interface.
> >> >
> >> > Hm, how can it be difficult? More specific description is needed to
> >> > answer more.
> >>
> >> to communicate with DSP we open up a session and populate that
> >> information
> >> in the substream, for this use case during the playback session user
> >> space
> >> has to talk to DSP to get some information like time stamp also the time
> >> stamp statistics, to talk to DSP I need to get hold of the proper
> >> substream so that the communication with particular session is possible.
> >>
> >> I see adding one IOCTL in the platform driver will solve my issue, but
> >> not
> >> finding any way to integrate this in the current framework,
> >>
> >> if we use the hwdep, not sure how can I get hold of the substream handle
> >> so I can talk to particular session in DSP.
> >
> > A PCM substream can be identified simply by a PCM device number and
> > a PCM substream index. You can make ioctl to pass these information.
> >
>
> Can you point to any code reference doing this operation?
What operation do you mean? It's just a look up of PCM instance...
> did you mean accessing the sub-stream handle in user space or in the
> kernel driver.
In the kernel side, you can look through the list of PCM subdevice
and find out the matching snd_pcm_substream instance from the given
subdevice index.
That is, keep PCM handles in your driver data, and look through it.
struct snd_pcm_substream *find_my_substream()
{
for (i = 0; i < chip->my_pcms; i++) {
if (chip->pcms[i]->device == this_pcm_device) {
pcm = chip->pcms[i];
break;
}
}
if (!pcm)
return NULL;
for (s = pcm->streams[dir].substream; s; s = s->next)
if (s->number == this_substream_number) {
return s;
return NULL;
}
Then in a struct passed to ioctl, you can add two fields
struct my_ioctl {
unsigned int pcm_device;
unsigned int pcm_subdevice;
unsigned int more_data_blah;
...
};
int handle_my_ioctl(chip, arg)
{
struct my_ioctl data;
if (copy_from_user(&data, arg, sizeof(data)))
return -EFAULT;
s = find_my_substream(chip, data.pcm_device,
data.pcm_subdevice);
if (!s)
return -EINVAL;
handle_subdevice(s, &data);
if (copy_to_user(arg, &data, sizeof(data)))
return -EFAULT;
return 0;
}
Takashi
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: customized IOCTL in pcm platform driver.
2012-10-09 8:01 ` gsantosh
2012-10-09 8:38 ` Takashi Iwai
@ 2012-10-25 4:56 ` gsantosh
1 sibling, 0 replies; 9+ messages in thread
From: gsantosh @ 2012-10-25 4:56 UTC (permalink / raw)
Cc: Takashi Iwai, alsa-devel, lrg, gsantosh
>> At Tue, 9 Oct 2012 00:30:40 -0700 (PDT),
>> gsantosh@codeaurora.org wrote:
>>>
>>> > At Mon, 8 Oct 2012 23:44:40 -0700 (PDT),
>>> > gsantosh@codeaurora.org wrote:
>>> >>
>>> >> > At Mon, 8 Oct 2012 23:30:09 -0700 (PDT),
>>> >> > gsantosh@codeaurora.org wrote:
>>> >> >>
>>> >> >> Hi All,
>>> >> >>
>>> >> >> will ALSA framework provide any customized IOCTL functionality in
>>> PCM
>>> >> >> platform driver.
>>> >> >
>>> >> > No.
>>> >> >
>>> >> >> in my system there is a requirement to get some information from
>>> DSP
>>> >> to
>>> >> >> user space and I am thinking to add IOCTL's, is there any method
>>> to
>>> >> >> accommodate or how we can address this issue?
>>> >> >
>>> >> > You can use hwdep device for any extra methods.
>>> >>
>>> >> We need to tie this ioctl with the on going DSP session which will
>>> be
>>> >> difficult When used with hwdep interface.
>>> >
>>> > Hm, how can it be difficult? More specific description is needed to
>>> > answer more.
>>>
>>> to communicate with DSP we open up a session and populate that
>>> information
>>> in the substream, for this use case during the playback session user
>>> space
>>> has to talk to DSP to get some information like time stamp also the
>>> time
>>> stamp statistics, to talk to DSP I need to get hold of the proper
>>> substream so that the communication with particular session is
>>> possible.
>>>
>>> I see adding one IOCTL in the platform driver will solve my issue, but
>>> not
>>> finding any way to integrate this in the current framework,
>>>
>>> if we use the hwdep, not sure how can I get hold of the substream
>>> handle
>>> so I can talk to particular session in DSP.
>>
>> A PCM substream can be identified simply by a PCM device number and
>> a PCM substream index. You can make ioctl to pass these information.
>>
>
> Can you point to any code reference doing this operation?
> did you mean accessing the sub-stream handle in user space or in the
> kernel driver.
>
>
>>
>> Takashi
>>
>
>
thanks for the information Takashi, but I have new requirement, want to
see how can I implement a asynchronous functionality using dependent
hardware interface,
consider a use case where the DSP responds with proprietary data tied up
with session opened, now the data received at app has to be propagated to
user space
for further processing, does any one implemented this in hardware
dependent interface layer.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-10-25 4:56 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-09 6:30 customized IOCTL in pcm platform driver gsantosh
2012-10-09 6:40 ` Takashi Iwai
2012-10-09 6:44 ` gsantosh
2012-10-09 6:52 ` Takashi Iwai
2012-10-09 7:30 ` gsantosh
2012-10-09 7:44 ` Takashi Iwai
2012-10-09 8:01 ` gsantosh
2012-10-09 8:38 ` Takashi Iwai
2012-10-25 4:56 ` gsantosh
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).