From mboxrd@z Thu Jan 1 00:00:00 1970 From: Clemens Ladisch Subject: Re: MIDI+USB - one way? Date: Mon, 05 Aug 2002 10:43:28 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <3D4E3AB0.563AB976@ladisch.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT Return-path: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Jaroslav Kysela Cc: Pedro Lopez-Cabanillas , Michal Seta , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org Jaroslav Kysela wrote: > On Fri, 2 Aug 2002, Clemens Ladisch wrote: > > rawmidi.c uses the ALSA library functions to access the rawmidi device. > > Internally, alsa-lib should use the same read() call as cat, but there > > seems to be a difference somewhere, maybe in the initialization. > > Note that the cat utility (od probably too) uses big input buffer. If you > want to capture byte-stream, use the dd utility with the block size of 1 > byte. No, the size of the input buffer must not prevent read() from returning data which is available immediately. IOW: if some data is available, read() mustn't block. ALSA's current read() implementation is wrong in this regard. This isn't only incompatible to OSS, but also to any other implementation of read() in Linux (or any other Unix-like OS, not to mention POSIX or SUS). Clemens ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf