From: Doug Ledford <dledford@redhat.com>
To: David Ford <david@blue-labs.org>
Cc: Peter Lund <firefly@netgroup.dk>,
Pozsar Balazs <pozsy@sch.bme.hu>,
linux-kernel@vger.kernel.org
Subject: Re: esound (esd), 2.4.[12] chopped up sound -- solved
Date: Wed, 21 Mar 2001 01:45:00 -0500 [thread overview]
Message-ID: <3AB84DEC.ED651FD2@redhat.com> (raw)
In-Reply-To: <Pine.GSO.4.30.0103201832260.15849-100000@balu> <3AB7A2CB.64ED61F3@netgroup.dk> <3AB7B477.2A740CE0@blue-labs.org> <3AB7BB59.9513514C@redhat.com> <3AB821AD.6F545468@blue-labs.org>
David Ford wrote:
>
> a) not all drivers are created equal
> b) esd should check the return value anyway
In as much as several people did point out that a write is not guaranteed to
be complete and may be short, even when in blocking mode, you are perfectly
correct. In as much as this usually is a result of an error condition or
inability of the write to be completed, and not a result of a driver refusing
to block and complete the write as the caller has requested (which would be
the case in a sound driver since the output should be draining, the only
exception being if the program had call the SETTRIGGER ioctl to disable the
output starting with the first write of a complete oss frag, which esd doesn't
do so it isn't a plausible condition) I think drivers that do this are
"inferior" (since I can't call them buggy any longer). Amongst other things,
it increases the number of traversals through the syscall heirarchy
needlessly, wastes both kernel and user space CPU cycles, and negates the
whole purpose of having the file opened in blocking mode anyway. So, yes esd
should check these conditions to be complete and compliant with specs. Given
a decent sound driver though, it shouldn't have to.
> -d
>
> Doug Ledford wrote:
>
> > David Ford wrote:
> > >
> > > Actually you probably upgraded to a non-broken version of esd. Stock esd -still-
> > > writes to the socket without regard to return value. If the write only accepted
> > > 2098 of 4096 bytes, the residual bytes are lost, esd will write the next packet at
> > > 4097, not 2099. esd is incredibly bad about err checking as is old e stuff.
> > >
> > > I posted my last patch for esd here and to other places in June of 2000. All it
> > > does is check for return value and adjust the writes accordingly. For reference,
> > > the patch is at http://stuph.org/esound-audio.c.patch.
> >
> > Why would esd get a short write() unless it is opening the file in non
> > blocking mode (which I didn't see when I was working on the i810 sound
> > driver)? If esd is writing to a file in blocking mode and that write is
> > returning short, then that sounds like a driver bug to me.
--
Doug Ledford <dledford@redhat.com> http://people.redhat.com/dledford
Please check my web site for aic7xxx updates/answers before
e-mailing me about problems
prev parent reply other threads:[~2001-03-21 6:40 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-19 12:15 esound (esd), 2.4.[12] chopped up sound Peter Lund
2001-03-20 17:35 ` Pozsar Balazs
2001-03-20 18:34 ` esound (esd), 2.4.[12] chopped up sound -- solved Peter Lund
2001-03-20 19:50 ` David Ford
2001-03-20 20:19 ` Doug Ledford
2001-03-20 22:24 ` Tim Wright
2001-03-20 22:37 ` David Woodhouse
2001-03-20 23:20 ` Ion Badulescu
2001-03-21 3:36 ` David Ford
2001-03-21 6:45 ` Doug Ledford [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3AB84DEC.ED651FD2@redhat.com \
--to=dledford@redhat.com \
--cc=david@blue-labs.org \
--cc=firefly@netgroup.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=pozsy@sch.bme.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox