From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: MIDI+USB - one way? Date: Mon, 05 Aug 2002 12:07:38 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <3D4E3AB0.563AB976@ladisch.de> Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <3D4E3AB0.563AB976@ladisch.de> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Clemens Ladisch Cc: Jaroslav Kysela , Pedro Lopez-Cabanillas , Michal Seta , alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Mon, 05 Aug 2002 10:43:28 +0200, Clemens Ladisch wrote: > > 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). how about pcm? it must be blocked unless O_NONBLOCK is specified. this issue is regardless how the other unix-like os are, but we need to refer to _only_ posix here. eventually, linux is not a unix clone :) imo, in the case of midi, this blocking behavior is nothting but annoying. hence i agree to change this behavior, as long as the change doesn't break the posix standard. (and i believe that no applications suffer by this change.) Takashi ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf