[alsa-devel] dsnoop issues

Takashi Iwai tiwai at suse.de
Fri Apr 27 15:09:10 CEST 2007


At Fri, 27 Apr 2007 15:00:22 +0200 (CEST),
Jaroslav Kysela wrote:
> 
> On Fri, 27 Apr 2007, Takashi Iwai wrote:
> 
> > At Fri, 27 Apr 2007 13:27:00 +0100,
> > Gordon Miller wrote:
> > > 
> > > Hi
> > > 
> > > All my snd_pcm_readi calls return too few frames. Also when I switch to 
> > > stereo, the sound is muted. I cannot change this by adjusting period & 
> > > buffer sizes. dsnoop is enabled by default. The documentation for 
> > > snd_pcm_readi says that the only way that the frame count can be short 
> > > is because of a signal or xrun. Well this clearly isn't the case.
> > 
> > Actually, the documentation is wrong, IMO.  The typical behavior of
> > read syscall is that it returns a value actually read by that call.
> > It doesn't guarantee whether the requested size is filled, and can be
> > shorter than requested.  As snd_pcm_readi() emulates the read syscall,
> > it should behave in that way.
> 
> I don't think so completely. For blocking mode (!O_NONBLOCK), all possible 
> data should be read. Only signal or an error should break this.
> 
> The read logic for dsnoop is in snd_pcm_read_areas() in pcm/pcm.c 
> (alsa-lib).

In the current implementation, it may work in that way.  But, in
general, I'm against such a condition.  It's not what read syscalls
does, so there is no real reason that snd_pcm_readi() should do so.


Takashi


More information about the Alsa-devel mailing list