Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Divide by zero error, 090322
« previous next »
  • Print
Pages: 1 [2]

Author Topic: Divide by zero error, 090322  (Read 6588 times)

Offline Job Van Dam

  • Member
  • *
  • Posts: 167
Re: Divide by zero error, 090322
« Reply #15 on: March 25, 2009, 10:05:30 AM »
Version: 3.2-090323
Logged

Offline dreamlayers

  • Developer
  • Member
  • *
  • Posts: 425
  • Boris Gjenero
    • My Blog
Re: Divide by zero error, 090322
« Reply #16 on: March 25, 2009, 11:55:55 AM »
Quote from: Job Van Dam on March 25, 2009, 02:16:37 AM
How do I find the SVN revision number?

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 ...

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.

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.
« Last Edit: March 25, 2009, 12:29:01 PM by dreamlayers »
Logged

Offline Job Van Dam

  • Member
  • *
  • Posts: 167
Re: Divide by zero error, 090322
« Reply #17 on: March 25, 2009, 08:03:54 PM »
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
« Last Edit: March 28, 2009, 11:27:24 PM by Job Van Dam »
Logged

  • Print
Pages: 1 [2]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  Divide by zero error, 090322
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.072 seconds with 16 queries.