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 :)
this is ppc specific...
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.
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.
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.
*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!
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.
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.
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?
Lars, Jose could you guys follow up on this bug and also put the patch/ebuild in cvs?
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.
Fixed in CVS
*** Bug 195875 has been marked as a duplicate of this bug. ***