Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Simulator problems

Re: Simulator problems

From: Frederic Devernay <frederic.devernay_at_m4x.org>
Date: 2005-10-09

Ryan,

I pointed out this problem several months ago, but it appeared other
developpers didn't care, mainly because they were using the win32
simulator, which strips down debug info. Having debug info in the X11
simulator is still very valuable, so here's the patch I proposed.

I doesn't destroy anything, here's what it does is:
- if the loaded coded has a size of exactly CODEC_SIZE, then there is
VERY probably an error, like the codec being too large (in apps/codec.c).
- double CODEC_SIZE on h120 and h100 simulator (should it be raised on
other targets too?)

Now that two of us have this problem, maybe the patch will be applied.

Fred

Index: apps/codecs.c
===================================================================
RCS file: /cvsroot/rockbox/apps/codecs.c,v
retrieving revision 1.14
diff -u -r1.14 codecs.c
--- apps/codecs.c 29 Aug 2005 21:15:20 -0000 1.14
+++ apps/codecs.c 9 Oct 2005 09:35:38 -0000
@@ -308,7 +308,8 @@
     
     rc = read(fd, &codecbuf[0], CODEC_SIZE);
     close(fd);
- if (rc <= 0) {
+ /* if rc == CODEC_SIZE, then the codec is probably larger than that */
+ if (rc <= 0 || rc == CODEC_SIZE) {
         logf("Codec read error");
         return CODEC_ERROR;
     }
Index: firmware/export/config-h100.h
===================================================================
RCS file: /cvsroot/rockbox/firmware/export/config-h100.h,v
retrieving revision 1.47
diff -u -r1.47 config-h100.h
--- firmware/export/config-h100.h 24 Sep 2005 09:06:31 -0000 1.47
+++ firmware/export/config-h100.h 9 Oct 2005 09:35:38 -0000
@@ -42,7 +42,11 @@
 #define HAVE_SW_POWEROFF
 
 /* The number of bytes reserved for loadable codecs */
+#ifdef SIMULATOR
+#define CODEC_SIZE 0x80000
+#else
 #define CODEC_SIZE 0x40000
+#endif
 
 /* The number of bytes reserved for loadable plugins */
 #define PLUGIN_BUFFER_SIZE 0xC0000
Index: firmware/export/config-h120.h
===================================================================
RCS file: /cvsroot/rockbox/firmware/export/config-h120.h,v
retrieving revision 1.9
diff -u -r1.9 config-h120.h
--- firmware/export/config-h120.h 24 Sep 2005 09:06:31 -0000 1.9
+++ firmware/export/config-h120.h 9 Oct 2005 09:35:38 -0000
@@ -38,7 +38,11 @@
 #define HAVE_SW_POWEROFF
 
 /* The number of bytes reserved for loadable codecs */
+#ifdef SIMULATOR
+#define CODEC_SIZE 0x80000
+#else
 #define CODEC_SIZE 0x40000
+#endif
 
 /* The number of bytes reserved for loadable plugins */
 #define PLUGIN_BUFFER_SIZE 0xC0000
Received on Sun Oct 9 11:38:20 2005


Page was last modified "Jan 10 2012" The Rockbox Crew
aaa