Bug 470558

Summary: Sox corrupts BE files
Product: [Fedora] Fedora Reporter: The Source <thesource>
Component: soxAssignee: Jiri Moskovcak <jmoskovc>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: chris, dfediuck, jmoskovc
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-07-14 14:16:03 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description The Source 2008-11-07 17:17:39 UTC
Description of problem:
Can not convert file from LE to BE properly. Resulting file has unrecognized format - xmms refuses to play it, aplay says:
Unsigned 8 bit, Rate 8000 Hz, Mono (really it is Stereo 96000 24bit BE)
and plays garbage.

Version-Release number of selected component (if applicable):
sox-14.0.1-1.fc9.x86_64

How reproducible:
always

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Chris Bagwell 2008-11-23 15:25:09 UTC
Can you provide an example command line your using?

This may have been fixed in upstream SoX 14.1.0.  The changelog refers to 24bit endian fix on big-endian systems.

  o Fix 24-bit read/write on big-endian systems.  (robs)

The related changeset fix contains many fixes and mentions some issues with endian flags on any platform; which is probably what your seeing.

The fix doesn't look easy to port back to 14.0.1.

Comment 2 The Source 2008-11-23 15:37:14 UTC
aplay 24LE_96Khz_Stereo.wav
Playing WAVE '24LE_96Khz_Stereo.wav' : Signed 24 bit Little Endian in 3bytes, Rate 96000 Hz, Stereo

sox 24LE_96Khz_Stereo.wav -c2 -r96000 -B -3 test.wav

aplay test.wav 
Playing raw data 'test.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

Comment 3 Chris Bagwell 2008-11-23 16:05:02 UTC
OK, thanks for command line.  As best I know, this is not a bug anywhere then.  It is lack of a feature in aplay.

"Big endian" WAV files have a different header (start with RIFX instead of RIFF) and not all applications support them because they are rare.

It looks like aplay simply doesn't support RIFX files and confuses it for raw audio data.  Probably, it would act the same way if you tried to play a text file.

I created a file with your above command line and verified that Audacity and SoX could both correctly read and play them.

Comment 4 The Source 2008-11-25 04:12:25 UTC
I can confirm that sox plays that file correctly, but Audacity says file format is not recognized.

Comment 5 Chris Bagwell 2008-12-07 23:22:30 UTC
OK, I created both 16-bit and 24-bit Big Endian WAV files (RIFX) using SoX and verified that "aplay" can not play either.  So its verified that aplay simply can not play any type of RIFX files.  No bugs there.

Next, I tried loading both the 16-bit BE and 24-bit BE into audacity again.  The 16-bit files loaded fine but the 24-bit file gave an error message and will not load them.

The headers of 16-bit vs. 24-bit WAV files are almost identical except for the part that says bit-width.  So I suspect if SoX is creating correct 16-bits then its creating correct 24-bits.

I think Audacity uses libsndfile so I quickly browsed both source code in related areas.  Its looks like libsndfile probably supports 24-bit RIFX files as I couldn't find any code to specifically deny it.

But it looks like Audacity has no options to create a 24-bit RIFX file so I could not find a way to create one and compare to SoX.  At this time, I think its simply that no other program exists to support 24-bit RIFX files except for SoX.

24-bit files are not very common and RIFX are extremely uncommon.  So putting them together makes it hard to find applications to test with.

I still think no bug exists in SoX at this time; especially with Fedora 10 version of SoX.

Comment 6 Bug Zapper 2009-06-10 03:12:19 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Bug Zapper 2009-07-14 14:16:03 UTC
Fedora 9 changed to end-of-life (EOL) status on 2009-07-10. Fedora 9 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.