Skip to contentSkip to conversation

0 or EAGAIN from snd_pcm_update_avail()?

DISCUSSION Ludovico Cavedon 2 participants 3 messages Apr 3, 2009 – Apr 5, 2009

lore
Share & tools
lore
#0 lore raw

Hi all,

if snd_pcm_update_avail() gets called on a PCM device in non-blocking mode when no data is availabe jet, what is the expected return value? -0
-EAGAIN
-either is valid

I am asking this question because pulseaudio expect to receive 0, but the the bluetooth headset pcm transfer callback returns EAGAIN, so I want to find out against whoms I should open a bug :)

Thanks in advance,
Ludovico

#1 lore raw
Quoted 11 lines · Ludovico Cavedon

Hi all,

if snd_pcm_update_avail() gets called on a PCM device in non-blocking mode when no data is availabe jet, what is the expected return value? -0

(quoted diff) +0 -2
-EAGAIN
-either is valid

I am asking this question because pulseaudio expect to receive 0, but the the bluetooth headset pcm transfer callback returns EAGAIN, so I want to find out against whoms I should open a bug :)

0.

-EAGAIN should be returned only for R/W operations but not for buffer position routines. They should return always immediatelly with useable value (thus EAGAIN does not make sense).

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

#2 lore raw
Quoted 13 lines · Jaroslav Kysela
Quoted 9 lines · Ludovico Cavedon

if snd_pcm_update_avail() gets called on a PCM device in non-blocking mode when no data is availabe jet, what is the expected return value? -0

(quoted diff) +0 -2
-EAGAIN
-either is valid

I am asking this question because pulseaudio expect to receive 0, but the the bluetooth headset pcm transfer callback returns EAGAIN, so I want to find out against whoms I should open a bug :)

0.

Quoted 3 lines

-EAGAIN should be returned only for R/W operations but not for buffer position routines. They should return always immediatelly with useable value (thus EAGAIN does not make sense).

I see.
But is it correct for the ioplug module to call the transfer callback when snd_pcm_avail_update() is invoked?

Thanks,
Ludovico