Re: dsnoop issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 27 Apr 2007, Takashi Iwai wrote:

> At Fri, 27 Apr 2007 15:00:22 +0200 (CEST),
> Jaroslav Kysela wrote:
> > 
> > On Fri, 27 Apr 2007, Takashi Iwai wrote:
> > 
> > > 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.

Well 'man 2 read' exactly explains when a less count than requested might 
be returned for blocking behaviour. I'm missing something? Of course, 
applications should not expect to read all possible frames, but under 
normal conditions, less count should be returned in rare cases (for 
the blocking mode, of course).

						Jaroslav

-----
Jaroslav Kysela <perex@xxxxxxx>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux