Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Recording
  • Assigned To No-one
  • Operating System Sansa e200
  • Severity Low
  • Priority Very Low
  • Reported Version Version 3.3
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by christop - 2009-07-20
Last edited by MikeS - 2009-07-23

FS#10458 - Fix incorrect AIFF and WAV encoding while recording in mono

The encoders for both AIFF and WAV produce the incorrect encoding when the channel mode is set to mono on my Sansa e200 (and probably all other little-endian players) in Rockbox Version 3.3 as well as the latest revision as of this writing (r21985). The problem occurs when recording either from the mic or from FM radio, and with any mono mode (L, R, L+R).

For AIFF, the encoder outputs the incorrect endian-ness of samples, producing files that sound very much like static. For WAV, the encoder swaps samples in pairs, which essentially adds in sawtooth-like waveforms to a smooth input wave. For example, if you have the input sample values 0 1 2 3 4 5, the WAV encoder would output 1 0 3 2 5 4 instead.

I attached a patch which I believe fixes both of these issues for machines of all byte orders. I tested it on the e200 (little endian), but I don’t have any big-endian players to test it on.

Closed by  MikeS
2009-07-23 11:33
Reason for closing:  Accepted
Additional comments about closing:  

Checked out and verified on ARM and CF.

MikeS commented on 2009-07-22 08:10

Interesting.

WAV: (S2 « 16) | (uint16_t)S1
LE: 1L1H2L2H noop 1L1H2L2H
BE: 2H2L1H1L swap 1L1H2L2H

AIFF: (S1 « 16) | (uint16_t)S2
LE: 2L2H1L1H swap 1H1L2H2L
BE: 1H1L2H2L noop 1H1L2H2L

It checks out and I endorse this patch. :-)

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing