Re: Old, unnoticed bug in OSS output plugin.

Sean Meiners <[email protected]> Mon, 4 Apr 2005 11:51:49 -0700
Newsgroups gmane.comp.multimedia.xmms.devel
Organization Linspire, Inc.
Message-ID <[email protected]>
It's pretty trivial, otherwise I would have sent it in the first place, sorry.  
Here you go.

On Monday 04 April 2005 11:45 am, Jeremy Huddleston wrote:
> Could you please send a patch?
>
> On Mon, 2005-03-28 at 11:27 -0800, Sean Meiners wrote:
> > While using XMMS's OSS output plugin to help me test an OSS emulation
> > library that uses bio2jack I found a sneaky little bug that managed to go
> > unnoticed for quite some time.
> >
> > In write_all in audio.c it goes into a loop until all data is written. 
> > The problem is that while it reduces the number of bytes to write based
> > on how many were written in the previous loop it forgets to advance the
> > buffer, causing some very odd sound effects.  I suspect this has gone
> > unnoticed because the OSS drivers themselves don't seem to do
> > short-writes.  However, my emulation library did.  When I modified my
> > code to prevent short-writes the problem went away.  It's not a
> > high-priority issue since non-emulated OSS devices don't seem to exhibit
> > this and emulated ones probably shouldn't do partial-frame writes, but
> > it's a bug nonetheless and easy to fix at that.
> >
> > PS: I tried filing a bug in the XMMS bugzilla system, but I'd rather not
> > open a bugzilla account just for this, especially since I don't expect to
> > be doing any future work on XMMS.  Oh, and I'm not subscribed to this
> > list either, so keep that in mind if you reply and want me to see it.

-- 
Sean Meiners
[email protected]


Perl - $Just @when->$you ${thought} s/yn/tax/ &couldn\'t %get $worse;

--

This message contains information which may be confidential and privileged. Unless you are the 
addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone 
the message or any information contained in the message. If you have received the message in error, 
please advise the sender and delete the message.  Thank you.

_______________________________________________
xmms-devel mailing list
[email protected]
http://lists.xmms.org/mailman/listinfo/xmms-devel
xmms-oss-buffer-advance.patch (text/x-diff, 416 B)
diff -ur xmms-1.2.10.orig/Output/OSS/audio.c xmms-1.2.10/Output/OSS/audio.c
--- xmms-1.2.10.orig/Output/OSS/audio.c	2005-03-28 11:38:54.000000000 -0800
+++ xmms-1.2.10/Output/OSS/audio.c	2005-04-04 11:49:13.000000000 -0700
@@ -236,7 +236,7 @@
 {
 	ssize_t done = 0;
 	do {
-		ssize_t n = write(fd, buf, count - done);
+		ssize_t n = write(fd, buf + count, count - done);
 		if (n == -1)
 		{
 			if (errno == EINTR)