Commit graph

18639 commits

Author SHA1 Message Date
Solomon Peachy
bfab6a2276 Translation Updates
* German (Wilfried Winkler)
 * Italian (Alessio Lenzi)

Change-Id: I85b7936c85f188c09dc3621133ae83d1b70f6187
2026-10-01 15:52:43 -04:00
Michael Giacomelli
5c74d20bce jpeg_load: decode chroma sampled like 1x2 or 2x1 luma
When all three components share 1x2 or 2x1 sampling there is no chroma
subsampling, but each interleaved MCU holds two blocks per component.
The core loader assumed one chroma block per MCU, so these files (the
folder.jpg in the original report) decoded to garbage and have been
rejected since chroma sampling is validated.

Lay out the MCU generically in fix_headers(): each component's H x V
blocks in turn, with a per-block position that places chroma blocks
with the same offsets as luma. The MCU size and decode buffer now come
from the luma sampling in colour builds too, and the chroma IDCT scale
from the luma:chroma sampling ratio, which is unchanged for 1x1
chroma. The unused subsample_x/y fields are removed.

All other layouts decode byte-identically to before at every scale.
The new layouts decode byte-identically to the same image encoded as
4:4:4. Code size drops by 108 bytes on the e200 and struct jpeg by
20 bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I63a894d6609e56f3553a902afd6278ce70e04637
2026-10-01 13:47:38 -04:00
Michael Giacomelli
e32bfaadb1 jpeg: reject layouts the decoders cannot handle
Both JPEG decoders accepted several baseline layouts they cannot decode
and produced garbage without an error:

- chroma with sampling factors other than 1x1 (the MCU layout is chosen
  from luma alone, so any other chroma layout desynchronises)
- files written as more than one scan, where the first scan does not
  hold every component (it was decoded as if it were interleaved)
- scans whose components are not in frame order
- a height of 0 in SOF, to be defined later by a DNL marker

Reject these in process_markers(). The imageviewer then falls back to
the jpegp decoder on colour targets, which handles all of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: Ia3373f2b934eef6e3f354b4d064faf2d89868050
2026-10-01 13:22:53 -04:00
Michael Giacomelli
0e50ed3c43 jpeg: use the quantization table each component selects
Both JPEG decoders ignored the Tq selector in the frame header and
always dequantized luma with table 0 and chroma with table 1. Files
with a single shared table multiplied chroma by an empty table, and
files with separate Cb and Cr tables used the wrong one for Cr.

imageviewer/jpeg: build one dequantization table per component (3
instead of 2, +256 bytes) from the table it selects. tab_membership is
no longer used and is removed.

Core loader: the raw tables are pre-scaled in place for the IDCT, and
luma and chroma can use different IDCT scales. fix_quant_tables() now
maps each component to a table slot, copying a table that luma and
chroma share at different scales to a slot no component uses (there are
4 slots and at most 3 components, so one is always free), and rewrites
quanttable_select to that slot. No extra memory.

Selectors above 3 are rejected.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: If04c61fb0fef95da11d98d9918ea7225d8a440b0
2026-10-01 13:13:40 -04:00
Michael Giacomelli
b897766a7a jpeg: use the Huffman tables the scan header selects
Both JPEG decoders ignored the DC/AC table selectors in the SOS header
and always decoded luma with tables 0 and chroma with tables 1, the
layout libjpeg writes by default. Files where all components share
table 0, or where the slots are assigned differently, decoded to noise.

Look up each component's tables from its selectors instead. Baseline
JPEG only allows tables 0 and 1, which both decoders already hold, so
this needs no extra memory; selectors above 1 are rejected. In the core
loader tab_membership is no longer used and is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: Ie1ec407ddecf1256fef410b1256b97af412fb194
2026-10-01 13:03:53 -04:00
Michael Giacomelli
c12f6ebacd imageviewer/jpeg: don't read past the end of entropy data
The bit reader refilled from the input buffer without checking its end.
The end-of-data check in the decode loops only runs once per MCU row, so
a stream that desynchronises (or is truncated) read past the end of the
file buffer for the rest of the row. Return zero bytes past the end
instead; the pointer still advances so the per-row check stops the
decode.

Found with AddressSanitizer on a JPEG whose chroma is sampled more
densely than its luma.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: Iaada1bc3cbf62b18f10fb2377c12d4d5cb9524de
2026-10-01 11:57:40 -04:00
Marcin Bukat
01d18e42a9 rk27xx: fix -Wundef warnings in the FTL scheme finder
The debug menu tests CONFIG_NAND == NAND_RK27XX to include the FTL
scheme finder. Most targets do not define CONFIG_NAND at all, so every
native build but rk27xx's warned twice:

  "CONFIG_NAND" is not defined, evaluates to 0 [-Wundef]

Test that it is defined first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I82a1e8fa2f09aac1c5f0d746fb6d475e389d12d6
2026-10-01 13:00:41 +02:00
Marcin Bukat
e83b7d6dc4 rk27xx: add a finder for the NAND's FTL scheme
Many rk27xx targets have NAND whose format nobody has examined. The
finder reads ID block 1 and the first page of the first 512 blocks and
says which FTL formatted them: Scheme A by its remap-log blocks,
Scheme B by its bad-block table and data headers, another Scheme B
generation by other 0xFxxx tags. The later ID block layout ('RK27' at
0x0a) records the FTL area's BCH strength at 0x1ed - 8 on the HM-601,
14 on the Archos Vision 28 - and the scan reads in that mode.

It is read-only, shown in the debug menu as "View FTL scheme", and
built for targets whose NAND is not storage - none yet.

Run on dumps of an HM-601 it reports Scheme B, a Samsung YP-CP3
Scheme A, and an Archos Vision 28 the other Scheme B generation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I0528f9d2a6996089b6488a77b43942f6fd1f2c16
2026-10-01 12:15:25 +02:00
Marcin Bukat
89e9ade855 rk27generic: FM radio screen keys, tuner noted as an RDA5807P
The FM screen had no actions for the rk27xx generic keypad; give it those
its keymap already maps (menu, play, stop, exit) in radio.c.

The board's tuner is an RDA5807P. It keeps being driven as a TEA5767, in
the chip's compatible mode, as the original firmware does: tuning, seek
and the stereo indicator work so, and the RDA mode would bring nothing
here - this variant has no RDS. Say so next to CONFIG_TUNER.

The tuner's audio is on the codec's line input 1: only that line is
powered and mixed in while the radio plays (RK27XX_CODEC_FM_LINE 1). With
line 2 instead the radio is silent.

Tested on the rk27generic board: manual tuning, seek, stereo indicator and
audio.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I2135ee484705ff0fce6d88e73288d8ed2aec6c2d
2026-09-30 08:07:47 -04:00
Vencislav Atanasov
f012c09eed Bulgarian translation update
Change-Id: Id13ca6875a08eb2e1843dc6ecaa15fd0f09b96c4
2026-09-29 20:38:15 -04:00
Solomon Peachy
9ab4bdcf91 Translation updates:
Polish (Adam Rak)
Simplified Chinese (Wang Ji)
Slovak (Matej Golian)
Turkish (Mustafa Yıldız)
US English (Myself)

Change-Id: Icab7a33af666636ca7c4e7aadd517fbc82b062b2
2026-09-29 18:33:47 -04:00
Marcin Bukat
3fbf975ecc YP-R0 keypad: recording screen and FM recording keys
The keymap had no recording screen context, so on the recording screen
no key produced ACTION_REC_PAUSE and recording could not be started; nor
did the FM screen have a record action.

- recording screen: User starts and pauses, held opens a new file;
  left/right set the gain of the selected line; Menu opens the settings
- FM screen: User records the radio (FM_RECORD enabled for this keypad)

User is the Rec key on the Samsung YP-CP3, which shares this keypad.

Tested only in a YP-CP3 build, not yet on hardware; the YP-R0 itself was
not built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I655865d0dcf3e72da4e2d1cba24bc296919ec261
2026-09-29 09:51:25 +02:00
Marcin Bukat
a35f344eef YP-CP3: WM8750 audio
The YP-CP3 uses Wolfson WM8750. Headphones are wired on OUT2 and
a headphone amplifier enabled by GPIO F2, active high -
all RE from the original firmware.

The original firmware runs the codec as I2S master in its 12 MHz "USB
mode", fed a fixed 12 MHz MCLK, which puts 44.1 kHz at 44.118. Rockbox
instead makes the rk27xx the master and clocks the codec from the codec
PLL at exactly 256 fs (CODEC_SLAVE, as every other rk27xx target with an
external codec), so the codec's CLOCKING register is its normal-mode
256 fs setting at every rate. 96 kHz is left out: the WM8750 cannot take
it at 256 fs.

- config: HAVE_WM8750, CODEC_SLAVE, rates 8-48 kHz; the WM8750 has
  hardware tone controls, so HAVE_SW_TONE_CONTROLS goes
- ypcp3/wmcodec-ypcp3.c: register writes over the rk27xx I2C driver
- wm8751.c: on the YP-CP3, power on and drive OUT2 instead of OUT1, set
  the volume there, and switch the amplifier with the outputs
- english.lang: the YP-CP3 gets the bass/treble cutoff settings the
  WM8750 brings

Tested on a YP-CP3: playback at 44.1 and 48 kHz on headphones, pitch and
volume correct.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: I870038fb6a21a9c26b025e3df7c220fd925f49f6
2026-09-29 09:34:02 +02:00
Michael Giacomelli
2bb498b963 jpeg: fix decoding of grayscale images with 2x2 sampling
A single-component (grayscale) scan is non-interleaved, so its MCU is
one 8x8 block regardless of the sampling factors in the frame header
(T.81 A.2.2). Some encoders write H=2,V=2 for the lone component, which
sent both the imageviewer plugin decoder and the core loader down the
4:2:0 path: 6 blocks per 16x16 MCU, the image treated as colour, and
the entropy data overrun.

Force 1x1 sampling for single-component frames when parsing SOF0 so
these images use the 4:4:4 layout with one block per MCU. Also add the
missing else in fix_headers() in the core loader, matching the plugin.

Tested on a Sansa e200 with both the plugin and the core loader, and
the plugin in the e200 simulator and built for PC and for ARM (qemu).

Fixes FS#13749.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Change-Id: Iac2f925aab8cd602930470dca5da7dfb44e15961
2026-09-28 22:38:41 -04:00
Michael Giacomelli
89c38484ea fix missing else in jpeg decoder.
This didn't actually break anything since the error case wasn't
handled anyway but not a good idea to leave alone.
2026-09-28 22:38:41 -04:00
Solomon Peachy
3c09d4570f FS#14012 - Latvian Translation Update (Renalds Belaks)
Change-Id: I904a8e5b688ff9b36220bf6631fa5369e4b3d025
2026-09-28 09:08:28 -04:00
Solomon Peachy
583f27d5e5 FS#14002 - German Language Patch (Wilfried Winkler)
Change-Id: I83d42092b192eb93df680bd98c724d81f65ddca1
2026-09-27 19:36:21 -04:00
Solomon Peachy
636ae404f7 misc: forums.rockbox.org -> www.rockbox.org/forums
Change-Id: Ieddb1d534aa15e3e931eb66e9380276602cfd0c5
2026-09-27 10:46:01 -04:00
Solomon Peachy
bd615cf125 FS#13996: Have audio_hard_stop() kill the PCM output path entirely
We already shut down the playback path and the voice path, but that
doesn't necessarily mean the PCM hardware is idle.

Add a call to pcm_play_stop() to ensure the PCM sink is completely idle.
This will prevent a badly-timed callback from firing during a ROLO
operation.

Change-Id: I1eb8c105895fb47bc3d0af91b4d87345f5399aa4
2026-09-25 16:03:03 -04:00
Solomon Peachy
5448dd99a3 fix red in c6abf3382a -- iriver h1xx/h3xx simulator
Change-Id: I2b6f207aa8b349ca9cf12f8f9334848a65c4f48a
2026-09-23 14:17:24 -04:00
Aidan MacDonald
c6abf3382a firmware: move iriver flash helper functions into target tree
Move the iriver-specific functions for detecting flashed
Rockbox/OF images into system-iriver.c and remove the
HAVE_FLASHED_ROCKBOX define which is now redundant (all
targets using system-iriver.c enable it).

Copyright attribution on the new system-iriver.h header
is a best guess from Git history.

Change-Id: If1933f881a63fd517162ab9ca8f4a3007b997739
2026-09-23 13:44:45 -04:00
Aidan MacDonald
190822f261 firmware: limit system_memory_guard() to coldfire targets
Only Coldfire targets have ever implemented this. Gate it
behind CPU_COLDFIRE so the stub functions won't be needed
in other targets.

Change-Id: I507952c40a04d813a40296142a6eba1df24b0a68
2026-09-23 13:12:48 -04:00
Aidan MacDonald
d27af08ff6 hw_h264: remove redundant ifdef guards
Change-Id: I5fa1abc1226ec5a35888713da83467a71a3c4caf
2026-09-23 16:22:18 +01:00
Aidan MacDonald
29eef25ac7 hw_h264: use standard rockbox copyright headers
Some files were not using the standard header with the
Rockbox logo. Add this and move any technical notes into
a separate comment.

Change-Id: Idaac932cd56154c7b785ba0e6c0231a21878f786
2026-09-23 16:22:18 +01:00
Andrew Rice
76f8925d23 ipodnano3g: power, RTC, backlight, battery and audio
Fills in the stubs the Nano 3G port was left with, taking each from how
the original firmware drives the same hardware.

Testing evidence: firmware/target/arm/s5l8702/ipodnano3g/TESTING.md.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Change-Id: Iea5314769502f5941a176600869591756c5e3233
2026-09-20 08:53:53 -04:00
Solomon Peachy
f834e02af8 pacbox: Add missing function annotation to arm asm functions
Change-Id: If920186cfdc4e22ec9a6dc154b0d2979b9a1f541
2026-09-19 21:23:48 -04:00
Holden McFarland
d23a19dc2d ibasso dx50/dx90: Fix physical buttons on yes/no screens
The DX50 keymap already defines button_context_yesno, but
target_get_context_mapping() did not select it for
CONTEXT_YESNOSCREEN. As a result, physical buttons could not
operate dialogs such as "Playlist finished. Play again?".

Add the missing context mapping.

Tested on iBasso DX50 hardware: Play and Previous accept Yes;
Next and Power cancel.

Change-Id: I9f6078b45a48047a662aad5f231d0adac9a42d5d
2026-09-19 07:29:10 -05:00
Aidan MacDonald
98a55f623b Fix errors in ipod-specific h264_player from 3a57f2f721
Change-Id: I40148d33932eeefb5de73f07104cef78d0739b5d
2026-09-17 21:59:52 +01:00
Aidan MacDonald
861e53095f Fix build errors in 3a57f2f721
Seems that I missed a couple of plugins when renaming 'filesize'.

Change-Id: Ifee9daf7d77558c958a192741b2e255dcfb1675e
2026-09-17 21:42:16 +01:00
Aidan MacDonald
3a57f2f721 Add "rbfs" prefix to native filesystem functions
Most of the churn here occurs because 'filesize' is one of
the redefined filesystem functions, but some of the structs
used by the native FS code also include a 'filesize' member
variable which gets renamed by the macro in some but not all
source files.

It's easier to rename 'filesize()' to 'ffilesize()' rather
than try to clean up the macro mess or renaming the struct
members.

There is weirdness with root_realpath() which now breaks on
native builds because it was assumed to be unprefixed there.
dir_get_info() was unprefixed everywhere but this just seems
inconsistent; make it follow the FS_PREFIX() convention too.

Change-Id: Ic3700c6234ea45f32679c1a8429d70fdb8f4088a
2026-09-17 16:22:31 -04:00
delacor
dc37bb1ba0 tagtree: warn if tagnavi.config is missing instead of freezing
Database still opened an empty list when the config failed to parse. This results in the Device being complete unresponsive and needs a hard-reboot.
This shows a file-not-found splash instead and return to the previous menu.

Change-Id: Ifbb6998c46a4685eae486cffd89833f93a172713
2026-09-16 07:55:47 -04:00
William Wilgus
1784c9b8a7 FixRed devices with non backlit remotes
Change-Id: I42b9c438a5b0571397c5410cfecebe035d4f134e
2026-09-13 13:30:59 -04:00
William Wilgus
2507be9af2 FixRed for devices without backlight
Change-Id: I202180b529d32b04fad48813af905e9250d3a29b
2026-09-13 12:50:12 -04:00
William Wilgus
a7ab67f459 add backlight_on_button_hold to plugins and backlight_use_settings_helper
backlight_on_button_hold / remote_backlight_on_button_hold

were never added to the Plugin API nor backlight_use_settings() helper

Change-Id: I75999af76f98244a870ab86564e591c8a900e66c
2026-09-13 12:04:10 -04:00
David Cormier
e0136bc7f4 ipod6g: add hardware H.264 video playback
Add S5L8702 VPU-B initialization, reset, bitstream input, frame output,
and cache maintenance to the iPod 6G target. Advertise it with
HAVE_HW_H264 and append a capability-gated decoder interface to the
plugin API.

Keep MP4 parsing, AAC decode and mixer output, A/V synchronization,
playback controls, resume state, and presentation in the multi-file
h264_player plugin. The target layer exposes decoder operations only.

Accept non-fragmented MP4/M4V containing Constrained Baseline H.264
through level 3.0, up to 640x480 at 30 fps, with optional AAC-LC audio.
Validate codec configuration and all sample-table relationships before
activating the hardware.

Read MP4 tables in bulk, boost the CPU while preparing them, and report
staged loading progress so long movies do not appear to hang during
startup.

Register the viewer and document its format limits and controls. The
libm4a compatibility fixes needed by video-first containers remain in
the preceding standalone change.

Tested on an iPod Classic 6G through an isolated Rolo nightly runtime:
H.264/AAC playback and M4V startup succeeded. Normal and
isolated-runtime iPod 6G builds also complete, and git diff --check is
clean.

Change-Id: I1e96c65c7d0b4231a94f602f8052f1b26d6e4a80
2026-09-13 08:07:59 -04:00
Christian Soffke
57a91121f6 root_menu: remove ACTIVITY_UNKNOWN hack for plugins
This was added in commit 8ff2c81bd to prevent a custom
root menu UI from flashing on screen in some themes
when returning from a plugin. Because the display isn't
updated in this scenario anymore, the workaround can be
safely eliminated.

Change-Id: Ie46b0921cfdad6e45a31661a5d451dc2717171d6
2026-09-12 08:33:27 -04:00
Christian Soffke
7e3782868c quickscreen: fix icon x-position off-by-one
Top, bottom, and right icons were displayed too far to
the left. Apparently a long-standing issue.

Icon width is 7, so subtract 7/2 = 3 pixels, instead
of 4, from calculated center, and only 7 pixels, instead
of 8, from the right vp edge.

Change-Id: I8440a4fef4778a66d56117a05b3fe4c36ac8dadd
2026-09-09 15:24:31 +02:00
Christian Soffke
f2985dc8a2 option_get_valuestring: fix trailing whitespace for UNIT_INT
Remove trailing whitespace from int settings, so
that right-aligned or centered values look correct
in Quickscreen for settings such as Brightness.

Change-Id: I006cf3c3e8b30be2246e7370f26e0428fa47e54b
2026-09-09 15:24:30 +02:00
Christian Soffke
10ec9bd530 quickscreen: eliminate excess/pad variable from vp setup
Simplifies commit da207d606 a bit more

Change-Id: I7ef98914153c0c0bfb5a3ff594fcb7e98f2dc5ba
2026-09-08 06:31:30 +02:00
Solomon Peachy
a967c5a018 Translation updates
- German (Wilfried Winkler)
 - Italian (Alessio Lenzi)

Change-Id: I52d6751364eae722743a5fdb1ece51c626498677
2026-09-07 22:21:49 -04:00
Solomon Peachy
54b26ac9f1 Translation updates:
- Chinese Simplified (Wang Ji)
 - Polish (Adam Rak)
 - Slovak (Matej Golian)
 - US English (Myself)

Change-Id: I939907d653309eabdb8d8c722bc953749a818898
2026-09-07 12:36:34 -04:00
Vencislav Atanasov
a70f30adf1 Bulgarian translation update
Change-Id: I96bc87fb873e9eb4a6ca96283873459314e0992f
2026-09-07 18:02:55 +03:00
Solomon Peachy
4f54dbec79 lang: restrict LANG_TOUCHSCREEN_FLICK_SHORTCUTS to touchscreen devices
Change-Id: Iaabc39901eadca6d36d663f7feca52273041afac
2026-09-07 09:52:58 -04:00
Solomon Peachy
76a2fdfc1f lang: Restrict LANG_COMPOSITE_VIDEO_OUTPUT to devices that have it
Currently just ipod6g, but treat it as a generic feature

Change-Id: Idda31455765908e4bd099cf5117b858bb3848f7f
2026-09-07 09:27:20 -04:00
Aidan MacDonald
376db9bf5b touchscreen: Add flick gesture support in list and WPS
Add some hardcoded flick gestures in the list UI:

Top   -> open quickscreen
Left  -> go back
Right -> go to the WPS

The WPS also gets a set of hardcoded flick shortcuts:

Top    -> open quickscreen
Left   -> go to file / database browser
Right  -> view playlist
Bottom -> context menu

These are enabled by default in pointing mode but can
be disabled using the "Touchscreen Flick Shortcuts"
option.

Change-Id: Ib30a338ebb9662cd136985da6d34ed5b041e4077
2026-09-07 08:56:38 -04:00
David Cormier
27332d64ad ipod6g: add composite output setting
Add Off, Auto, and On choices under the LCD settings menu for targets
with HAVE_COMPOSITE_VIDEO_OUT. Off is the default and leaves accessory
ADC, video registers, framebuffer conversion, output clocks, and CPU
boost untouched.

Auto enables output only for the qualified Philips dock signature. On
still requires a physically present, fully identified dock and permits
other detected composite accessories.

Document the menu behavior and the corresponding configuration-file
values in the iPod Classic manual.

Hardware tested on an iPod Classic 6G/7G with a Philips DCP750/37.

Change-Id: I649149daa331a95aa31110e1f2260a4a00ba789a
2026-09-07 08:55:22 -04:00
Christian Soffke
2ec4760117 disktidy: fix blank "Last Run" screen in some themes
Listen to GUI_EVENT_NEED_UI_UPDATE events and redraw, so
screen doesn't disappear if a theme draws over the  UI vp.
Occurs in situations when the SBS is redrawn after waking
the screen, or when the song changes.

Change-Id: I062e802959ab9d34d8c04b7f82da6b87efb5d739
2026-09-05 19:31:28 -04:00
Christian Soffke
da207d6067 quickscreen: refactor quickscreen_fix_viewports
Reduces GNU complexity score from 7 to 2.

Use separate inline functions that group setting
- x-position and width for left and right text viewport
- y-position and height for all text viewports
- position/dimensions for icons viewport

Change-Id: I14f4eee1f4d6fefa9acbf4a37970a535e77990b1
2026-09-06 00:47:04 +02:00
William Wilgus
45bd2b970b [Bugfix] FS#13975 - Keyremap plugin: text importer allow multiple ACTION_NONE entries
importing discards duplicate entries based on context + action code
however you may want multiple entries to map to the same action
and you can't do it within the same context

instead only consider an entry as a duplicate if they have the same
context, actioncode, button, and prebutton

Change-Id: I5aba3459505987ba37e26758aec62f02fcf8165a
2026-09-05 11:03:27 -04:00
Christian Soffke
569c2a53c8 quickscreen: fix string size calculation in quickscreen_fix_viewports
The parent vp wasn't set before checking the string size,
so, in certain scenarios, the size was calculated using a
different font than the one configured for the UI viewport.

Change-Id: I66bb2e496598811f6169a118de5cb83b451fa292
2026-09-04 17:32:48 +02:00