Re: ALSA OSS Emulation - Read - EAGAIN Errors

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

 



On Tue, Jul 29, 2008 at 11:59:35PM -0700, Rahul Iyer wrote:
> I have a full duplex voice application, that records voice and sends
> (over a network) as well as receives and plays voice. OSS APIs are used
> to capture and play voice samples. 
> 
> The voice quality is noticeably poor in SUSE 10. After further
> investigation, I see most of the 'read' system calls fail with EAGAIN
> (resource unavailable) error. This is not the case in SUSE 9.2.

if the device is opened in non-blocking mode, EAGAIN means that
there are not enough samples to read and thus the read(2) system
call would block, so it returns EAGAIN instead of blocking the
program execution.

It's not a failure. It's the normal behaviour when the device is
opened with O_NONBLOCK flag. Its purpose is to allow interactive
(ie not CPU bound) apps to work using (for instance) an event loop
into a single execution thread.

Nevertheless, i don't know why there's a difference between
different versions of your operating system. It seems that either
your program doesn't handle EAGAIN or that the device returns
EAGAIN were it shouldn't.

-- Alexandre

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux