Rockbox General > Rockbox General Discussion
Divide by zero error, 090322
Job Van Dam:
Version: 3.2-090323
dreamlayers:
--- Quote from: Job Van Dam on March 25, 2009, 02:16:37 AM ---How do I find the SVN revision number?
--- End quote ---
If you've downloaded the source via svn, you can just use the svnversion command. If you just have the source and not the svn data, I don't know of any quick way to find the version. The Rockbox build process might not know how to find the version either, and that might result in "unknown".
--- Quote from: Job Van Dam on March 25, 2009, 02:16:37 AM ---Does anyone have a "proper" FLAC file that plays on the current Rockbox build they could upload somewhere? I just want to test ...
--- End quote ---
You can find some FLAC samples at: http://samples.mplayerhq.hu/flac/
Or just try your other two files. Only "Ya Numpty" triggers the crash; move it from the directory.
--- Quote from: Job Van Dam on March 25, 2009, 02:16:37 AM ---DreamLayers, there just sound effects I uploaded 3 to Rapidshare.
There copyright, I'm sorry, I will delete the link when I'm done with it.
--- End quote ---
Thanks for posting the files. Here's the bug, in flac_init():
/* Calculate track length (in ms) and estimate the bitrate
(in kbit/s) */
fc->length = (fc->totalsamples / fc->samplerate) * 1000;
That's integer division, so if the track is shorter than a second, the result is zero. For example, here's GDB after playing Worms - Jock - Ya Can What Side Yer On.flac Worms - Jock - Ya Numpty.flac on the r20528 5G iPod sim:
Program received signal SIGFPE, Arithmetic exception.
[Switching to thread 4880.0x818]
0x030a16d5 in flac_init (fc=0x6adfcb0, first_frame_offset=0)
at /home/Boris/rockbox-dev/apps/codecs/flac.c:175
175 fc->bitrate = ((fc->filesize-fc->metadatalength) * 8 ) / fc->length;
(gdb) p fc->totalsamples
$1 = 16383
(gdb) p fc->samplerate
$2 = 22050
(gdb)
Edit: The files are so short that later ones get decoded into the PCM buffer while the first one is playing. Only one file is shorter than a second.
Job Van Dam:
Dreamlayers is very correct.
I tried a FLAC from the site he provided, plays fine.
I even converted an MP3 I have using Goldwave (that's longer than a second) and that plays fine.
Am I the only Rockbox user who listens to sound effects? :-[
Thank you very, very much Dreamlayers for helping me out and finding the problem.
Everyone else as well for helping me out too.
UPDATE: Added to bug tracker
Navigation
[0] Message Index
[*] Previous page
Go to full version