FS#12273 - use buflib for fonts
Attached to Project:
Rockbox
Opened by Jonathan Gordon (jdgordon) - Monday, 12 September 2011, 14:11 GMT
Last edited by Jonathan Gordon (jdgordon) - Saturday, 24 September 2011, 13:20 GMT
Opened by Jonathan Gordon (jdgordon) - Monday, 12 September 2011, 14:11 GMT
Last edited by Jonathan Gordon (jdgordon) - Saturday, 24 September 2011, 13:20 GMT
|
DetailsThis aims to put all font buffers into buflib (except sysfont which needs to be handled seperatly).
initial patch is ugly but works. obviously lots of clean up required but the general idea is: keep an array of buflib handles, each handle points to the struct font and the fonts buffer (this way we can store much more handles than anyone would dream of using instead of capping it based on not wanting to store more sturct fonts than needed). FONT_UI and FONT_REMOTEUI are special reserved indexes, otherwise any font_load() will return the next avilable id. once this initial work is done refcounting will be used to not load a font more than once. currently there is a buffer leak in skin_fonts.c when the skin is reloaded which needs to be fixed, otherwise this seems to be useable. No testing has been done on what happens when the buffer moves though. |
This task depends upon
Closed by Jonathan Gordon (jdgordon)
Saturday, 24 September 2011, 13:20 GMT
Reason for closing: Accepted
Additional comments about closing: in r30589
Saturday, 24 September 2011, 13:20 GMT
Reason for closing: Accepted
Additional comments about closing: in r30589
FS#12268for me.remove FONT_REMOTEUI completly and change FONT_UI to mean "any loaded ui font" (catchall for plugins mostly, needs to be fixed). FONT_SYSFIXED is now == -1 which causes other issues which also need to be dealt with but it is now used more like an error value.
the ui font id is now stored in global_status.font_id[screen] instead of the magic #define.
Still to be done: don't load the same font more than once, make sure all allocs are being freed correctly, test, fix plugins.
* add a plugin wrapper for setfont so FONT_UI and FONT_SYSFIXED still work there with a view that this will be removed *one day*
* remove all instances of lcd_setfont(0)
still need to:
* refcount fonts so we dont unload/load more than needed
* configurable cache size
* TEST!
e200 w32 sim
1. go to Settings -> Theme Settings -> Browse Theme Files
2. select cabbiev2
3. sim crashes
e200 Linux sim
1. go to Settings -> Theme Settings -> Browse Theme Files
2. select cabbiev2 multiple times
3. first select appears normal, second select outputs console message "font 2 not specified", third select outputs "font 3 not specified", etc.
4. buflib allocs shows font loaded multiple times - each time cabbiev2 is loaded, there is an additional font entry
e200 device
same as above - except no "font X not specified" messages
I am also seeing font corruption* when switching from cabbiev2 to a theme with sbs, or from that theme back to cabbiev2 - this can be reproduced on both the device and sim
1. reset settings
2. switch to to a theme with an sbs, such as SpartanBlack - http://themes.rockbox.org/download.php?themeid=507
3. font may be garbled, if not switch back to cabbiev2
*see attached screendump
I also saw backdrop corruption after copying files to the device and disconnecting USB, but have not been able to reproduce this.
still plenty of work to be done, viewports need a reliable way of having their font id's changed :/
Try this one which hopefully fixes Michaels issues. Hopefully the only crashes anyone sees is with playback running (which is a problem with r30480)
edit: known issue, switching themes could cause lines to dissapear in th elist, I suspect fontcache is broken
I still see font corruption, but it is now very intermittent. It seems to happen most often when switching themes after stopping playback.
Testing on the e200 sim, I am getting a segfault with the SpartanBlack theme when going into the fm screen. This theme does not use an fms but does use a custom ui. The gdb output is:
Program received signal SIGSEGV, Segmentation fault.
0x0808147a in skin_render (gwps=0x81ba990, refresh_mode=4294901760)
at /home/mc2739/rockbox/apps/gui/skin_engine/skin_render.c:740
740 skin_viewport = (struct skin_viewport *)viewport->data;
I went back and checked with fonts.2.diff and also saw the same segfault. Current svn does not have a problem with this theme.
I've also seen a strange thing testing on the e200 sim (with the --checkwps flag turned on): When switching between cabbiev2 and skins with FM screens (i.e., any of the ipodosha or iPhosha skins), I get a "font x not specified" message (where x is 2, 3 or 4--no pattern, no relation to the fonts actually loaded) on cabbiev2.wps, and sometimes the FMS as well; any screen with that message doesn't work. If I switch back to a non-cabbiev2 WPS screen, whether as a WPS or a theme, everything's OK; but when I try cabbiev2 again, the problems return. (I may need to try another FMS-free theme such as Spartan Black; I have it on my real e200, but not the sim.)
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 4 (X_DestroyWindow)
Resource id in failed request: 0x480000d
Serial number of failed request: 129
Current serial number in output stream: 129
The second time, I got a different error:
rockboxui: ../../src/xcb_io.c:221: poll_for_event: Assertion `(((long) (event_sequence) - (long) (dpy->request)) <= 0)' failed.
Aborted
The third time, I got a simplified form of Michael's message:
SDL_WaitEvent() error
Segmentation fault
I tried using Spartan Black with the FM screen set separately (i.e., the FMS from both ipodosha-v1.4 and iPhosha-v1.1); I got the second & third error messages again.
Finally, it seems only switching from ipodosha-v1.4 (or possibly other skins with FM screens) directly to cabbiev2 causes the "font x not specified" error. Switching between Spartan Black and the other skins is OK, even if you switch from ipodosha-v1.4 to Spartan Black and then immediately to cabbiev2.
Michael: are you seeing font corruption without changing themes/fonts?
The fm screen problem fails only on the sim, but on both win & linux sims. I thought it might have been due to using my preset file, but after removing that, it still crashes. When it asks to scan for presets, after answering yes or no the sim will crash.
And, I did link the theme earlier in this task when I first mentioned it. :) http://www.rockbox.org/tracker/task/12273#comment40657
I should note that the FMS skins of previous ipodosha versions 1.2 ( http://themes.rockbox.org/index.php?themeid=1369&target=sansae200 ) and 1.3 ( http://themes.rockbox.org/index.php?themeid=1407&target=sansae200 ), neither of which work in current builds, *do* work with this patch. Someone else wrote 1.2; I updated it to 1.3 merely by adding a 12-hour clock option. After discovering that the 1.3 FMS wouldn't run in current builds, I found in sim testing that the 35-point frequency display font wasn't loading; after trying the patch at
FS#12268(which worked) and some discussion in IRC (which also pointed me to this FS), I updated it to 1.4 by reducing glyphs & fonts in all three skins, which un-broke the FMS in current unpatched builds. (The iPhosha skin was written by the same guy who wrote ipodosha-v1.2 & earlier. Earlier versions of both designs are also on the themes site; all of them are among the 12 newest themes listed for the e200.)Though I've only tested this patch on the e200 (v1) Linux sim, I can confirm Michael's issues with Spartan Black there.
And I also haven't seen any font corruption other than AFTER changing skins. Once when font corruption appeared only in a viewport using a skin-defined, glyph-limited font (i.e., the clock in ipodosha-v1.4), reloading the theme made it go away. However, once font #1 is corrupted, the only solution is to restart the sim.
I can do a build for you if you want? I'd kill for feedback in the next 2 hours while I'm awake and working on this :)
There is a build problem due to a printf in apps/filetree.c line 431 (it was there in fonts.4.diff also)
Regarding the missing line, it is not just missing text, when it occurs on the browse themes list, if you press select on the blank line it does not load the theme that should be listed there, it reloads the current theme.
Program received signal SIGSEGV, Segmentation fault.
0x00485cac in buflib_get_name (ctx=0x6bdc04, handle=17) at /home/Steve/rockbox/firmware/buflib.c:701
701 size_t len = data[-1].val;
(gdb) bt
#0 0x00485cac in buflib_get_name (ctx=0x6bdc04, handle=17) at /home/Steve/rockbox/firmware/buflib.c:701
#1 0x00484fc2 in handle_to_block (ctx=0x6bdc04, handle=17) at /home/Steve/rockbox/firmware/buflib.c:164
#2 0x0048595a in buflib_free (ctx=0x6bdc04, handle_num=17) at /home/Steve/rockbox/firmware/buflib.c:554
#3 0x0047ab08 in core_free (handle=17) at /home/Steve/rockbox/firmware/core_alloc.c:35
#4 0x00435eeb in skin_data_free_buflib_allocs (wps_data=0x585670)
at /home/Steve/rockbox/apps/gui/skin_engine/skin_parser.c:1452
#5 0x004340eb in settings_apply_skins () at /home/Steve/rockbox/apps/gui/skin_engine/skin_engine.c:113
#6 0x0041c62e in settings_load_config (file=0x22f8c0 "/.rockbox/themes/Pen&Paper.cfg", apply=true)
at /home/Steve/rockbox/apps/settings.c:366
#7 0x00426f96 in ft_enter (c=0x543148) at /home/Steve/rockbox/apps/filetree.c:573
#8 0x0042172e in dirbrowse () at /home/Steve/rockbox/apps/tree.c:690
#9 0x00421ee2 in rockbox_browse (browse=0x22fbe0) at /home/Steve/rockbox/apps/tree.c:995
#10 0x004072b5 in browse_folder (param=0x48d1d4) at /home/Steve/rockbox/apps/menus/theme_menu.c:327
#11 0x00406752 in do_menu (start_menu=0x4915e8, start_selected=0x0, parent=0x0, hide_theme=false)
at /home/Steve/rockbox/apps/menu.c:579
#12 0x0041a244 in miscscrn (param=0x4915e8) at /home/Steve/rockbox/apps/root_menu.c:329
#13 0x0041a80f in load_screen (screen=3) at /home/Steve/rockbox/apps/root_menu.c:561
#14 0x0041a75a in root_menu () at /home/Steve/rockbox/apps/root_menu.c:732
#15 0x004053ec in main (argc=3, argv=0x3e4ea0) at /home/Steve/rockbox/apps/main.c:196
(gdb) print data
$1 = (union buflib_data *) 0x0
Steve: can you give a full repro recipe? which sim? whic themes? etc?
The source is from r30401, and apply the patch sucessfully.
[...]
/home/yzflcyq/PMP-Firmware-s-Rockbox-X/apps/filetree.c: In function ‘ft_load_font’:
/home/yzflcyq/PMP-Firmware-s-Rockbox-X/apps/filetree.c:432: warning: implicit declaration of function ‘printf’
/home/yzflcyq/PMP-Firmware-s-Rockbox-X/apps/recorder/albumart.c: In function ‘search_albumart_files’:
/home/yzflcyq/PMP-Firmware-s-Rockbox-X/apps/recorder/albumart.c:193: warning: implicit declaration of function ‘snprintf’
/home/yzflcyq/PMP-Firmware-s-Rockbox-X/test/apps/filetree.o: In function `ft_enter':
(.text.ft_enter+0x484): undefined reference to `printf'
/home/yzflcyq/PMP-Firmware-s-Rockbox-X/test/apps/filetree.o: In function `ft_enter':
(.text.ft_enter+0x484): relocation truncated to fit: R_MIPS_26 against `printf'
collect2: ld returned 1 exit status
make: *** [/home/yzflcyq/PMP-Firmware-s-Rockbox-X/test/rockbox.elf] 错误 1
Edit (ABuschmann): I just removed unecessary compile output.
I'm running an H300 sim (r30579 + fonts.6.diff) under Windows, compiled under Cygwin. Recipe is simple:
1) Start playback
2) Change theme (e.g. from Cabbiev2 to Pen&Paper). Sometimes Kaboom!
3) Change theme back (e.g. from Pen&Paper to Cabbiev2). Always Kaboom!
It happens with all themes I've tried so far - I suspect they all change font though. I do have voice menus and dircache enabled - my config.cfg is attached.
I added some printfs to log all changes to alloc... looks like we're trying to free something (handle 17) twice...
Entering settings_apply_skins
freeing skin 0, screen 0
Entering skin_data_free_buflib_allocs
Leaving skin_data_free_buflib_allocs
freeing skin 0, screen 1
Entering skin_data_free_buflib_allocs
Entering buflib_free handle_num=17
Entering buflib_free handle_num=18
Entering buflib_free handle_num=19
Entering buflib_free handle_num=20
Entering buflib_free handle_num=21
Entering buflib_free handle_num=22
Entering buflib_free handle_num=23
Entering buflib_free handle_num=24
Entering buflib_free handle_num=25
Entering buflib_free handle_num=26
Entering buflib_free handle_num=27
Entering buflib_free handle_num=28
Entering buflib_free handle_num=29
Entering buflib_free handle_num=30
Entering buflib_free handle_num=31
Entering buflib_free handle_num=32
Entering buflib_free handle_num=33
Entering buflib_free handle_num=34
Entering buflib_free handle_num=35
Entering buflib_free handle_num=36
Entering buflib_free handle_num=37
Entering buflib_free handle_num=38
Entering buflib_free handle_num=39
Entering buflib_free handle_num=40
Entering buflib_free handle_num=41
Leaving skin_data_free_buflib_allocs
freeing skin 1, screen 0
Entering skin_data_free_buflib_allocs
Leaving skin_data_free_buflib_allocs
freeing skin 1, screen 1
Entering skin_data_free_buflib_allocs
Entering buflib_free handle_num=42
Entering buflib_free handle_num=43
Entering buflib_free handle_num=44
Entering buflib_free handle_num=45
Entering buflib_free handle_num=46
Entering buflib_free handle_num=47
Entering buflib_free handle_num=48
Entering buflib_free handle_num=49
Entering buflib_free handle_num=50
Leaving skin_data_free_buflib_allocs
freeing skin 2, screen 0
Entering skin_data_free_buflib_allocs
Entering buflib_free handle_num=17
Program received signal SIGSEGV, Segmentation fault.
0x00485d9c in buflib_get_name (ctx=0x6bdc04, handle=17) at /home/Steve/rockbox/firmware/buflib.c:706
706 size_t len = data[-1].val;
Hope this is useful.
(Edit - updated trace for clarity.)
I've applied the newest patch to r30579 and loaded it to both my e200 Linux sim and my live e280; the latter required a commented-out printf() in filetree.c.to compile (as Buschel suggested). So far, the biggest issue seems to be multiple theme changes during a session, especially during playback. Several times when the final theme change on the live target was to ipodosha-v1.4 (previously linked), the scroll wheel became unusuably slow until after a reboot. The live target also crashed once when the final switch was to SpartanBlack (also previously linked), but I was in bed and don't recall the exact steps or the error message; I wasn't able to reproduce it.
Since ipodosha-v1.4 uses a larger default font (15 points vs. 12 for cabbiev2 and 11 for SpartanBlack), it's very much possible that larger default fonts contribute to this issue. It may also be related to use of an SBS skin with viewports; cabbiev2 doesn't have an SBS, but both ipodosha-v1.4 and SpartanBlack do (though the latter seems to have less problems).
I'm also still getting the crash when opening the FM radio (with or without a skin) on SpartanBlack, but *only* in sim--*not* on the live e200. I'll have to recompile the sim without the patch to verify; but since it's in sim only with one theme only, I suspect it may be unrelated to this patch. (The sim also crashed once when entering FM with the cabbiev2 theme and ipodosha-v1.4's FMS--neither cabbiev2 nor SpartanBlack explicitly clears the FMS when changing; but I couldn't reproduce it.) The other problems I noted with patch 4 in the sim (font corruption, inappropriate "font x not specified" messages) are gone.
One other oddity: Sometimes when changing the theme (especially to ipodosha-v1.4) during playback, after interruption the sim restarted the track at the beginning. (I haven't done enough testing during playback with the live target to confirm if it happens there also.) However, like the multiple-change issue, that most likely involves default and/or SBS fonts; playback was only briefly interrupted as expected, not restarted, when changing FMS skins (even to ipodosha-v1.4's FMS with 35-point frequency-display font, albeit glyph-limited).
One tiny thing I noticed (although not in your patch...) - I don't think buflib.c needs to do handle->alloc = NULL after calling handle_free().
(a) Michael's crash when launching the FM radio with SpartanBlack still exists. (I confirmed that it does *not* exist in unpatched SVN.) However, it didn't happen on my live e200 target with r30579 + patch 6 (I haven't updated it yet), so IMO it's insignificant.
(b) The *first* time I load the ipodosha-v1.4 theme during playback, the track restarts at the beginning. It does *not* happen with cabbiev2 or SpartanBlack, nor on second or subsequent loads of ipodosha-v1.4 while playing the same track. From reviewing --debugwps messages, it appears the first simultaneous change of all three skins causes the sim to forget the track's resume point; of the three themes I'm testing, only ipodosha-v1.4 has an FMS skin. (It doesn't happen when manually changing any skin.) I haven't compiled the update for the live target yet; I'll check that later.
/home/ubuntu/rockbox/apps/recorder/albumart.c: In function ‘search_albumart_files’:
/home/ubuntu/rockbox/apps/recorder/albumart.c:193: warning: implicit declaration of function ‘snprintf’
(a) As with the sim, switching to ipodosha-v1.4 during playback results in the track restarting. However, the behavior is slightly different on live target: It first pauses and continues playing, then pauses again and restarts; I believe it paused slightly again before continuing. That seems to confirm the playback reset is caused by too-quick loading of either the FMS or (most likely) WPS skin.
(b) A multiple theme switch in the sequence ipodosha-v1.4 -> cabbiev2 -> SpartanBlack normally (but not always) causes a crash: "Data abort at 000FDEC (0)". After hard power-off and reboot, the theme is still cabbiev2.
(c) There are several circumstances in which initially loading ipodosha-v1.4 may cause the scroll wheel to become unresponsive. Without playback, it has been seen several times (but not always) if SpartanBlack has been previously loaded. During playback, however, I've seen it (along with font corruption, and sometimes power-off being unresponsive except for hard power-off) in other circumstances, such as when switching from it to cabbiev2 and back again. However, everything is OK after a reboot.
As before, Michael's FM issue with SpartanBlack on the sim does *not* occur on the live target.
Since the theme links were posted much, much earlier in the thread, I'll post them again:
ipodosha-v1.4: http://themes.rockbox.org/index.php?themeid=1416&target=sansae200
SpartanBlack: http://themes.rockbox.org/index.php?themeid=507&target=sansae200
for( i = 0; i < alloc->font.cache._capacity ; i++ ) alloc->font.cache._index[i] += diff;
Fred: You 100% sure? that _index is an integer not a pointer. though it does look like font_cache_get() needs to lock the font handle as it does disk access
AFAIK the short interruption when changing themes is unavoidable as buflib may (if not "will") have to reallocate the audio buffer. The bug I was referring to was restarting *after* interruption at the *beginning* at the track, instead of where it was interrupted.
FS#12279cool! github lets you edit+commit changes from the website :) I wont be doing an update till sat night (sunday more likely) but pull from github or just add "pf->font.cache._index += diff;" to buflibmove_callback().
https://github.com/jdgordon/rockbox
edit: also pushed an untested change to lock the handle when doing a cache lookup from disk
CC firmware/font.c
/home/ubuntu/rockbox/firmware/font.c: In function ‘buflibmove_callback’:
/home/ubuntu/rockbox/firmware/font.c:105:5: error: ‘pf’ undeclared (first use in this function)
/home/ubuntu/rockbox/firmware/font.c:105:5: note: each undeclared identifier is reported only once for each function it appears in
/home/ubuntu/rockbox/firmware/font.c: In function ‘load_cache_entry’:
/home/ubuntu/rockbox/firmware/font.c:565:18: warning: initialization makes integer from pointer without a cast
/home/ubuntu/rockbox/firmware/font.c:567:29: error: ‘struct buflib_alloc_data’ has no member named ‘pf’
/home/ubuntu/rockbox/firmware/font.c: In function ‘pf_to_handle’:
/home/ubuntu/rockbox/firmware/font.c:639:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘for’
/home/ubuntu/rockbox/firmware/font.c:639:10: error: ‘i’ undeclared (first use in this function)
/home/ubuntu/rockbox/firmware/font.c:645:29: error: ‘struct buflib_alloc_data’ has no member named ‘pf’
/home/ubuntu/rockbox/firmware/font.c: In function ‘font_get_bits’:
/home/ubuntu/rockbox/firmware/font.c:667:13: warning: passing argument 4 of ‘font_cache_get’ makes pointer from integer without a cast
/home/ubuntu/rockbox/firmware/include/font_cache.h:47:26: note: expected ‘void *’ but argument is of type ‘int’
make: *** [/home/ubuntu/rockbox/build-sim/firmware/font.o] Error 1
Will attempt to apply the simple update and see what happens there.
alloc->font.cache._index += diff;
CC firmware/font.c
/home/ubuntu/rockbox/firmware/font.c: In function ‘buflibmove_callback’:
/home/ubuntu/rockbox/firmware/font.c:105:5: error: ‘pf’ undeclared (first use in this function)
/home/ubuntu/rockbox/firmware/font.c:105:5: note: each undeclared identifier is reported only once for each function it appears in
/home/ubuntu/rockbox/firmware/font.c: In function ‘load_cache_entry’:
/home/ubuntu/rockbox/firmware/font.c:565:18: warning: initialization makes integer from pointer without a cast
/home/ubuntu/rockbox/firmware/font.c:567:29: error: ‘struct buflib_alloc_data’ has no member named ‘pf’
/home/ubuntu/rockbox/firmware/font.c: In function ‘pf_to_handle’:
/home/ubuntu/rockbox/firmware/font.c:639:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘for’
/home/ubuntu/rockbox/firmware/font.c:639:10: error: ‘i’ undeclared (first use in this function)
/home/ubuntu/rockbox/firmware/font.c:645:29: error: ‘struct buflib_alloc_data’ has no member named ‘pf’
/home/ubuntu/rockbox/firmware/font.c: In function ‘font_get_bits’:
/home/ubuntu/rockbox/firmware/font.c:667:13: warning: passing argument 4 of ‘font_cache_get’ makes pointer from integer without a cast
/home/ubuntu/rockbox/firmware/include/font_cache.h:47:26: note: expected ‘void *’ but argument is of type ‘int’
make: *** [/home/ubuntu/rockbox/build-sim/firmware/font.o] Error 1
Now I'll have to see if the unpatched font.c actually works...
Fred: yep, I dont really tihnk a cache for each font is a good idea, the glyphs indexes are not font specific (they are the char codes), Though sure depending on the theme different fonts would use different chars more often, I tinhk for now just using the one .glyphcache like svn does is the way to go, then later we can revist this.
(a) Been getting this one (and ignoring it) all along:
CC apps/recorder/albumart.c
/home/ubuntu/rockbox/apps/recorder/albumart.c: In function ‘search_albumart_files’:
/home/ubuntu/rockbox/apps/recorder/albumart.c:193:13: warning: implicit declaration of function ‘snprintf’
(b) Font.c warnings (JD, I assume these are your "ignorable" ones):
CC firmware/font.c
/home/ubuntu/rockbox/firmware/font.c: In function ‘load_cache_entry’:
/home/ubuntu/rockbox/firmware/font.c:565:18: warning: initialization makes integer from pointer without a cast
/home/ubuntu/rockbox/firmware/font.c: In function ‘font_get_bits’:
/home/ubuntu/rockbox/firmware/font.c:667:13: warning: passing argument 4 of ‘font_cache_get’ makes pointer from integer without a cast
/home/ubuntu/rockbox/firmware/include/font_cache.h:47:26: note: expected ‘void *’ but argument is of type ‘int’
However, rockboxui crashes on launch (with or without --debugwps):
SDL_WaitEvent() error
Segmentation fault
Think I'll retry the other (just in case my crash was due to the make interruption) before testing on live target.
Will revert to my "simple" patch before testing on live target.
Most (but not all) of the time--contrary to JD's previous statement (though fixing his bug might help)--playback no longer reverts to the track's beginning when loading ipodosha-v1.4 while playing, though the theme-change process is still slow while playing MP3s. (FM radio playback doesn't appear to affect theme changing at all.) The player doesn't even pause when switching to SpartanBlack, or when switching skins within themes.
All in all, looks like we're almost there. If JD can fix the remaining issues with his full patch, it might be ready to go.
.text 0x00005fdc 0x2c4 /home/ubuntu/rockbox/build/apps/menus/theme_menu.o
CC firmware/font.c
/home/ubuntu/rockbox/firmware/font.c: In function ‘load_cache_entry’:
/home/ubuntu/rockbox/firmware/font.c:565:18: warning: initialization makes integer from pointer without a cast
/home/ubuntu/rockbox/firmware/font.c: In function ‘font_get_bits’:
/home/ubuntu/rockbox/firmware/font.c:667:13: warning: passing argument 4 of ‘font_cache_get’ makes pointer from integer without a cast
/home/ubuntu/rockbox/firmware/include/font_cache.h:47:26: note: expected ‘void *’ but argument is of type ‘int’
The only difference in warnings between sim and live compiles was it omitted the second number in each file reference (i.e., font.c:565 instead of font.c:565:18); that's probably just different gcc versions. I'm still working on USB-related issues before I can load it to the live target.
int handle = &buflib_allocations[(int)callback_data];
It seems you're declaring handle as an integer here, but other parts of the code are expecting something else.
The other two warnings are apparently due to handle being passed to font_cache_get() as an integer; that could very well have caused the segfault crash (sim) or font corruption (live target).
CC apps/recorder/albumart.c
/home/yzflcyq/rockbox/apps/recorder/albumart.c: In function ‘search_albumart_files’:
/home/yzflcyq/rockbox/apps/recorder/albumart.c:193:13: warning: implicit declaration of function ‘snprintf’
I added #include <stdio.h> to the start of albumart.c and the warning goes.
I forgot to bring my DAP back to home :( I'll test this great job next week.