[alsa-devel] Accessing already probed snd_card in kernel space

Lu Guanqun guanqun.lu at intel.com
Fri Apr 15 08:30:16 CEST 2011


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


More information about the Alsa-devel mailing list