[alsa-devel] Accessing already probed snd_card in kernel space
Shreshtha
shreshthakumar at gmail.com
Fri Apr 15 09:49:11 CEST 2011
Thanks Lu and Clemens for reply.
Vibrator hardware is connected to D-Class amplifier of Audio block. Audio
block has its ASoC driver.
One way in Android is to use timed_output
("/sys/class/timed_output/vibrator/enable").
I wanted to access the alsa card, configure it and play vibrator from
"timed_output vibrator driver" in Kernel space.
But as you described that accessing from out side the sound subsystem is
prohibited in Kernel.
So only way remains is to access the sound card from user space using ALSA
lib APIs and replace current usage of sysfs for haptic feedback. Please
suggest if it is right direction.
On Fri, Apr 15, 2011 at 12:00 PM, Lu Guanqun <guanqun.lu at intel.com> wrote:
> On Fri, Apr 15, 2011 at 01:46:41PM +0800, Shreshtha wrote:
> > Hi, I am completely new to ALSA and ASoC so my question formation may
> seems
> > vague but I will try to be clear in objective.
> > How can I access already detected/populated sound card from inside the
> > kernel using standard ALSA kernel APIs?
> > Any mapping of kernel api for the following steps -
> >
> > 1) Find the right ALSA-card. (using snd_card_create)
> >
> > 2) Find the wanted ALSA-control for this card with
> snd_ctl_find_numid(...).
> >
> > 3) Modify the control
> >
> > I want to configure the vibrator from kernel using the ALSA kernel APIs.
> >
> > From user space alsa_amixer -Dhw set/sset "vibra command" "..."
> > I want to do it from kernel space using ALSA apis.
>
> Why would you do that in kernel?
>
> I don't think you should access it directly in subsystem other than
> sound subsystem. Your scenario is very much like directly access an
> opened file in kernel, which should be prohibited.
>
> I'm afraid you can notify the userspace in kernel when you want to do
> such kind of changes, and then let the userspace program issue the
> command and change it for you. It's much clear.
>
> >
> > BR
> > Mickey
> > _______________________________________________
> > Alsa-devel mailing list
> > Alsa-devel at alsa-project.org
> > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
> --
> guanqun
>
--
shreshthakumar at gmail.com
More information about the Alsa-devel
mailing list