- Status Closed
- Percent Complete
- Task Type Bugs
- Category Codecs
- Assigned To No-one
- Operating System Gigabeat F/X
- Severity Low
- Priority Very Low
- Reported Version
- Due in Version Undecided
-
Due Date
Undecided
- Votes
- Private
FS#6760 - Stereo Speex files produce only silence in Rockbox
When ripping direct from CD and converting immediately to speex, the resulting files appear to playback in Rockbox fine (i.e. the progress bar moves, and the time remaining changes) however you can’t actually hear any audio. Converting the wav file from the CD rip to mono, and then re-encoding resolves the issue.
Loading...
Available keyboard shortcuts
- Alt + ⇧ Shift + l Login Dialog / Logout
- Alt + ⇧ Shift + a Add new task
- Alt + ⇧ Shift + m My searches
- Alt + ⇧ Shift + t focus taskid search
Tasklist
- o open selected task
- j move cursor down
- k move cursor up
Task Details
- n Next task
- p Previous task
- Alt + ⇧ Shift + e ↵ Enter Edit this task
- Alt + ⇧ Shift + w watch task
- Alt + ⇧ Shift + y Close Task
Task Editing
- Alt + ⇧ Shift + s save task
Yeah actually this is something silly. Turns out to produce stereo in Speex you need to do two passes over the file. So the decoding loop should look something like
or something like that anyway. I’ll take a look again when I get a chance.
Yeah okay, that’s not it. The code is already like that.
When i tried to debug speex (when implementing the codec) i got this problem, which was caused by faulty (not good enough accuracy) sqrt and exp functions.
To debug it i would try to use real (floating point) sqrt&exp functions in the emulator, and if that not works look at
void speex_decode_stereo_int(spx_int16_t *data, int frame_size, SpeexStereoState *stereo)
and int speex_std_stereo_request_handler(SpeexBits *bits, void *state, void *data) in stereo.c
Currently sqrt and exp returns 0 (placeholder functions). I haven’t found good enough integer replacements to give noise-free sound. If you want to play sereo files in mono replace
e_left = sqrt(e_left/(e_tot+.01));
e_right = sqrt(e_right/(e_tot+.01));
with
e_left=1;
e_right=1;
in speex_decode_stereo_int (stereo.c:~166)
I don’t think we use that code at all - we use speex_decode_stereo_int(), not speex_decode_stereo()
No, I think freqmod is right. speex_decode_stereo_int does actually use a floating point sqrt() function. See line 163 and 164 of apps/codecs/libspeex/stereo.c. Don’t know why I didn’t see that before. Should probably just disable stereo decoding until that’s made fixed point.