Skip to contentSkip to conversation

Event notification

DISCUSSION Miloslaw Smyk 2 participants 2 messages Dec 20, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

My app needs to know about the events occurring to a sound card. Specifically, I am interested in start, stop, pause and volume change. While I could monitor volume by similar means as alsamixer does (is there any doc on this apart from the source code?), I am not sure if monitoring other events is at all possible. I would appreciate any suggestions as to how to do this.

Kind Regards,
Milek

#1 lore raw
Quoted 8 lines · Miloslaw Smyk

Hi,

My app needs to know about the events occurring to a sound card. Specifically, I am interested in start, stop, pause and volume change. While I could monitor volume by similar means as alsamixer does (is there any doc on this apart from the source code?), I am not sure if monitoring other events is at all possible. I would appreciate any suggestions as to how to do this.

You may write a simple monitor plugin to alsa-lib and create an interface to send these events to your code (shm, socket or so). Or you can monitor (periodically read) /proc/asound/card/ files (but they won't tell you the reason why stream stopped).

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project