Respond to ALSA events? [SOLVED]
Hi, I have been messing with the ALSA API and writing C programs to control the volume. I would also like a way to execute a piece of code when an ALSA event occurs. Specifically, I want to do something when the volume changes.
First of all, does anyone know of an easy way to do this through ALSA configuration files. Second, does anyone know of a way to do this by writing code for it manually and using the ALSA API. This stuff isn't very well documented and I have been unable to find anything on it yet. Thanks. |
I dont know if it helps you, but you can control mixer with a command line like this:
amixer set DAC 10+ amixer set DAC,1 10+ etc... man amixer. |
Yeah, I was doing that, but I started to desire a way to control the mixer through my own C program. I wanted my own daemon to do some certain things.
Anyway, it turns out that snd_mixer_wait, in the ALSA API, is the function I wanted. It will cause the program to sleep until a mixer event occurs (i.e. the volume changes). - Phil |
I'm not a C programmer, but i think looking at amixer source code could be full of learnings.
|
Solved
Yup, that is what I did to figure out how to do what I wanted to do. I've got a working C program now, which does exactly what I want to do.
- Phil |
All times are GMT -5. The time now is 09:37 PM. |