Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 35745 - Patch: errors playing wav files with play/sox
Summary: Patch: errors playing wav files with play/sox
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: High normal (vote)
Assignee: Lars Weiler (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-13 11:38 UTC by Manuel Lora
Modified: 2007-10-16 16:32 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to fix sox on ppc (signed.patch,605 bytes, patch)
2004-08-25 07:25 UTC, Joe Jezak (RETIRED)
Details | Diff
Patch to fix segfaults with wav files (wav.c.patch,255 bytes, patch)
2004-08-25 20:22 UTC, Joe Jezak (RETIRED)
Details | Diff
Revision bumped version of sox that includes the patches for ppc (sox-12.17.5.ebuild,1.47 KB, text/plain)
2004-08-30 18:51 UTC, Joe Jezak (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel Lora 2003-12-13 11:38:07 UTC
I am getting errors playing any wav files (using OSS) when I do:
play foo.wav or, its sox equivalent: sox foo.wav -t ossdsp /dev/dsp
I get the following message:

sox: User options overriding size read in .wav header
sox: bad input format for file test.wav: data size 254 is invalid

This does not happen with my gentoo box (same version of sox [12.17.3-r3]) on x86. I even tried generating local files on the ppc machine and I get the same error.

(Notice that this might be restricted only to the "normal" WAV files: PCM 16 bit, stereo, 44100 Hz little-endian.)

Reproducible: Always
Steps to Reproduce:
1.
2.
3.




I've also tried by emerging every sox package above the version I currently have
installed, along with every USE combination (disanling ogg, alsa, etc). Same
result every time. In fact, sox fails with the monkey1.wav file in its own
tarball. Also notice that there are no user options set (sox thinks I'm passing
it an option). Doing a play foo.wav obviously is not setting user options that
bypass the WAV header info. I even looked in wav.c.

Other than a couple of non-related packages, I have no masked packages installed
at all. This is a brand new Gentoo install (iBook 2.2 g3).

Several front-ends use the 'play' script so this is a major inconvenience :)
Comment 1 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-28 05:17:13 UTC
this is  ppc specific...
Comment 2 Joe Jezak (RETIRED) gentoo-dev 2004-08-25 07:25:06 UTC
Created attachment 38165 [details, diff]
Patch to fix sox on ppc

After some investigation, this looks like it is an upstream bug.  Using the
patch provided allows .wav and .voc files to be played correctly on ppc. 
Basically, one of the structures uses unsigned chars instead of signed chars
like its expecting.  This bug is still present in the new version (12.17.5,
which should be version bumped in portage as well).  There are still some
issues with converting from wav, but I haven't tracked those down yet.

If this tests okay on other arches, we should send it upstream.
Comment 3 Joe Jezak (RETIRED) gentoo-dev 2004-08-25 09:06:08 UTC
Tested on x86, works fine.  
On PPC I'm still having issues with segfaults with the testall.sh script when converting from wav to voc.  I haven't figured out why yet, but the above patch does fix playing the wav, which was the initial problem.
Comment 4 Joe Jezak (RETIRED) gentoo-dev 2004-08-25 20:22:21 UTC
Created attachment 38221 [details, diff]
Patch to fix segfaults with wav files

This fixes the segfault that sometimes occurs after playing a wav file.  I'm
not sure I really like the fix, as it could introduce a memory leak, but it
seems to work on my PPC machine.  This is untested on x86.
Comment 5 Chris White (RETIRED) gentoo-dev 2004-08-26 20:20:13 UTC
*bump* ppc herd, can you take a look at this please and verify the 
patch integrity?  If you guys are ok on it, I'll go ahead and have an
arch conditional epatch ( use ppc && epatch blah ) for the build.  Thanks
ahead of time!
Comment 6 Lars Weiler (RETIRED) gentoo-dev 2004-08-30 18:12:25 UTC
I will test in a couple of hours, as my machine is currently emerging KDE ;-)

As I'm the mentor of JoseJX I asked him to create the ebuild, so he can learn to apply a patch for a single architecture.  I'm pretty sure he will attach it to this bug.
Comment 7 Joe Jezak (RETIRED) gentoo-dev 2004-08-30 18:51:07 UTC
Created attachment 38552 [details]
Revision bumped version of sox that includes the patches for ppc

When emerging on ppc, this ebuild will apply the patches previously attached.
Comment 8 Joe Jezak (RETIRED) gentoo-dev 2004-09-03 01:54:39 UTC
I think I know why the code was orginally broken on ppc.  I think gcc defaults to -fsigned-char on ppc, but doesn't have this behaviour on other platforms.  Maybe we should override this?  Is there a reason why the default would be different?
Comment 9 Pieter Van den Abeele (RETIRED) gentoo-dev 2004-09-22 16:12:52 UTC
Lars, Jose could you guys follow up on this bug and also put the patch/ebuild in cvs? 
Comment 10 Joe Jezak (RETIRED) gentoo-dev 2004-10-12 18:01:42 UTC
Instead of using the first patch, flag-o-matic should be used to append -fsigned-char to the cflags.  This should be applied regardless of the arch (if other arches default to -funsigned-char like PPC does, this will fix it).  The second patch still should be applied on PPC.
Comment 11 Joe Jezak (RETIRED) gentoo-dev 2004-10-17 16:45:55 UTC
Fixed in CVS
Comment 12 Daniel Drake (RETIRED) gentoo-dev 2007-10-16 16:32:03 UTC
*** Bug 195875 has been marked as a duplicate of this bug. ***