Commit graph

38412 commits

Author SHA1 Message Date
Solomon Peachy
b497e71708 hibylinux: Shrink PLUGIN_BUFFER to 512K
Hosted platforms use dlopen() for plugin loading, and hibylinux is
relatively RAM constrained, so shrink this will free up more memory to
the OS for plugins to use.

Change-Id: I6b7cb17b964eaf5afc4958db242dfe4b82178e2e
2025-09-13 08:44:38 -04:00
Solomon Peachy
32d52e0415 hosted: Shrink audiobuffer to (MEMORY_SIZE-1) megabytes
This represents a 256K increase from the former (MEMORYSIZE-0.75), and
is necessary due to the growth in our binary sizes over the past decade
or so.

It is debatable if this is enough given that our actual memory
usage is approximately (MEMORYSIZE+3) megabytes (plus runtime OS
overhead) for the typical hosted build, but giving the host OS a bit
more breathing room is warranted.

Change-Id: I53e044585a32efd50a85e68d64fd21921eda01a3
2025-09-12 23:15:11 -04:00
Solomon Peachy
161f8c0e24 configure: Document the 'memory' parameter for hosted builds
Change-Id: I49979cf20fd5405bbb90dff297f5e695e046f2b9
2025-09-12 20:50:17 -04:00
Solomon Peachy
a2c10f6189 unicode: Support characters beyond the first unicode plane
We used 16-bit variables to store the 'character code' everywhere but
this won't let us represent anything beyond U+FFFF.

This patch changes those variables to a custom type that can be 32 or 16
bits depending on the build, and adjusts numerous internal APIs and
datastructures to match.  This includes:

 * utf8decode() and friends
 * font manipulation, caching, rendering, and generation
 * on-screen keyboard
 * FAT filesystem (parsing and generating utf16 LFNs)
 * WIN32 simulator platform code

Note that this patch doesn't _enable_ >16bit unicode support; a followup
patch will turn that on for appropriate targets.

Appears to work on:

  * hosted linux, native, linux simulator in both 16/32-bit modes.

Needs testing on:

  * windows and macos simulator (16bit+32bit)

Change-Id: Iba111b27d2433019b6bff937cf1ebd2c4353a0e8
2025-09-12 09:24:30 -04:00
Hairo R. Carela
2a88253426 rbutil: add qt version check for setIniCodec
QSettings::setIniCodec was deprecated in qt6, this fixes building with it.
Change-Id: Icd2ac05bb0a9f56181823a25a9307ac791664d88
2025-09-11 21:39:52 -04:00
Christian Soffke
fe038d5d4b manual: album art tag: fix width/height mixup
Change-Id: Ied765faba5256dc383fbd5a133fc58e2317bdda4
2025-09-10 22:30:03 +02:00
Solomon Peachy
471624a75d DSP: put filter_process() into IRAM on all PP50xx CPUs
(Instead of just the slowest 500x family)

Change-Id: I39229d8765ff8c07da115e71909a60546597f603
2025-09-10 08:21:23 -04:00
Solomon Peachy
c6db7114f8 as3525: Fix build warning with newer toolchains
Change-Id: I3dad32caf0dc087b717ed76b900f414aa1608bc2
2025-09-09 10:03:22 -04:00
Solomon Peachy
01a62372ff flac: Fix build on Cowon D2.
Not enough IRAM on this target to support larger MAX_BLOCKSIZE even with
only 2ch.

Change-Id: I91675b9eb294f8af3f7d17aa9c76c7cb83ce0bd7
2025-09-09 08:09:45 -04:00
Christian Soffke
c5e5a537c0 shortcuts: respect talk_menu setting when deleting shortcut
Change-Id: I6f06db5a41c402eeb3703a25c5d51fd0e4fe354f
2025-09-09 05:59:38 +02:00
Solomon Peachy
a98a8ce131 FLAC: Conditionally increase MAX_BLOCKSIZE to 8KB
High-frequency files increasingly use a block size of over 4608B, which
means we need larger buffers to decode them.  However, larger buffers no
longer fit in IRAM on less-capable devices, hurting performance for
"normal" file playback.

On our slowest devices (M68K and PP-based devices), this is not worth
the tradeoff as they will likely not have enough CPU oomph to decode and
downmix these files in realtime.

S5L87xx-based devices have the raw performance to do this, so we decided
to err on the side of wider file compatibility at the cost of some
performance.

All other devices are unaffected.

Change-Id: I7344cf4c8c6b7b5c14f1ea67381160665d6ece5b
2025-09-08 22:51:46 -04:00
Christian Soffke
ebe961a2a8 plugins: playing time: fix possible stack overflow
Change-Id: Ieb38e84e8c4126741d4630de3594fd16a360d1ed
2025-09-09 02:29:49 +02:00
Solomon Peachy
eb03c7b4d0 build: Newer toolchains need a few tweaks to linker options.
Pull those fixes in now

Change-Id: I71c373ecc9d062ca997eb940c7d84a94e2d678aa
2025-09-07 15:40:44 -04:00
Solomon Peachy
e9b8413f49 Revert "Toolchains: Update to GCC 10.5.0"
I pushed the wrong working tree AGAIN

This reverts commit b92033f716.
2025-09-07 15:22:31 -04:00
Solomon Peachy
2c0bcc0be9 xrick: finally fix the red.
Change-Id: I1e0b4e2d77c8988a286051d391d99aeb7907f9c4
2025-09-07 15:21:59 -04:00
Solomon Peachy
b92033f716 Toolchains: Update to GCC 10.5.0
All toolchain dependencies are circa the GCC 10.5.0 release:

  GCC 10.5.0, binutils 2.40, gmp 6.2.1, mpfr 4.1.1, mpc 1.3.1, isl 0.24

Native:

 * arm - mini2g, nano2g works
       - ipod6g hangs at logo display
 * mips - xduoox3 works
 * m68k - binaries untested

Hosted:

 * arm - samsungypr0 works
 * mips - xduoox3ii works
 * Android NDK - unchanged at GCC 4.9.4

Change-Id: Ic157255d76030e66325719e64331f553cb7c4363
2025-09-07 15:11:52 -04:00
Solomon Peachy
5953569ce5 xrick: Fix up a questionable choice of include paths
Change-Id: I60589f2151270349176d10505c3d75ab00fff9d4
2025-09-07 15:11:52 -04:00
Solomon Peachy
79582121ea xrick: Fix Makefile construct that made xrick includes global
Change-Id: Iac8e3c0ff4bba6d5da70042fd47a23392f3133bf
2025-09-07 13:40:41 -04:00
Solomon Peachy
3f71709152 s5l77xx: Correct definitions of VICADDRESS(n) and AESINADDR
By switching them from (const void* volatile*) to (void* volatile*)

The 'const' bit was causing GCC>4 to optimize away writes to those
addresses when compiled with -Os, badly breaking the interrupt handler.

Change-Id: Ia4b0ca37e082bddf78e084b80a5e550894645f1a
2025-09-07 10:02:40 -04:00
Solomon Peachy
da02b5921f s5l8702: Clean up the IRQ handler code slightly
* move all state into IRAM
 * eliminate dummy variables
 * get rid of 'naked' attribute and (slightly wasteful) hand-written asm
   in favor of auto-created 'interrupt' code

Change-Id: Ie6a2e12a4c1a0faa6ae89504cf931657044bd457
2025-09-07 09:59:45 -04:00
Solomon Peachy
fb8b52eaf1 s5l8702: CONSTify the clocking setup
Change-Id: I88f7a2e176606b718d778a5a4a5756c4c4b58c03
2025-09-07 09:11:11 -04:00
Solomon Peachy
afa096e8b9 misc: More fallthrough annotations
Change-Id: Iec45e339005de79535f11d15e77e60ee1e53a5f9
2025-09-07 08:06:56 -04:00
Christian Soffke
978a486d87 plugins: pictureflow: adjust PF_TRACKLIST behavior
Clarifies presumably intentional fall-through for
PF_TRACKLIST and fixes unwanted behavior of
PF_TRACKLIST while scrolling, which may have
started playback instead of showing the track list.

(affected keymaps at the moment are only SANSA_FUZE_PAD,
SAMSUNG_YH820_PAD, SAMSUNG_YH92X_PAD, and FIIO_M3K_PAD)

Change-Id: I335dd1b4a2152caed966b73aaa189bcfddc79734
2025-09-07 04:57:43 +02:00
Solomon Peachy
34f34bb7f1 misc: Fix a small pile of warnings found with diagnostics turned way up
* possible null pointer dereferences
 * non-annotated fallthroughs in case statements

Change-Id: I2332e0e0a4203ceca0999291ead112b8ab94c613
2025-09-06 21:31:58 -04:00
Solomon Peachy
d51d49550c FS13585: Display corruption in robotfindskitten game
When you're using a "large" screen device, and the message doesn't need
to scroll, parts of the previous mesage are left behind.

Work around this by explicitly clearing the messgage with a loooong
blank string.

Change-Id: I02f7789eb6567e92ecca174c40dabc4b580ac045
2025-09-06 12:44:11 -04:00
Solomon Peachy
e4e50e36f1 rbcodec: Force use of -O2 for dsp code
We already use targeted optimization for most codecs, and the
DSP code is just as performance-sensitive.

Improves mp3 decoding performance by a whopping 1% wwhen PBE is
turned on.

Change-Id: I801a6624c0f7068b6cd67961ad3b08f809b92fca
2025-09-06 08:44:32 -04:00
Solomon Peachy
4de25f7020 font: glpyh_cache_load() is now NO_INLINE
It is particularly stack-heavy (>1.25K, >2.25K with 32-bit unicode)

Its only caller was font_load_ex() but that can be called recursively
which _really_ blew up the stack.

Change-Id: I211cd33ca3478b2bd01d3ddcf6c890399af2fb9c
2025-09-05 20:02:46 -04:00
Solomon Peachy
16c9ef64b0 misc: Ensure stacks are always aligned with the native pointer size.
Change-Id: Ie7efae914dcb43be98bbb71bae9b765b2d87d817
2025-09-05 19:43:11 -04:00
Solomon Peachy
695698b918 SID: Don't uselessly upconvert from 16bpp mono to 28bpp stereo
cRSID natively renders its output as a 16bit mono stream.  There's no
reason to not use it as-is, and save a bunch of CPU cycles in the
process.

Change-Id: Ib934c05e77298e377053b29db91d1f05fb65eb76
2025-09-02 20:19:22 -04:00
Solomon Peachy
6f7dbc2153 FS#13661: Major Spanish translation update (Sergio Delgado)
* Added some missing strings and updated some others that made no sense
   (were literal/poor translations).
 * More usage of music-relevant terms.
 * This translation fits a standard-internationally spoken Spanish,
   supported with the use of DLE (Spanish language dictionary) of RAE
   (Real Spanish Academmy)

Change-Id: Ie891520bcafe1e880e25dd42ce81393b1f10840d
2025-08-31 21:31:04 -04:00
Amaury Pouly
ac6822debb zen/zenxfi: fix incorrect dotclk polarity
By default STMP3700 launches from negative edge for capture on positive edge.
If we leave DPL (bit 13 of reg 0x13) to 0, it will be captured on falling edge,
resulting in a potentially undefined behavior. Some make sure LCD captures on
rising edge. Alternatively we could change the dotclk polarity in VDCTRL0.

Change-Id: I4ceb2f5a9be88e07f0af9bf493b7881883320fda
2025-08-31 20:50:22 -04:00
Solomon Peachy
4ad041e17a disk: Always try to mount the first partition on a disk.
We've received multiple reports from users of 6th gen iPods where we
fail to find any mountable partition.  A user was able to supply an MBR
dump, which showed that the "type" listed for parition 0 was set to 0x00
(ie "unused"), leading us to (correctly) completely ignore that entry.
However, it looks like the stock firmware ignores the type and
unconditionally uses the first entry even if it's nominally "invalid"

So, to deal with this, always try to mount partition 0 if it is not one
of the two "extended partition table" types.  If that speculative mount
succeeds, we now treat it as type 0x0c (Fat32 w/LBA) internally.

Note that this will not allow the partition to be mountable over USB, as
the MBR is still incorrect, leading the host OS to ignore the partition.
Further complicating things, the stock Apple firmware always constructs
a fake MBR to hand to the host!

To prevent user confusion with these devices, we may consider faking the
MBR too; alternatively we could correct the MBR and write it back to
disk, perhaps via a debug menu option.

Change-Id: I1e9392d20401eb94ecc6d70263fb0e45392a9bd4
2025-08-31 19:31:20 -04:00
Solomon Peachy
063b0357c3 FS#13660: Translation updates
Ukranian and German:  (Pavlo Rudy and Bernhard Kepplinger)

Change-Id: I89dc971ded1eafd79334f10a68144d5c5cbc3507
2025-08-31 13:17:07 -04:00
Hairo R. Carela
268a282da6 rgnano: Proper keylock support
Can use the advanced keylock menu options now.

Change-Id: If59b16ef5649c328558a74dd0601bc2f272c37b7
2025-08-30 17:20:31 -04:00
Christian Soffke
8418fc9078 tools: makefile: include wavtrim and voicefont in CLEANALL
Change-Id: I79040c0a5ac8dd68c46e984501e523efcc4c5f6f
2025-08-28 06:52:25 +02:00
Solomon Peachy
b21c477819 plugins: plugin_bss_start[] and plugin_end_addr[] are only for NATIVE builds
Change-Id: I5a856cd89126c3aa8f718536a8ddadfae80bb15a
2025-08-27 13:58:44 -04:00
Hairo R. Carela
a7a21bd311 rgnano: Some extra button mappings
We have a lot of buttons might as well use them.

Change-Id: Ic5ef6a38b2bdf2e1625886905fefb5343af3d6fb
2025-08-26 19:14:58 -04:00
Solomon Peachy
088806550b textviewer: Workaround for musl libc
musl doesn't unload shared objects when we dlclose() the handle.  This means
it also never re-initializes them if we try to re-launch.

This means that global state is persisted across invocations instead of
being wiped.  Until we come up with a proper workaround we can apply
globally, have the textviewer clean up the important global state when
it exits.

Change-Id: I43bf38e6e9f0e7d824931740daff6c060537235a
2025-08-26 17:20:43 -04:00
Solomon Peachy
9e3bb65228 database: Validate paths against MAX_PATH as well as TAX_MAXLEN
TAG_MAXLEN is 2* MAX_PATH, so this means we don't reject paths
that we could never actually open on the device.

Change-Id: I64363758163c0a6a5f54ebb1c9b455f3cb5b6e56
2025-08-25 10:46:16 -04:00
Solomon Peachy
31939086af database: Add much more verbose logging into database.log
Also turns database.log on for dbtool builds

Change-Id: I2d3fcfdd14cc7c354c84e37663b72920da564b84
2025-08-25 10:46:10 -04:00
Solomon Peachy
1690b393ad iriver: rename SECTOR_SIZE to FLASH_SECTOR_SIZE
Prevents collisions from the storage SECTOR_SIZE definition

Change-Id: I3f8fa56deaccb31c927a1eba677513f2ba8c24f2
2025-08-25 10:34:02 -04:00
Solomon Peachy
7de9d8dae5 limits: define PATH_MAX in only one place.
(This is the first step towards making it larger)

Change-Id: I4cea522074c455e04c8d228cf6463fb6500c41a0
2025-08-25 10:10:38 -04:00
Hairo R. Carela
6f107430f4 rgnano: Voltage and current measure support
Battery time estimation works now.

This commit also changes the mksquashfs path to FUNKEY_SDK_PATH.

Change-Id: Ic0aa4c40011b0716f1c36c014377eaccb486e841
2025-08-23 13:44:25 -04:00
Solomon Peachy
97ebba1fbd SD: Move sd_parse_csd() into common sdmmc code
This leaves firmware/driver/sd.c only containing storage API wrappers

Change-Id: I94f3f38c180f3802f479cdc54723fcd1b7782421
2025-08-22 14:48:28 -04:00
Christian Soffke
e10e3b2345 manual: backdrops: remove outdated info
Backdrops persist regardless of their location
in the file system since commit d09f978 (FS#12041):

"allows loading of backdrops from anywhere, and
keeps those backdrops after reboot."

Change-Id: I7b8cd2cdbca15b6d9ee7baae20a5d074c9765257
2025-08-21 17:05:09 -04:00
Solomon Peachy
1cd175a9fe build: Fix build on on 320x240 devices
(Regression introduced in 2aed517a07 )

Change-Id: If4b309a78f21b2730df2c63f5fac956901ff62bd
2025-08-21 15:28:54 -04:00
Hairo R. Carela
2aed517a07 Add 240x240 support to various plugins and rgnano manual updates
This should be all of the "standard" plugins (except sdl ones).

Change-Id: Iacae3edcc69a136a9dd887f31ad6ca51a9b5aea4
2025-08-20 20:50:42 -04:00
Solomon Peachy
a60c09c24c Revert "Toolchains: Update to GCC 10.5.0"
This reverts commit 94712b34d4.
2025-08-20 16:09:54 -04:00
Solomon Peachy
84504c7471 Revert "internals: Support characters beyond the first unicode plane (WIP)"
This reverts commit d05c59f35b.
2025-08-20 16:09:49 -04:00
Solomon Peachy
d05c59f35b internals: Support characters beyond the first unicode plane (WIP)
We used 16-bit variables to store the 'character code' everywhere but
this won't let us represent anything beyond U+FFFF.

This patch changes those variables to a custom type that can be 32 or 16
bits depending on the build, and adjusts numerous internal APIs and
datastructures to match.  This includes:

 * utf8decode() and friends
 * on-screen keyboard
 * font manipulation, caching, rendering, and generation
 * VFAT code parses and generates utf16 dirents
 * WIN32 simulator reads and writes utf16 filenames

Note that this patch doesn't _enable_ >16bit unicode support; a followup
patch will turn that on for appropriate targets.

Known bugs:

  * Native players in 32-bit unicode mode generate mangled filename
    entries if they include UTF16 surrogate codepoints.  Root cause
    is unclear, and may reside in core dircache code.

Needs testing on:

 * windows simulator (16bit+32bit)

Change-Id: I193a00fe2a11a4181ddc82df2d71be52bf00b6e6
2025-08-20 16:08:43 -04:00