Commit graph

39524 commits

Author SHA1 Message Date
Aidan MacDonald
9039355bf8 timeout: include <stdint.h> for intptr_t
Change-Id: I5c5bd4e68d970f344b99e318f7818e4773bdda40
2026-08-22 06:42:02 -04:00
Aidan MacDonald
11817f99f8 stm32h7: sdmmc: handle CMD12 before second cache discard
Because DMA is still running until CMD12 is issued the second
cache discard must occur after CMD12, otherwise the cache may
contain a stale copy of data. While the buffer is garbage at
this point it's probably not a good idea to leave the buffer
in a weird state where the cache doesn't match what's in RAM.

Change-Id: I7caf91d17631c92686ef0ad6f148e6c1d1bcbfa0
2026-08-20 19:22:43 +01:00
Aidan MacDonald
f69ee23fa1 stm32h7: sdmmc: use sdmmc_host bus frequency helper
Change-Id: I6d58a95b08b8edb8a32088b3903403d84537ac12
2026-08-20 19:22:43 +01:00
Aidan MacDonald
b621a519e2 sdmmc_host: add helper to get bus frequency from enum
Change-Id: I5796d19a4c28986bbb3674a39cc93f3fa473ae3c
2026-08-20 19:22:43 +01:00
Aidan MacDonald
e3f622a851 Fix red in 2c5482cab9
The error is caused by grayscale >1bpp targets which do not
define LCD_RGBPACK().

Change-Id: Ifc995d720f11fe3df8ac534bd0777e162541dc54
2026-08-20 14:34:59 +01:00
neofright
2c5482cab9 splash: make iPod reFresh colour workaround pixel-format independent
The splash contrast workaround for the iPod reFresh themes compares
foreground and background colours against hard-coded RGB565 values.

This prevents the workaround from being applied on targets using other
pixel formats, such as XRGB8888 hosted targets.

Use LCD_RGBPACK() and SCREEN_COLOR_TO_NATIVE() to obtain the equivalent
colours for the active screen instead.

Code change and commit message generated by GPT-5.6 Sol. Compiled on
my hosted Eros Q build and confirmed working correctly.

Change-Id: Id15669bc7b8cec11bd4ee645c0b671db4499d2cd
2026-08-19 18:30:48 +01:00
Aidan MacDonald
0b52c28933 dircache: use alloca to avoid VLA in struct extension
Clang does not support VLA-in-struct so use alloca to
do the same thing by hand.

Change-Id: Ib135d1a90b00aac3098e4c64f9f5f5e397fe771c
2026-08-18 16:55:09 +01:00
Christian Soffke
8cfa4bfd8c quickscreen: update SBS after each button press
Quickscreen will ignore update_delay so that the SBS
is updated after each button press, without any lag.

The SBS may display settings that are adjusted by the
Quickscreen (e.g. cabbiev2's Shuffle and Repeat icons,
or the brightness slider included in themes like
Adwaitapod and Themify).

Change-Id: I28716e81cb77e235eb009bff91c96f510365f435
2026-08-16 16:33:38 +02:00
Christian Soffke
be62759005 quickscreen: fix MIN_LINES off-by-one
Appears to be a regression introduced in e454a39, where
MIN_LINES was increased from 4 to 5, along with changing
nb_lines <= MIN_LINES to nb_lines < MIN_LINES

The top and bottom sections are supposed to switch
from 2 to 1 lines if there are fewer available lines
than MIN_LINES.

Each of the three vertical section uses two lines,
resulting in overlapping viewports, if there are exactly
5 available lines.

Icons mentioned in the comment don't really play into
that.

Change-Id: I3a0e921d9f53a490fece0ce59457feaf84a80d3b
2026-08-16 16:33:37 +02:00
Christian Soffke
cacbd9aad2 skin_engine/quickscreen: get rid of unused code, update comment, naming
- remove quickscreen_set_option prototype left
  behind from commit a22749b
- make skin_load internal to the skin_engine
- remove skin_load's isfile parameter, since
  it's always true
- update comment for skin_data_load
- slight naming adjustments
- replace MAX_PATH with sizeof

Change-Id: I6fcbcf0d3e36730c5096f38d31f8e44b92498068
2026-08-16 14:39:43 +02:00
Aidan MacDonald
b616047311 usb-designware: fix ISO frame scheduling
The frame-scheduling logic cherry picked from the 'rockpod'
fork [1] was not correct for high-speed hosts and broke USB
Audio output.

The DWC seems to schedule based on the DWC_DSTS.SOFFN field,
which is a 14-bit microframe number for high-speed hosts. For
full speed hosts SOFFN is the LSB-aligned 11-bit frame number.

For high-speed hosts, USB Audio and iAP use a bInterval of 4
for the ISO endpoint which means the host sends a packet every
8 microframes. Thus, we only receive data on even microframes,
which is why adding frame scheduling broke things (and why we
got away with not doing it before).

For full speed the bInterval is 1, we get a packet each frame
and we do need to tell the core to receive on odd frames.

This code is still not completely correct for arbitrary ISO
endpoints -- for that we would need the function drivers to
provide the (micro)frame number on which they want to send or
receive.

Tested by forcing full speed at the device side by setting
USB_DW_DCFG_SPEED=3. USB Audio works fine in both high and
full speed modes now.

[1] c390dfdbdf

Change-Id: I17d283821cd0861e414c48208ca67f6e98464d7c
2026-08-15 20:41:56 +01:00
Solomon Peachy
459c5e7937 Move Hidizs AP80MAX to the 'unstable' list
This means it will end up in nightlies, get voice builds, etc.

Next up is to add it to the themesite..

Change-Id: I78dc77addebceb49773adaa3b70e9a457585fe62
2026-08-15 07:36:10 -04:00
Solomon Peachy
83d6948301 Fix yellow introduced in 9a80f5af55
(Back-to-back series of comment blocks had a missing closure in the middle)

Change-Id: I11f36687c6d35bea7cadd0e7975e3c897f68fd93
2026-08-15 07:33:31 -04:00
Solomon Peachy
8f8a0e5230 swvol: Switch to using WANT_SWVOL_32 in pcm_sw_volume.c
Change-Id: Id28c4f50144e60bc13fc834641b1a0a7491a36b8
2026-08-14 22:45:14 -04:00
Solomon Peachy
9a80f5af55 erosqnative: Updated documentation about an odd quirk of hw3/hw4 platforms
The ES9018K2M DAC used on hw3/hw4 defaults to 32-bit audio frames but
when configuring it to match the SoC I2S settings (ie 16 or 24-bit)
it results in garbled output for unexplained reasons.

Change-Id: If3074f38178b19520ca6222a1e020ea210069a6d
2026-08-14 22:42:07 -04:00
Skye
df85814e74
erosqnative: use hwvol at runtime on es9018k2m
Change-Id: I0ea89ff44a7d7c7c4aeb65ec2b56287324533bcc
2026-08-14 22:39:35 +09:00
Skye
9a7ffac2e4
pcm_sink: allow per-sink swvol/hwvol selection
Change-Id: I5b0a66f2e41ca32a2d6c88bda3ffe0db0df08ce0
2026-08-14 22:39:13 +09:00
Jerry Shen
51d7d56803 ap80max: New hosted port
HibyOS-based target: keymaps, LED, powermgmt, bootloader and sim support,
plus cabbiev2 for the new 360x640x16 screen. Opus 5 helped w/ debugging
and the initial scaffolding.

Updated name to FB_STRIDE_MISMATCH, added simulator bmp and specs.

Change-Id: If797ac6581cf75d9d1fcf36e615ee03cf6f905d6
2026-08-13 17:55:06 -07:00
Solomon Peachy
eded05f0cb FS13980: Updated rbutil Italian Translation (Alessio Lenzi)
Change-Id: Ic996de7db4a197858a7115627136d10a2f72be24
2026-08-13 12:36:50 -04:00
Solomon Peachy
0db3308e43 FS#13981 - Updated Russian Translation (Ivan Romaniuk-Mikhailovsky)
Change-Id: Ife14860048062922ac7b4eaffc42f9debe5a6ea2
2026-08-13 12:35:55 -04:00
Solomon Peachy
9641d54fee Fix remaining red from c93c7bfdcb -- dbtool and warble builds
Change-Id: I164aac856b821b9e7a96d807521912cb791e2152
2026-08-13 09:59:52 -04:00
Solomon Peachy
7e53e85cb2 Fix red in c93c7bfdcb -- Checkwps builds were failing
Change-Id: I5d81c35d4d31036954e094d6430ef31daa34642b
2026-08-13 09:36:46 -04:00
Aidan MacDonald
0e0982cb29 touchscreen: Kinetic scrolling v3
Tune accel/decel/press coefficients and add a braking force which
kicks in when swiping in the opposite direction of scrolling. This
is instead of the usual acceleration force.

Change-Id: I2b220c98674933a6957d6982020406342cd019bd
2026-08-13 08:24:51 -04:00
Aidan MacDonald
c93c7bfdcb touchscreen: Kinetic scrolling v2
Add configurable acceleration settings. There are 3 settings which
are applied at different times during scrolling. "accel" is used to
calculate the acceleration applied to the list based on the swipe
speed. "decel" determines the deceleration force applied based on
the list scroll speed, and "press" is an additional deceleration
force applied if you are pressing on the screen.

All settings have the general form:

    kinetic scroll accel: <a0> <a1> <delay>
    kinetic scroll decel: <a0> <a1> <delay>
    kinetic scroll press: <a0> <a1> <delay>

where the formula for the acceleration is "accel = a0 + a1*vel" and
"vel" is the input velocity (swipe speed for accel, list scroll speed
for decel/press).

The delay parameter is a value in milliseconds which acts as a grace
period where the acceleration will *not* be applied. For example, if
you specify 250ms for decel, then deceleration will not kick in until
250ms after scrolling starts. For press, the delay is based on the
duration of the touchscreen press.

All settings have sane default values and don't need to be configured
to enable kinetic scrolling; it is always enabled. But the settings are
there for those who want to tweak the behavior.

Change-Id: I9723b496b2b5d3fb3643af60b169754fdba497f0
2026-08-13 08:24:28 -04:00
Aidan MacDonald
a89e1f999d touchscreen: Add flick detector to touchscreen test
Change-Id: I9b41881e3e9a271f0532cc9c500e0511c606e895
2026-08-13 08:04:01 -04:00
Aidan MacDonald
814747492c touchscreen: Add flick gesture detector
Add a low-overhead detector for flick gestures, which are quick
swiping motions from the screen edges.

Change-Id: I3ef2dad328fdf566923575d437376e100a2ab8df
2026-08-13 08:03:37 -04:00
Aidan MacDonald
0ca22b9a71 touchscreen: Improved kinetic scrolling in lists
Kinetic scrolling now accelerates when repeatedly swiping over
the screen, so you can scroll through large lists easily without
using the scrollbar. Press & hold to slow down and stop.

Menu items can no longer be selected during a kinetic scroll
event, to reduce the chance of accidental selections.

Change-Id: I05b7d5fe6681a9edf53096b1fa265442fb31bf33
2026-08-13 08:02:29 -04:00
Roman Artiukhin
842492d77b hiby: r1_patcher: add macOS support
Change-Id: If9f11fc7fbac87275325f0f892c2546184714d0b
2026-08-12 11:21:10 +03:00
Solomon Peachy
fd8d6f10a1 synopsys-dwmac: Bugfixes
* Dedicated FIFO mode requires a non-zero multi-count for periodic INs
 * Add ISO frame polarity
 * Correct max packet size for high-speed ISOC operation

Change-Id: I2c0d40b5f8d0e1e4cf43369631f17c7f80c6fab2
2026-08-11 13:43:24 -04:00
Aidan MacDonald
444c9ce4bd manual: add touchscreen settings section
Change-Id: I5b9196fb79e7b67a4ac013fe10b8ad462cb8bfa8
2026-08-11 12:22:19 +01:00
Michael McAllister
ef20bc4c78 usb: keep the USB Serial setting across connects
Debug -> USB Serial calls usb_core_enable_driver(USB_DRIVER_SERIAL, ...), which sets a flag inside usb_core. usb_core_init() clears every driver's enabled flag on each connect and runs after the toggle, so the choice is gone before any descriptor is built: the menu reports the new state and nothing changes.

Hold the setting in firmware/usb.c and reapply it from usb_configure_drivers() on each connect, which is where the other drivers are already configured. usb_set_serial()/usb_get_serial() sit alongside usb_set_hid(), which works this way for the same reason.

toggle_usb_core_driver() goes with it: toggle_usb_serial() was its only
caller, and a generic wrapper around a call that cannot persist is not worth keeping.

Affects any target building USB_ENABLE_SERIAL.

Change-Id: I171a532d23cc9cf0efe0a01c2836b69846333a4d
Co-Authored-By: Claude Opus 4.8
2026-08-10 15:32:36 -04:00
Michael McAllister
6ad1fd074a usb: acknowledge SET_LINE_CODING in the serial driver
usb_serial_control_request() copies the line coding and returns handled = true without calling usb_core_control_response(). usb_core only answers requests a driver declines, so returning handled makes the status stage the driver's responsibility and nothing sends it. The host sees the request accepted and then times out waiting for status.

Every other branch in this function already responds but this one was missed.

Affects any target building USB_ENABLE_SERIAL. The symptom is a CDC console that enumerates and then stalls when a terminal opens it and sets the line rate.

Change-Id: Icd97805971c68ce3a599cf01e9f6aa103c61c2ec
Co-Authored-By: Claude Opus 4.8
2026-08-10 15:30:53 -04:00
Michael McAllister
233ea05ea2 x1000: set the NAND driver's init guard so setup runs once
nand_init() guards its one-time setup with a static `inited` flag that
nothing ever assigns, so every call re-runs the initialiser. That resets
refcount to 0 on a driver another caller may already hold open, and the next nand_close() then decrements from zero and tears the driver down underneath its user.

Assign the flag, and fix the caller that reaches this. On a failed open the installer's updater_cleanup() would call nand_close() against a driver nand_open() never took a reference on, because nand_open() only takes one once it has identified the chip; release the lock and drop the pointer instead.

Change-Id: I88d54ac5bca9bcebb62fd9c6f50f1acf982a9a3b
Co-Authored-By: Claude Opus 4.8
2026-08-10 15:26:23 -04:00
Michael McAllister
fae5c8d067 x1000: don't close fd 0 when a bootloader backup fails early
backup_bootloader() and restore_bootloader() initialise `fd = 0` and their error paths close it unconditionally. Any failure before the file is opened updater_init(), or the size check between them therefore reaches close(0) and closes whatever fd 0 happens to be. On a native target that is whatever the filesystem layer handed out first, so an unrelated open file is closed and the damage surfaces somewhere else entirely.

Initialise to -1 instead, which is the value close() ignores.

Found by inspection while bringing up another Ingenic target. Not run on
X1000 hardware.

Change-Id: Ib043f79f0b7edc7c70ccd77cbff54e264ed2b2de
Co-Authored-By: Claude Opus 4.8
2026-08-10 15:20:49 -04:00
Michael McAllister
a13368d0d6 axp2101: fix the enable test in axp2101_supply_get_voltage()
The enable check read

    if(r & (1 << info->en_bit) == 0)

`==` binds tighter than `&`, so this evaluates as `r & ((1 << bit) == 0)`,
i.e. `r & 0`, which is always false. The check never fired, and a supply
that was switched off reported the voltage it would have had if enabled.

Callers cannot tell "off" from "on at this voltage", so anything reading a rail back to confirm it came up gets a false confirmation.

Found by inspection while bringing up another Ingenic target. Not run on
X1000 hardware as I do not have one of these devices.

Change-Id: I19fc89ff33cce047160d826ce2344cc34b26e224
Co-Authored-By: Claude Opus 4.8
2026-08-10 14:32:54 -04:00
Solomon Peachy
612453da48 FS#13979 - rbutil: fix Talk file exclusion options and initial focus (Alessio Lenzi)
1. The "Ignore files" checkbox was saved in the settings but not
   consulted when starting generation. Patterns from the text field were
   therefore applied even when the checkbox was unchecked. The pattern list
   is now passed to TalkFileCreator only when the option is enabled.

2. Ignore patterns were converted to regular expressions by replacing only
   '*' and '?'. Other regular-expression characters were left unescaped and
   matches were not properly bounded. The patch uses Qt's
   wildcardToRegularExpression() conversion instead.

3. The Talk generation dialog initially focused "Strip Extensions" because of
   widget creation order. It now explicitly focuses the folder tree, matching
   the task flow and making keyboard and screen-reader use more predictable.

4. The handling of talkclips.ignore is also corrected so that files below a
   marked directory are skipped recursively. Previously Rockbox Utility could
   generate talkclips.ignore.talk and clips for files below .rockbox even though
   .rockbox/talkclips.ignore was present.

Change-Id: I1f9f14ed7fc057bc254f62148a7ef8ffb69425ed
2026-08-10 11:05:44 -04:00
Solomon Peachy
0726ec9351 FS#13978 - rbutil: Improve GUI responsiveness during voice/talk file generation (Alessio Lenzi)
Voice file and Talk clip generation currently run synchronously in the
GUI thread. During long TTS operations this prevents the progress window
from processing input and accessibility events. On Windows this makes
the progress list unavailable to screen readers such as NVDA and can
make Rockbox Utility appear to be hung.

The attached patch moves VoiceFileCreator and TalkFileCreator to
low-priority QThreads while keeping ProgressLoggerGui in the GUI thread.
Progress and log signals are delivered through queued Qt connections.

Cancellation remains available while a synchronous TTS request is
running. The abort flags used across threads are atomic and the abort
signal is sent through a direct connection. Worker objects and threads
are deleted through the standard finished / deleteLater lifecycle.

Talk generation now passes all selected folders to one worker and
processes them sequentially, emitting the final done signal only once.
This preserves multiple-folder selection without starting work in the
GUI thread.

Change-Id: I58aa66333d43e1be249c84e0cf46c17c119a8360
2026-08-09 15:54:58 -04:00
Skye
85c1ff8667 change build scripts to make reproducible builds possible
- makes SOURCE_DATE_EPOCH affect BUILDDATE and version string
- makes wpsbuild.pl output deterministic
- omits unnecessary extended metadata from zip files
- runs strip-nondeterminism on zip files if REPRODUCIBLE_ZIP is set

Change-Id: I1617e3f5233b2bc356fcfa6457be1a7785c303f9
2026-08-09 10:29:48 -04:00
Solomon Peachy
21e95258f2 FS#13977 - rbutil: fix SAPI5 TTS test output and playback (Alessio Lenzi)
After the SAPI5 error handling added for FS#13972, the Test TTS button
can fail with SAPI error 5 even though the engine and voice are
configured correctly. The test also destroys its QSoundEffect and
temporary file before asynchronous playback can complete.

Config::testTts() used a QTemporaryFile with no .wav extension.
TTSSapi::voice() removes the requested output before synthesis so that a
stale file cannot be mistaken for successful output. SAPI SpFileStream
was therefore asked to create an extensionless output file and returned
error 5 (invalid procedure call or argument).

After successful synthesis, QSoundEffect was allocated on the stack, its
loop count was set to zero, and the temporary file was removed when
testTts() returned. This does not allow asynchronous playback to
complete reliably.

 * create a temporary directory and requests an initially
   nonexistent tts-test.wav inside it;
 * keep the directory and generated wave file alive for playback;
 * keep QSoundEffect alive until playback finishes or fails;
 * request one playback and clean up all temporary data afterward.

Change-Id: I8e482ab846e6445889118e121025ec48d3776d6b
2026-08-09 08:00:50 -04:00
Roman Artiukhin
eecd4ec98b hiby: r1_patcher: fix sd hotplug on newer firmwares
flush mount option is no longer available.

Change-Id: I2380c1adcd2c2ba914db492eff1ed49bb45cb30c
2026-08-08 22:12:31 +03:00
Roman Artiukhin
4f65dfa649 hiby: r1_patcher: add separate pack/unpack/inject-app options
Change-Id: I87f513b55b1cb58b6c1c3f307fcb734e36bda8e3
2026-08-08 22:12:31 +03:00
William Wilgus
49600dd77c filebrowse.lua add sort by type, add .bmp, .mod to known filetypes
also extends date and size examples to show the size and timestamp
respectively

Change-Id: Ife2b74a8a60a6da097f1f714ebaf68a60d504287
2026-08-07 09:05:59 -04:00
Solomon Peachy
f44bf5c66d FS#13974 - Updated Russian translation (Ivan Romaniuk-Mikhailovsky)
Change-Id: Ie5d42c11e1811beb486ee12c0b7cd2cdf2703d38
2026-08-07 08:48:05 -04:00
Solomon Peachy
21d48d5ae3 iap: Improve IAPGeneralCommandID_RequestIPodName
iap-serial was hardcoded to return "ROCKBOX", and it was
not implemented at all in iap-usb.

Extend the iap-serial implementation to return the contents of
<ROCKBOX_DIR>/playername.txt, or "Rockbox" if there is an error
opening/reading that file.

And cut-n-paste this into the iap-usb side of things

Change-Id: I9d328be390b4cc8bd92237f996c41ef1e5e19724
2026-08-07 08:48:05 -04:00
Solomon Peachy
2d2b03d314 build: Bundle the main .map files into the zip file
This covers the rockbox binary (or bootloader), which increases the zip
file by 60-80k depending on the target.

It currently *excludes* codecs and plugins, which can add over 1MB to
the zip file.  We can revisit this when/if we move to distributing 7zip
files instead.

Change-Id: Iec72dd3aa634ceca716975c13b7fa8707a485d30
2026-08-06 09:46:10 -04:00
Roman Artiukhin
20f4f9539a hiby: usb dac: fix crackling sound due to sample rate mismatch
Both Ubuntu and Windows fail to report the proper sample rate on my machines, causing crackling sound on my hiby r1. Since we explicitly specify the only supported sample rate (48 kHz), just ignore the reported value.

Change-Id: Ie6e85bf94f9e15fca0c968441d5a8ce5a0088b77
2026-08-05 19:27:41 -04:00
Skye
290b06c869 plugins/fft: do not starve other threads
Change-Id: If8149086ed6e946d300ecdecf1f47dcf294822cb
2026-08-05 16:18:03 -04:00
William Wilgus
dcdb539ca5 FS#13970 - lcd_drawline() different depending on drawing direction try#2
Last patch didn't swap both x and y so was wrong and messed up the coord pair
I didn't want to add more swapping due to extra overhead

ultimately the issue is that you have 1/2 pixel error (-1 0 1)
and when doing the reverse line the error is on the wrong side
so instead get the first point from the opposite dinc

Change-Id: I141c4af36a601314f2b509a9ebfcfab3b5213bcd
2026-08-05 11:43:10 -04:00
William Wilgus
20c763ff89 FS#13970 - lcd_drawline() different depending on drawing direction
swap x1/x2 and y1/y2 rather than negating the increment

Change-Id: I16c37ab00c2a9a7f97768da68508c2d5c98a14c5
2026-08-05 10:21:34 -04:00
Hemant Kumar
b217a55059 ipod6g: Add inline earphone remote support
Decode the jack remote's play/pause and volume buttons via the
"Mikey" controller (I2C 0x72) and report them as multimedia keys so
they work on every screen, like the OF. Protocol reverse engineered
on-device, notes in mikey-6g.c.

Change-Id: If5f3d3abf043c0ce0d8ca7beb0f4b591e41c5c43
2026-08-05 08:40:24 -04:00