Commit graph

18556 commits

Author SHA1 Message Date
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
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
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
Skye
290b06c869 plugins/fft: do not starve other threads
Change-Id: If8149086ed6e946d300ecdecf1f47dcf294822cb
2026-08-05 16:18:03 -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
Solomon Peachy
b4db6ffbff FS#13971 - Updated Italian translation (Alessio Lenzi)
Change-Id: I97feb3f5558b6ba1b241c1f402bdd963ce8da273
2026-08-04 09:29:07 -04:00
Solomon Peachy
ab863dc40c iap: Clean up use of logf.h
Change-Id: I4f4a0faca42345cb8f9c8018a662377df9f58776
2026-08-02 13:57:03 -04:00
Solomon Peachy
aa99dc51c1 Translation updates:
* Moldavian (Mihai Alexandru Vasiliu)
 * Romanian (Mihai Alexandru Vasiliu)
 * Simplified Chinese (Wang Ji)

Change-Id: I586102fc47999667dec959f9f846ddd10061ad5f
2026-08-02 09:34:25 -04:00
Solomon Peachy
104f57252b iap: Increase the IAP thread's stack size from 6K to 8K.
iAP accessories that query the track information via mode3/mode4 result
in a call to get_metatada(). This routinely overlows the current 6KB
thread stack into the iAP RX buffer, possibly corrupting the current iAP
packet being received/processed.  Bumping this to 8K should yield over
1K of headroom.

(The tagcache scanning thread uses a 16KB stack in comparison)

Inspired by commit 99b21cd6c on the rockpod fork. (Nux Li)

Change-Id: Ibe997f3ae9dab2dcc2d9947f0b49d206a5b006b6
2026-08-02 08:52:52 -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
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
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
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
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
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
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
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
William Wilgus
40b9d09022 [bugfix] lua ipod mini gen 2 can't quit scripts while under load
I rewrote some of the problematic scripts to use an event loop which
fixed most of the issues but it turns out the underlying issue is
that when the device is under load the timeout that detects a repeat press
makes the key a repeat press and we miss the initial press completely
due to being under load and under the gun

Adds entries for PLA_EXIT and PLA_CANCEL with a Repeat press

Change-Id: I8247b0ebd37fc58608f6be126c49e56f8375e9cf
2026-07-05 22:19:14 -04:00
Christian Soffke
78ec149555 allow softlock in additional screens
not sure if there's a reason these weren't included
in g#3229

- simple lists
- playlist viewer
- browse_id3
- option select

Change-Id: I0e15aaeb563e68ea21bf5df667ce134d01a95195
2026-07-05 12:59:27 +02:00
Christian Soffke
85adf518ac shortcuts: go to WPS for ACTION_TREE_WPS
Change-Id: Ieab19f90d9cf13b19ce7fe108f3ecb734af1fde0
2026-07-05 06:58:44 -04:00
Christian Soffke
e6b4ec81ff simplelist: support ACTION_TREE_WPS
Also enables support for left/right scrolling

Change-Id: Ic5888b1f17cca429febdab031e158db88a632a4e
2026-07-05 06:58:21 -04:00
Solomon Peachy
f11c89aae2 usb: Fix usb mode not initialized/restored on the DX50/DX90
* Devices with ADB now have HAVE_USB_ADB
 * DX50/DX90 no longer set USB_NONE
   * stub out necessary functions
 * usb_set_mode() and global_settings.usb_mode are now:
   * called for all devices with (HAVE_USB_ADB | HAVE_USB_POWER)
   * wrapped with consistent #ifdefs

Fixes regression in ce88de54b8

Change-Id: Ib0c16082fe237e8159cd42847355186ea5c74589
2026-07-03 12:26:34 -04:00
Roman Artiukhin
ce88de54b8 hosted: Fix USB mode not properly initialized for some targets
All required code is already present in the left usb_set_mode call.
Affects iBasso DX50, iBasso DX90, HiBy R1 and HiBy R3 PRO II.

Fixes FS#13890

Change-Id: Ib554ca98a36ceeaa48c0aa699c3671a40d4fee47
2026-07-02 16:09:10 +03:00
William Wilgus
ddc31e8ddc Revert "[Bugfix] FS#13943 - Single mode tracks shorter than one second do not play"
This reverts commit f4e9ba7f17.

Reason for revert: Wasn't the issue??

Change-Id: Ib25ec4b7f90d2ddb0b8a414e18469a9bf5c88140
2026-07-02 01:56:46 -04:00
William Wilgus
f4e9ba7f17 [Bugfix] FS#13943 - Single mode tracks shorter than one second do not play
Change-Id: I8eceb8179231fc7d4c6b8d9c08844a67240c926f
2026-06-30 14:20:01 -04:00
William Wilgus
d87755c535 FS#13944 - FONT_UI loads the last loaded font not global_status.font_id
FONT_UI scans from MAXFONTS-1 to 0 to maximize the chances of getting a loaded
font but this may result in global_status.font_id being ignored even
if set through setuifont

this should take care of all the plugin woes dues to this
by setting the lcd font to the ui font before loading the plugin
and also making FONT_UI map to this font when font_get(FONT_UI) is called
if the desired font is not loaded then fallback to the previous behavior

Change-Id: I101d6f91910c17b08fca2b988a0a99c9e6899bee
2026-06-30 13:29:23 -04:00
William Wilgus
b99b2e98df [Bugfix] lua FS#13940 - FONT_UI using last selected font instead of the UI font
FONT_UI is a placeholder when it gets assigned it isn't resolved
immediately

when its time to resolve the font it is processed with font_get(int font)
first it sets it to the last slot
and then decrements till it gets a valid font

Change-Id: I3c203d58ed2d813d206f5b435e6b55ed196cf213
2026-06-29 01:06:34 -04:00
William Wilgus
d9b1819e0b FS#13942 - Lua strftime os.date("%C")
Change-Id: I5a4cb8d362a69d12c2d7e5013dcf179cc20d01b3
2026-06-28 14:32:33 -04:00
William Wilgus
24b0254d96 metadata.c small cleanup
add get_metadata_afmt function so we don't have to extra functions
remove unneeded bounds check on audio_format in rbcodec_format_is_atomic()
add bounds check on audio_format in get_metadata_afmt()

Change-Id: I76bd869100b000579c6546f0670ba4ba2c541f22
2026-06-28 14:24:02 -04:00
William Wilgus
3cd286d8f8 metadata add audio_fmt to get_metadata_ex
tagcache.c add_tagcache() and potentially
skin_tokens.c wps_playlist_percent_prepare()

make calls to probe_file_format() prior to calling get_metadata_ex
resulting in some small amout of duplicated work
especially in the case of add_tagcache this can add
up to a lot of duplicated work

breaks out audio_fmt so these can supply the afmt other callers just
supply probe_file_format(trackname) in the function call

Change-Id: I8084213b8ee7e04d76dce0986beb83d443ac804b
2026-06-27 14:14:01 -04:00
William Wilgus
3e08b86e4b FixRed a824085 skin: add %pX tag checkwps, ATA builds
ata_disk_isssd() return 0 for SIMULATOR

Change-Id: If281b5ce7a98f338dfd81635c8936dd90c41b9bb
2026-06-27 13:27:35 -04:00
Adam N. Burke
a824085057 skin: add %pX tag for time-based playlist progress
%pP reports playlist progress by position index, which treats every
track as equally long. For playlists with tracks of unequal length --
audiobooks with chapters anywhere from two minutes to an hour are the
motivating case -- position is a poor proxy for listening progress.

%pX reports the played percentage of the whole playlist by time: the
summed length of all preceding tracks plus the elapsed time in the
current one, relative to the playlist's total duration. It can be
used as a value, in a conditional, with %if(), or as a bar tag like
%pb.

If a playlist contains more than 500 tracks or the scan is taking too
long and the user aborts the tag will fallback to the behavior of %pP
except the progress through the current track will be included in the
returned percentage

--------------------------------------
Computing this needs every track's length, and reading metadata for
every track is too slow and disk-heavy for a tag that refreshes on the
WPS. Instead each track's length is estimated from its file size: the
skin engine scans the playlist in the background, a batch of files each
skin refresh, opening each file only to read its size (directory
metadata, no header parse). Size is turned into time by calibrating one
file of each type -- the first file of each extension is parsed once
with get_metadata to learn its bytes-per-second, and every later file
of that type reuses it. A single-format playlist, the usual audiobook
case, parses exactly one file and stat's the rest.

The result is an estimate -- bitrate varies within a type, especially
for VBR -- but it is cheap and accurate enough for a progress
indicator, and the playing track always contributes its exact elapsed
time. Per-track lengths are stored as two bytes of minutes each in a
movable buffer sized to the track count and allocated only while the
tag is in use; the cache is keyed on the track count and a crc of the
first, middle and last filenames, so a playlist swap or reshuffle is
caught. If the buffer cannot be allocated (a very large playlist on a
low-memory target) the tag falls back to position-based progress.

The buffer is allocated when playback starts (and when the now-playing
screen is opened with playback already active) rather than lazily on the
first WPS refresh, so the one-time allocation happens at a playback
boundary instead of during steady-state playback; it falls back to
allocating on first use if that point is missed.

Until the scan finishes the tag does not blank: it returns an instant
equal-weight estimate -- (completed tracks + fraction through the
current one) / track count -- which sharpens into the size-based value
as the scan fills in. So a theme can just use %pX and it is correct
from the first frame, and %?pX is true whenever a playlist is loaded.

Tested on a Sansa Clip Zip and in the simulator. On a 216-track,
~745 MB single-format audiobook playlist the length scan dropped from
~4150 ms (get_metadata on every track) to ~174 ms (one parse plus 215
file-size stats), roughly 24x lighter.

Change-Id: I6e572e78a10444bd513ddc77e30da04aa5153ef2
2026-06-27 12:29:31 -04:00
elishay
0e3355de50 keyboard: fix RTL (Hebrew/Arabic) on-screen keyboard
Commit d1be73c ("keyboard.c Use viewports, move text box pos")
moved the picker and edit line into dedicated viewports. Under an
RTL UI language these viewports get VP_FLAG_ALIGN_RIGHT, so
lcd_putsxy mirrors every call; with the per-character cell drawing
this reversed the picker grid and the edit line (Hebrew shown
reversed, Latin filenames backwards, wrong caret).

- Clear the alignment flag on the keyboard own viewports so the
  picker grid and cell layout are no longer mirrored.
- Draw the edit line as a single string so the bidi engine reorders
  mixed Hebrew/Latin correctly, and use the full line width.
- Compute the caret from the bidi (LTR-base) visual layout so it
  lands at the insertion point, including mixed Hebrew+Latin text.
- Pick the edit-line direction and invert the left/right cursor
  keys based on the text first strong character.

Change-Id: I79f1c444bc9121fd5018ad5f6f4148afe2c1a3e1
2026-06-27 07:45:12 -04:00
Solomon Peachy
9a85d01a32 FS#13933 - Updated Romanian and Moldavian translations (Mihai Alexandru Vasiliu)
Change-Id: Ia2aad85d518f4037b39565036940622aac52812b
2026-06-23 17:31:04 -04:00
Solomon Peachy
cf10fa5243 FS#13929 - Updated Latvian translation (Renalds Belaks)
Change-Id: Id5fd597b16be8e93823d89129256fcb0dfd3e36b
2026-06-21 17:22:29 -04:00
Solomon Peachy
13bcd68346 FS#13928 - Updated Simplified Chinese Translations (Wang Ji)
Change-Id: Ibf63047e9ade0397a29599d127ff77c51a167113
2026-06-21 11:43:49 -04:00
William Wilgus
ad64336e69 [Bugfix] Autoscan when radio off hangs player, record static
Clipzip, ClipPlus other devices may be similar
Autoscan from the main menu and the device hangs at scanning 88.1

try to record with no station set and it just records static

Change-Id: I59fe17dde80736e4fae8445c0aea7fcf5e476317
2026-06-20 11:43:02 -04:00
William Wilgus
81962808a2 use core_alloc for Radio Presets
saves around 1.2k off the top &
allocates a movable alloc when FM radio used

Change-Id: I0ea8c646f919fc8e62de2b02c1c089620e7ef020
2026-06-20 11:23:55 -04:00
William Wilgus
7a32c8b5e3 [Bugfix] lua splash_scroller line formatting
I accidentally added an extra character wittthe last patch by changing
< to <= in the process of testing this I realized spaces were sometimes
being included at the beginning of the line and also that sometime
sentences were being cut short even though they fit on the screen

Change-Id: Iee0ed64e18defad2acb3c107d334ea2a49bd5b6f
2026-06-18 22:21:16 -04:00
William Wilgus
ca2edad012 [Bugfix] FS#13926 -lua Crash when displaying error splash
fix lua strpbrk function skipping the first accept chr

lua splash_scroller fix NULL pointer in brk due to lastbreak
not being reset on a new line

Change-Id: Ica0c9ee5f9194f5be54ab90ad16309adead1c207
2026-06-17 13:55:43 -04:00
William Wilgus
d737cbb931 Sansa As3525 OS stacks debug menu change scroll buttons
the other items that scroll use the menu button and reset on STD_OK

OS stacks use STD_OK to scroll and any other button to reset

Change-Id: I1fa1caa322fe761c6f92d2d08cc418e78843863b
2026-06-17 10:26:22 -04:00