First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 200051
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: mips team <mips@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Akkara <Raaell@gmail.com>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 200051 depends on: Show dependency tree
Bug 200051 blocks: 146062
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2007-11-23 06:48 0000
The currently stable media-sound/sox-12.17.9 loses the last sample when
processing 2-channel 16-bit pcm .wav soundfiles with a odd number of samples

Problem seems to be fixed in unstable media-sound/sox-14.0.0 as well as the
previous unstable, media-sound/sox-13.0.0


Reproducible: Always

Steps to Reproduce:
>>> echo "UklGRjAAAABXQVZFZm10IBAAAAABAAIARKwAABCxAgAEABAAZGF0YQwAAAABEA/wAiAO4AMwDdA=" | base64 -d >test.wav

>>> md5sum test.wav
bc073b230966e3e3c05a085d2e5ebf00  test.wav

>>> hexdump -C test.wav
00000000  52 49 46 46 30 00 00 00  57 41 56 45 66 6d 74 20  |RIFF0...WAVEfmt |
00000010  10 00 00 00 01 00 02 00  44 ac 00 00 10 b1 02 00  |........D.......|
00000020  04 00 10 00 64 61 74 61  0c 00 00 00 01 10 0f f0  |....data........|
00000030  02 20 0e e0 03 30 0d d0                           |. ...0..|
00000038

# Commentary: The data is at the end, 3 sample-frames times 2 channels
# is 6 16-bit samples, in little-endian format:
# 1001, F00F, 2002, E00E, 3003, D00D

>>> equery list sox
[ Searching for package 'sox' in all categories among: ]
 * installed packages
[I--] [  ] media-sound/sox-12.17.9 (0)


# Commentary: use sox to convert the file to raw 16-bit form

>>> sox  -t .wav test.wav  -t .raw -c 2 -s -w test.raw
>>> hexdump -C test.raw
00000000  01 10 0f f0 02 20 0e e0                           |..... ..|
00000008

# Commentary: Notice the last sample of each channel has been dropped

Actual Results:  
00000000  01 10 0f f0 02 20 0e e0                           |..... ..|

The last sample of each channel has been lost

Expected Results:  
00000000  01 10 0f f0 02 20 0e e0  03 30 0d d0              |..... ...0..|

Converted all the samples.


Try the same steps with unstable sox to show it works:


>>> equery list sox
[ Searching for package 'sox' in all categories among: ]
 * installed packages
[I--] [ ~] media-sound/sox-14.0.0 (0)


>>> sox  -t .wav test.wav  -t .raw -c 2 -s -w test.raw
>>> hexdump -C test.raw
00000000  01 10 0f f0 02 20 0e e0  03 30 0d d0              |..... ...0..|
0000000c


If for some reason it is decided not to stabilize the 14.* or 13.* versions,
the following patch to wav.c also works:

sox-12.17.9 >>> diff -c src/wav-orig.c src/wav.c
*** src/wav-orig.c      2007-11-22 22:34:29.206250390 -0800
--- src/wav.c   2007-11-22 22:35:49.148905833 -0800
***************
*** 1150,1156 ****
          /* Only return buffers that contain a totally playable
           * amount of audio.
           */
!         done -= (done % (ft->info.channels * ft->info.size));
          if (done/ft->info.channels > wav->numSamples)
              wav->numSamples = 0;
          else
--- 1150,1156 ----
          /* Only return buffers that contain a totally playable
           * amount of audio.
           */
!         done -= (done % ft->info.channels);
          if (done/ft->info.channels > wav->numSamples)
              wav->numSamples = 0;
          else

=====
This change is supported by looking at the corresponding lines of the 14.0.0,
where it appears the same thing was done.

------- Comment #1 From Samuli Suominen 2007-11-23 10:53:09 0000 -------
Moving on, marking 14.0.0 stable.



amd64 stable

------- Comment #2 From Markus Meier 2007-11-23 16:06:03 0000 -------
x86 stable

------- Comment #3 From Markus Rothe 2007-11-23 21:30:54 0000 -------
ppc64 stable

------- Comment #4 From nixnut 2007-11-24 18:03:47 0000 -------
ppc stable

------- Comment #5 From Jeroen Roovers 2007-11-26 01:01:56 0000 -------
Stable for HPPA.

------- Comment #6 From Raúl Porcel 2007-11-28 17:34:29 0000 -------
alpha/sparc stable

------- Comment #7 From Jakub Moc (RETIRED) 2008-02-13 00:06:39 0000 -------
Closing, Bug 192235 for mips re-keywording.

First Last Prev Next    No search results available      Search page      Enter new bug