Skip to contentSkip to conversation

Query regarding pointer callback

DISCUSSION Pharaoh . 2 participants 3 messages Jun 22, 2007 – Jun 25, 2007

lore
Share & tools
lore

Pharaoh .

author
#0 lore raw

Hi

In Writing an ALSA driver, it is said that
pointer callback is called usually from the buffer-update routine in the pcm middle layer, which is invoked when snd_pcm_period_elapsed() is called in the interrupt routine. Then the pcm middle layer updates the position and calculates the available space, and wakes up the sleeping poll threads, etc

What are the other places from where pointer callback is called? If it is not called from any other routine then does it mean that interrupts are occuring?

author
#1 lore raw

It is called from snd_pcm_lib_ioctl too. In SNDRV_PCM_IOCTL1_RESET case.

Quoted 13 lines · Pharaoh .

Hi

In Writing an ALSA driver, it is said that
pointer callback is called usually from the buffer-update routine in the pcm middle layer, which is invoked when snd_pcm_period_elapsed() is called in the interrupt routine. Then the pcm middle layer updates the position and calculates the available space, and wakes up the sleeping poll threads, etc

What are the other places from where pointer callback is called? If it is not called from any other routine then does it mean that interrupts are occuring?

#2 lore raw
In reply to Pharaoh .
Quoted 8 lines · Pharaoh .

In Writing an ALSA driver, it is said that
pointer callback is called usually from the buffer-update routine in the pcm middle layer, which is invoked when snd_pcm_period_elapsed() is called in the interrupt routine. Then the pcm middle layer updates the position and calculates the available space, and wakes up the sleeping poll threads, etc

What are the other places from where pointer callback is called?

Many places. There are some other situations when the ALSA framework wants to know the current position (e.g., pausing, stopping), and the application can ask for the current position at any time.

Quoted 2 lines

If it is not called from any other routine then does it mean that interrupts are occuring?

When it's never called, it means that snd_pcm_period_elapsed() never was called.

HTH
Clemens