hiby: raise the plugin buffer to 2MiB on the 64MB targets

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Mon, 27 Jul 2026 07:31:18 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 4f6aac445f8e32cb4c721032dc2acb47c693fb13
Author: Michael McAllister <[email protected]>
Date:   Sun Jul 26 20:57:02 2026 +0100

    hiby: raise the plugin buffer to 2MiB on the 64MB targets
    
    PictureFlow refuses to start on the larger panels in this family with
    "Not enough memory for album art cache", no matter how small the
    library is.
    
    It is PF_PLAYBACK_CAPABLE here, so it deliberately takes the plugin
    buffer instead of stealing the audio buffer in order to keep playback
    running. It then gives a quarter of that buffer to its album art cache,
    which needs DISPLAY_WIDTH * DISPLAY_HEIGHT * sizeof(pix_t) bytes:
    
      HiBy R1        480x800  ->  400x533  ->  416 KiB
      HiBy R3 Pro II 480x720  ->  360x480  ->  338 KiB
      Surfans F28    320x480  ->  240x320  ->  150 KiB
    
    A quarter of 512KiB is only 128KiB, so all three fail the check before
    they ever look at the library. The rest of the family tops out at
    320x240 and needs at most 68KiB, which is why the old value went
    unnoticed.
    
    Most hibyos devices only have 32MB of RAM in total, and the OS and its
    daemons eat about two thirds of that, so there is nothing spare to hand
    out and the buffer stays at 512KiB. The three affected targets happen to
    be exactly the 64MB ones, and they are also the only members of the
    family configured with MEMORYSIZE >= 16, so key the size off that.
    
    Plugins are dlopen()ed on hosted targets, so pluginbuf is plain BSS and
    plugin.lds/DRAMSIZE do not apply.
    
    Change-Id: I38db01231bbb8d139cb2239623a79250e0e46b61

diff --git a/firmware/export/config/hibylinux.h b/firmware/export/config/hibylinux.h
index 98e8893a41..1b2e2deee4 100644
--- a/firmware/export/config/hibylinux.h
+++ b/firmware/export/config/hibylinux.h
@@ -39,7 +39,11 @@
 #define CODEC_SIZE 0x100000
 
 /* The number of bytes reserved for loadable plugins */
-#define PLUGIN_BUFFER_SIZE 0x80000
+#if MEMORYSIZE >= 16
+#define PLUGIN_BUFFER_SIZE 0x200000 /* 2 MiB */
+#else
+#define PLUGIN_BUFFER_SIZE 0x80000  /* 512 KiB */
+#endif
 
 #define CONFIG_LCD LCD_INGENIC_LINUX
 
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs