Commit graph

39467 commits

Author SHA1 Message Date
William Wilgus
511d4dd90b FS#13876 strcasestr doesn't finds utf8 characters
fisxes regression from afb0e84

Change-Id: I44e2cd481300ed73aec82aaa65474132fd544b7c
2026-07-31 20:34:39 -04:00
Solomon Peachy
94ce143e06 Translation updates
* Polish (Adam Rak)
 * Slovak (Matej Golian)
 * US English (myself)

Change-Id: Ic74865b833189df091be97fd0e286c63bb2de36b
2026-07-31 09:15:32 -04:00
Gilad Schnurmacher
b5d512c409 iriver H300: fix remote-hold boot entry
Holding HOLD on the remote while powering on was incorrectly
detected as a bootloader mode entry request because remote_type()
was not yet initialized. Add sleep(HZ/8) after lcd_remote_init()
and re-check remote_button_hold() only if a remote is detected.

Fixes erratic bootloader entry on remote-connected H300.

Change-Id: Ic042cf5ff40713e93b2096d4ee48d7e1001ce4a5
2026-07-31 09:08:06 -04:00
Skye
e764656ab7 Allow customizing EQ filter types
Allows any EQ band to be set to any of Low Shelf, Peak, or High Shelf, instead of hardcoding the types per band.

Change-Id: I470ab916359092ba465e7b6331baed3bf11b2fc9
2026-07-30 07:48:45 -04:00
William Wilgus
1007216fc4 FS#13961 - Add audio status, file_attr constants to lua
use require "audio_status" to use the new AUDIO_STATUS_ defines
use require "file_attrs" to use the new FILE_ATTR_ defines

Change-Id: If0b3b612e92e9e5b361a9487ccca2d40f79a953e
2026-07-30 07:07:39 -04:00
Christian Soffke
db87622e7d fix yellow in 3af4e20
Change-Id: Ia0963934176ff4759a94af5bfe33fc61c95226fc
2026-07-30 12:53:00 +02:00
Christian Soffke
3af4e20792 skin_engine: fix div by 0 for %pP tag
Fixes possible crash during playback with
'Auto-Change Directory' setting enabled.

When the currently playing directory changes, the
skin may be updated on the main thread while the
playback thread is executing create_and_play_dir
and has yet to add any indices to the newly created
playlist.

Introduced in commit 41d5ca3.

Change-Id: I6e930f2db546c7690b362ba8c1a4907d0348ff52
2026-07-30 06:18:09 -04:00
Vencislav Atanasov
d42dcdcba2 rbutilqt/themeeditor: Allow specifying the Apple code signing ID using an environment variable
Co-authored-by: ChatGPT-5.5
Change-Id: Idd4624c7851f7fa37afac4de59f319e0087d0bc6
2026-07-29 22:55:40 +03:00
Solomon Peachy
58d4d2b221 desktop: Drop the 'version' fields
They refer to the *desktop file specification* not the application version

Change-Id: Ib35f460c73aae40961255826f0c767a22cb5b518
2026-07-29 10:27:35 -04:00
Christian Soffke
c54dddc2ac playback: fix Playlist Single Mode pause behavior (31dfd5da2e)
Don't pause after every track when playlist hasn't changed

Change-Id: Ic4f0261bb96ac1883c8d5857d0dd9db47b2e2c69
2026-07-28 19:54:59 +02:00
Roman Artiukhin
31dfd5da2e playback: add Playlist Single Mode option
Change-Id: I27c782ad246135fa6c98b52ed1491e86a7dfd456
2026-07-27 22:22:46 -04:00
Solomon Peachy
5f129ef299 tools: Update mkinfo to handle the echor1 target's symbols
With this change, RAM size is computed (and reported) properly.

Change-Id: I4ead8f677c69b78141b137e05d9da942dd4d8138
2026-07-27 20:27:30 -04:00
Michael McAllister
4f6aac445f 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
2026-07-27 08:03:54 +01:00
William Wilgus
24c3779146 rbsettings.lua add routines to write settings
supports most settings and status items allows writing
rockbox settings from lua

Change-Id: I852489fd9819c8f7147c922e1d03c4ed9ebafa53
2026-07-24 12:45:20 -04:00
Roman Artiukhin
8d84986fc0 pcm_mixer: fix active_channels handling in mixer_handle_sampr_change
`channel_stopped` compacts the `active_channels` array, so we should check the same index for the next active channel.

Change-Id: I54c42f9b6c97f0c54d43b8faae0052e856f3c06d
2026-07-23 21:17:13 -04:00
Roman Artiukhin
958e84c042 codec: flac: fix playback of certain files
Use flac_seek by time even when elapsedtime is 0, and apply it as a fallback for failed offset seeks since it provides more robust error recovery.

Change-Id: I438888fba02bda38137f3f1347bb1f657ef9c166
2026-07-23 20:27:57 +03:00
Michael McAllister
dbd53ef8ae hibyr1: implement USB DAC
Implement the USB Audio Class DAC on the HiBy R1 and R3ProII, driven by
the usb_audio setting from the scaffolding patch: the host plays audio
over USB and the player's CS43131 renders it.

The vendor kernel provides a UAC gadget function "uac_sa" whose char
device /dev/uac_sa delivers the host's PCM: the isochronous OUT frames
are converted to left-justified S16-in-S32 stereo and queued in a kernel
ring, drained with a non-blocking read(). The data path lives in
usb-dac-hiby.c -- a pump thread drains /dev/uac_sa into a small
single-producer/single-consumer ring and the mixer callback hands that
PCM to the codec through the normal ALSA output path. No resampling is
needed because Rockbox clocks the codec at the host-negotiated rate.

The DAC is built on the existing configfs gadget and binds the UDC like
ADB, while usb_power_only keeps the USB thread out of the way. In charge
mode it is a standalone self-bound gadget. In adb mode it is composed
alongside adb on one gadget so the host gets a sound card and adb at
once; uac_sa must be the first-linked function (audio interfaces 0-1)
because the vendor function hard-codes its interface numbers.

The pump is hardware-only, so usb-dac-hiby.c is excluded from simulator
builds; the usb_audio_get_active() playback-interlock stub lives with the
scaffolding.

The R3ProII shares this hosted HiBy port and the same userspace gadget,
and the data path is codec-agnostic, so nothing here is R1-specific.
Only the R1 has been validated on-device.

Co-Authored-By: Claude Opus 4.8
Change-Id: I64c57ede27f411a2c61d41a7e0fa127b51a7b5b9
2026-07-22 15:22:46 -04:00
Michael McAllister
ea775fa501 hibyr1: add USB DAC scaffolding
Introduce the generic, target-agnostic pieces for a gadget-driven USB
Audio Class DAC, gated by the HAVE_HOST_USB_AUDIO target flag so they stay
inert unless a target opts in.

Rather than adding a new USB mode, reuse the existing usb_audio setting
(never / always / while charge-only / while mass-storage) with its
LANG_USB_DAC string, usb_set_audio() callback and the
PCM_MIXER_CHAN_USBAUDIO mixer channel. HAVE_HOST_USB_AUDIO becomes the
umbrella capability flag for this common code; USB_ENABLE_AUDIO stays the
native usbstack class-driver contract (which needs HAVE_USBSTACK and so
cannot be used by hosted ports whose kernel owns the USB controller).

usb_set_audio() is declared here and implemented by the target (natively
by the usbstack driver, or in the hosted port for gadget targets, as with
usb_audio_get_active()), and applied at settings load. The playback
interlock in wps.c/playback.c keeps local playback from mixing with host
audio while the DAC is active. Simulator stubs for usb_set_audio() and
usb_audio_get_active() keep sim builds linking.

Co-Authored-By: Claude Opus 4.8
Change-Id: I5b7738508c24721d91d4c32379102a1ac7c6228b
2026-07-22 15:22:46 -04:00
Michael McAllister
8acd1c14d6 kernel: avoid divide-by-zero in thread_get_debug_info() for zero-size stacks
thread_get_debug_info() computes the current stack usage as
stack_used_current * 100 / thread->stack_size with no guard against a zero
stack size. On hosted targets the main thread has stack_size == 0, so
opening the "View OS stacks" debug screen divides by zero and panics with a
floating point exception.

Guard the division and report 0% when the stack size is unknown, which
matches the stack_usage() helper.

Likely affects all hosted non-SDL targets, but tested/confirmed on my
HiBy R1.

Change-Id: I8ecc56f53f1e97e8a59ca71c0e08a66093fecbae
2026-07-22 09:34:04 -04:00
Solomon Peachy
91774611cd uisimulator: Get rid of long-obsolete stub for mpeg_set_pitch()
Change-Id: Icbfa6917d0108d12a4428c8fe512c0a48385cdaa
2026-07-21 14:56:06 -04:00
Skye
f463f4a17a audiohw: remove unused BALANCE_CAP and CLIPPING_CAP
Change-Id: I8905e9a656fcba20c8adeb840d148bcd97511665
2026-07-20 12:47:12 -04:00
Aidan MacDonald
0ca801dffa themeeditor: only add -Wsfinae-incomplete if compiler supports it
This flag was added in GCC 16; older versions of GCC don't
accept it and don't produce the warning, so they don't need
any special handling.

Change-Id: I13fcba07cafe0b4133de8b03ede681d2454249e4
2026-07-19 11:17:05 +01:00
Aidan MacDonald
943b73851e playback: prevent crossfade of new track after pause (FS#13958)
Wipe the PCM buffer when starting playback from a paused state.
This prevents unwanted crossfade when manually pausing and then
selecting a new track.

Change-Id: I55e21004c12a2cd67417b627d471e3da115b7077
2026-07-18 14:08:27 -04:00
William Wilgus
f58038b687 luadir small cleanuo
luadir stores if a file was closed, we can get this by checking for a NULL
file handle instead

Change-Id: I95b8cc84afcdfc8515af8012afb1df64d0987fc4
2026-07-17 10:54:38 -04:00
William Wilgus
3ad3fba68e filebrowse.lua don't display parent path for files
when browsing the filename gets cut off due to the
length of the parent path

Instead strip the parent from the beginning for files

Change-Id: Ib9dadffabced89b5895420cb696227ca8cc444a2
2026-07-17 10:54:38 -04:00
William Wilgus
b481c4536e FS#13954 - Extra semicolon in file paths in get_files module
date and size still have them to separate the filename from attribs

Change-Id: I3fcaa7061d14493dab178d68398bea25f8ca67d6
2026-07-17 10:54:38 -04:00
Roman Artiukhin
8923f479d0 hiby: r3proii: fix crash on playback when no headphones are detected
0 is an invalid value to set on Hiby as "Output Port Switch". For devices with multiple outputs, we need to ensure it is set to a valid port.

Change-Id: I16ea2e620fae3034dccf3267d316924d8e2c0a95
2026-07-17 10:07:29 -04:00
Solomon Peachy
c35271a3f0 themeeditor: Silence a build warning
The warning comes from code generated by QT's MOC, so there isn't
anything to be done until QT addresses this properly.

Change-Id: Ia88ac9af91acbab783b683a6f0b4f4a304aa9e4d
2026-07-16 08:30:26 -04:00
Solomon Peachy
91d49adce2 rbutil: Silence the final build warnings when building with Clang
Change-Id: I65bb37993ef0ef6a0f373711ea16a417d0839cc5
2026-07-15 23:04:26 -04:00
Aidan MacDonald
f20086c91a asm: ARMv7-M: replace unity-gain write_samples() asm with memcpy
Change-Id: I164894d944136474b1b6ba1ce106f163a5db9642
2026-07-15 22:56:05 -04:00
Solomon Peachy
b4a0dc7274 rbutil: Ignore the deprecated warnings for macos builds
A replacement is in progress, so let's ignore those warnings in the mean time

Change-Id: Ic3123d2b37a21c6c0570619c387de0f1141c70f1
2026-07-15 21:16:56 -04:00
Solomon Peachy
6c4107d1ad libspeex: Silence a spurious warning under Clang
Change-Id: I9790e92dd9120afff83114925b8e6eb482d6e7df
2026-07-15 16:22:18 -04:00
Roman Artiukhin
0c29c97f1a hiby: r1: fix headphone detection
Change-Id: I4fdf47fb3585754428f6be804e65993e965c3914
2026-07-15 15:54:57 +03:00
Michael McAllister
078a506dfd hibyr1: route ADB through the usb-mode setting
hibyr1 defines HAVE_USB_ADB so the USB mode setting offers an ADB
entry, but hiby_set_usb_mode() never handled USB_MODE_ADB (it fell
through to default), so selecting ADB did nothing.

Wire USB_MODE_ADB up to enable_adb(). It builds the adb function on
the gadget and hands the functionfs mount and adbd to the vendor
respawner /sbin/adbserver.sh, rather than mounting functionfs inline
(which the original code flagged as flaky); adbd binds the UDC itself,
so usb_enable() leaves the UDC alone in ADB mode. disable_adb() unlinks
the adb function and unmounts its functionfs but leaves the function in
place to be reused, matching how adbserver.sh cycles it, so re-enabling
adb never re-creates it.

The mass-storage LUN is removable, so the host clears its backing file
when it ejects the volume (Linux does this on unmount). Re-arm the LUN
in usb_enable() on each connect, so the disk is exported on every
insert and not only the first.

Assisted-by: Claude Opus 4.8

Change-Id: Ia8f119a1a599e6dd3c1219cb4e193c753725a06a
2026-07-12 11:19:40 -04:00
mojyack
37943178f0 usb: Directly reference the "driver" in the endpoint data structure
Results in cleaner code versus effectively cut-n-pasting the driver's
completion callbacks into the endpoint structure.

Change-Id: I043c46c91796f787dec098a7db043481834950a0
2026-07-12 09:02:29 -04:00
Aidan MacDonald
7e6ae1e0d8 echoplayer: enable plugins
First pass at enabling plugins and setting up keymaps.

Change-Id: I3140160bcc3044850416904840b35065f86ac32d
2026-07-12 08:56:44 -04:00
Aidan MacDonald
862370982c stm32h743: implement timer API
Change-Id: Idcac3ab528e154097fb76fcfda78540ef02494df
2026-07-11 17:23:36 -04:00
Aidan MacDonald
c187b4c674 echoplayer: fix missing const qualifier on stm32 clocks
Change-Id: I295013b5af0e2aad77b5e284b351aaefde42df7c
2026-07-11 17:23:36 -04:00
Solomon Peachy
b9c7b0e910 fix: new yellow
for #pragma GCC diagnostic, GCC must be capitalized.

Change-Id: I1d760dd83b4dc29590454f4f4e09c5dface2c48f
2026-07-11 08:52:12 -04:00
Solomon Peachy
9ebe34d570 speex: Silence spurious build warning when building under rbutil
Change-Id: Ida23a960c54de1a46d0787795efb7b28b6427939
2026-07-11 08:04:10 -04:00
Solomon Peachy
4e770b4b87 rbutil: Add missing SAPI5 LANGID for Moldavian (ro_MD)
Change-Id: Ica67356d9bf71784543e17ea98abc8a8716d6fba
2026-07-10 22:12:11 -04:00
Solomon Peachy
2b6a8ffba2 rbutil: Get rid of all remnants of SAPI4 TTS support
Change-Id: I89cc53e2ebea273752c119e8c63f7eb36b1f22e0
2026-07-10 22:12:11 -04:00
Solomon Peachy
931fbb6734 rbutilqt: QtTTS: Pick a sane TTS engine/backend by default
* Ignore 'mock' tts engine
 * Must support synthesizing to a file (ie not just "speaking")
 * Don't claim 'speak' capabilities if the chosen engine does not

Change-Id: Id5fd224466ed62df5af837256fa66a340672d167
2026-07-10 08:08:39 -04:00
Solomon Peachy
8157759b7e rbutil: Rephrase optional component "not found" messages
Prevents builder from falsely failing builds and their builders.

Change-Id: I44df41416ef41401248132114ee586abde05d93e
2026-07-09 22:40:44 -04:00
Solomon Peachy
814979d49b rbutil: Enforce requirement of QT 6.6 or newer
Change-Id: I96064633c00ca2e13cfd9308a7f5d71cba7933cb
2026-07-09 20:32:34 -04:00
Solomon Peachy
d33d2f0840 rbutil: ttsqt: Bail if TTS engine doesn't support saving to file
Change-Id: Iaac0f77836727e5d8853d32a0b47c5d8d62b3365
2026-07-09 20:32:19 -04:00
Vencislav Atanasov
acba3fcb07 rbutilqt: Add the Qt TextToSpeech module as a new optional TTS engine
Co-authored-by: Qwen3.7-Plus
Change-Id: Ib6ddce52eee30139952e6597504ab96517dc15bd
2026-07-09 15:56:49 -04:00
Solomon Peachy
390d17893f rbutil: Rework TTS classes to use a stringlist for arguments
Instead of passing the entire cmdline as a single string that was
treated as the exectuable name on some platforms

Change-Id: Ic4f043a3a48e1b1bfab82bbfa8983c2d224606ec
2026-07-09 15:00:20 -04:00
Solomon Peachy
a9a4b3316f rbutil: Delete the long-disabled and very obsolete SAPI4 TTS code
Change-Id: I24f69cbe646d5c5ddb488a8a1912d028ec017acf
2026-07-09 14:58:37 -04:00
William Wilgus
ca7399821f FS#13953 - lua add get_files() to its own module
get_files(path, recurse, finddir, findfile, sort_by, cancel_fn, f_t, d_t)

get_files returns a sorted tables of directories and (another) of files

path is the starting path; recurse == false.. only that path will be searched

findfile & finddir are definable search functions
 if not defined all files/dirs are returned if false is passed.. none
  or you can provide your own function

sort_by can be by "name" "size" "date" or "none" to perform no sorting
 note: for "size" and "date" you may need to strip the attribute data to use
 the returned filename

cancel_fn if not defined or not a function no user cancel otherwise supply
    your own cancel function which returns true to cancel searching for files

f_t and d_t allow you to pass your own tables for re-use but isn't necessary

Change-Id: Ic4c2ad9c9b5abeeeeaf572880edbc8873d52066b
2026-07-09 12:45:05 -04:00