Commit graph

36140 commits

Author SHA1 Message Date
Aidan MacDonald
0e8f3669d0 Fix remaining red from 3fcdadce24
Change-Id: I619a637bdf1fb932c3618f1f40aaa1c9e7f98300
2022-04-16 16:06:13 +01:00
Aidan MacDonald
76035decc6 Fix red in 3fcdadce24
Change-Id: Idbee52505b3c109a0aad23e2edf7dd78519eb173
2022-04-16 10:41:19 -04:00
Christian Soffke
f989339664 Remove dead code
Change-Id: If31a99e6488dabab47d482637b2609ff829df1ca
2022-04-16 10:18:28 -04:00
Christian Soffke
68ac932585 PictureFlow: Disable 'Album Not Found' splash when stopped
...and go to last album, even if it hadn't
been selected for playback

Change-Id: I44013e930a1feb873f128c2885ecb8ddaf4ae3ff
2022-04-16 10:13:50 -04:00
Christian Soffke
e3bf6f08e3 PictureFlow: Delay LCD Update until center slide is loaded
Eliminates flashing of slide right after launch or
when changing sorting on the M3K using the
volume buttons

Change-Id: Icd317e0b0d5b939269dc8dafd30d0c0f9daa5fd9
2022-04-16 10:13:50 -04:00
Aidan MacDonald
3fcdadce24 plugins: Add multiboot select plugin
This plugin provides a menu for easily editing the root redirect file
on targets that support multiboot. You can select a new root from a
list of Rockbox installations detected on the filesystem or remove all
redirects to boot from the default location.

To avoid searching the whole filesystem, only subdirectories of the
volume roots are checked for valid installations. Only installations
that are compatible with the current player will be displayed.

Change-Id: I7dcbadfd97873b87817870e61d2ae37956d2da00
2022-04-16 14:36:39 +01:00
Aidan MacDonald
d55dceff37 apps: Add ability to do a clean reboot
Allow a clean shutdown to end in either power off or reboot. Add a
new event SYS_REBOOT to signal it and sys_reboot() to trigger the
event. SYS_REBOOT signals a reboot request and should be listened
for alongside SYS_POWEROFF events.

Change-Id: I99ba7fb5feed2bb5a0a40a274e8466ad74fe3a43
2022-04-16 14:36:39 +01:00
Dominik Riebeling
90960adf56 rbutil: Fix bootloader installation for various players.
Reworking handling of player specific data (static player configuration,
as well as information retrieved from the server) changed the behaviour
on a non-present configuration entry. This eventually caused the
mountpoint not being set for players that don't have a bootloader file
on disk. Fixing this accidentially removed the default-if-not-found
handling for the bootloader file.

Restore the old default value behaviour for both cases.

Change-Id: I627782ccdef198619fb507f8b09a64811b3bd18f
2022-04-15 21:03:44 +02:00
William Wilgus
ff08841ea9 viewport FIX RED remote screens
Change-Id: I894a5c3e9053f44dee4803e9cdbbcb8f651ee318
2022-04-15 08:16:28 -04:00
William Wilgus
d56d96031c viewports add flag to disable updates
when drwing multiple areas of the screen with other gui elements
you might want to combine updates into a single screen redraw

Change-Id: Ie4130366fa13e25d3d14e937257d11547dd61134
2022-04-15 01:54:42 -04:00
Dominik Riebeling
b9c3ab2e04 rbutil: Improve progress & responsiveness on (un)install.
- When uninstalling update the log file only at the end of removing all
  files. This gives a major speed improveness since othewise the log
  file is written after each file. This slows down things notably,
  especially on slow disks.
- Explicitly update the UI during install zip extraction. Avoids
  progress seemingly hanging due to the UI not getting updated often
  enough.

Change-Id: Ib353a92e02a7038d6e55f5f88dcfb5085602c0f2
2022-04-14 23:06:40 +02:00
Dominik Riebeling
97176d444e rbutil: Use progress bar on uninstall.
When uninstalling parts with lots of small files the process can take
quite some time. Update the progress accordingly.

Change-Id: Iecc4553b36abbc1cf9652a325ccb29b62a7fc4cc
2022-04-14 22:37:45 +02:00
Dominik Riebeling
6ef094c1a9 rbutil: Make QtMultimedia an optional component.
We only use it for playing the TTS sample so it's not too important.
Since this is a separate Qt module it might not be installed, so make it
optional.

Change-Id: I2c91dd5d587c8a984525b2297bbe7d597b816b4f
2022-04-14 22:23:35 +02:00
Dominik Riebeling
8a6ceff376 rbutil: Fix sansapatcher bootloader install on Windows.
During bootloader installation sansapatcher disk access is accidentially
set up twice. This is not a problem except on Windows, which will abort
with a "permission denied" error.

This is basically the same problem as for ipodpatcher bootloader install.

Change-Id: I03220e17d0e00a15fff23c02aba7da93d4781964
2022-04-14 22:22:46 +02:00
Dominik Riebeling
cc2f364926 rbutil: Fix ipodpatcher bootloader install on Windows.
During bootloader installation ipodpatcher disk access is accidentially
set up twice. This is not a problem except on Windows, which will abort
with a "permission denied" error.

Change-Id: I9a835ef0d49f24df741b7b2909c4bd87cb1c8341
2022-04-13 21:36:44 +02:00
William Wilgus
b9ab75732a bitmap/list.c fix red
--typo

Change-Id: Iaa632e215d7d1e3758f62fedd72565fa633d925e
2022-04-10 23:59:33 -04:00
William Wilgus
ddcab156f7 gui_synclist move global display settings to list struct
its really painful needing to override global settings in order to change
some aspects of lists

this patch moves:

[scrollbar position, cursor type,
talk_menus, keyclick,
wrap around, scroll paginated]

to variables within the synclist, it also makes updating
after settings changes a necessity

I think I have the static synclists in core covered

(I think the one in gui/list-skinned can be left as is)

this patch allows easy modification these flags on the fly

Change-Id: Id0dcb8b05eb9ecd78929c0aff7678bf2ab4c70a7
2022-04-10 22:24:28 -04:00
Aidan MacDonald
8dbc0914f6 imageviewer: limit progress bar LCD update rate
The progress callback doesn't rate limit LCD updates, which causes
excessive slowdowns (up to 150x!) on some targets. Limiting updates
to 20fps solves the problem and should boost load speed across the
board, particularly for large images and animated GIFs that may run
the progress callback thousands of times.

Change-Id: Ia48924d4dcb24c1111509329581809be494d0165
2022-04-09 23:15:48 +01:00
Aidan MacDonald
32f1418c5a buffering: fix buffer overflows with bitmap loading
In some circumstances it was possible for a bitmap to overflow its
buffer and overwrite the next handle. The easiest way to trigger it
is with a highly compressed JPEG that is decoded to a large bitmap.
Because the JPEG file size is used to determine how much to allocate
this would cause an obvious buffer overflow when the JPEG is smaller
than the decoded bitmap. Fix this by using the decoded bitmap size as
the allocation size. Some overhead must be added to deal with JPEGs,
but it will be freed once the image is loaded.

A less obvious possibility is the fact that add_handle() will allow
a handle to be added even if there's not enough space for the entire
allocation. This is generally beneficial because it allows the first
part of a file to be loaded while waiting for space to free up, but
for bitmaps it is not valid because the whole image is loaded at once.
Hence if there is not actually enough space in the buffer, the bitmap
load can again overflow the actual free space and overwrite the next
handle.

The buffering code supports an H_ALLOCALL flag for allocations that
need the free space available immediately, so use it for bitmaps to
avoid that bug.

load_image() had a sketchy-looking check for free space which stopped
me from triggering the bug with simple tests, but since guessing the
free space is obviously a bad idea when the caller *knows* how much
free space there really is, remove that guess and let the caller tell
load_image() the real deal.

Change-Id: If62a58759705d83c16ee5b50f26bcbccc3f6c01f
2022-04-09 15:20:57 +01:00
Aidan MacDonald
5aa0fc3b00 jpeg: provide a rough estimate of decoder memory overhead
JPEG decoding requires additional space in the bitmap buffer beyond
what is needed for the decoded pixel data. Provide a way to estimate
how much overhead is needed.

The actual overhead is sizeof(struct jpeg) + decode_buf_size, where
the latter depends on the image size and JPEG encoding used. From my
testing decode_buf_size is normally pretty small (under 5 KiB) but
looking at the code it could be large in some cases, primarily with
large images, so 32 KiB seems to be a decent compromise. Someone who
knows better about JPEG should pick a better value if that's too big.

Using a constant is obviously not the most accurate but it seems to
be the simplest option for retrofitting to existing code.

Change-Id: I573b0abb8ca2d79e43f185010487f07226edb793
2022-04-09 15:20:57 +01:00
Aidan MacDonald
7718b24401 buffering: fix signed overflow in next_handle_id()
Not sure what the comment is talking about - signed overflow
is undefined behavior and we don't use -fwrapv or other flags
to make it defined. I can't see how a compiler could abuse it
here, but the overflow is nonetheless easily avoided.

Change-Id: Ibed6d7c0d841db2aa86b9d8ba4c6a0d08c413354
2022-04-09 15:20:57 +01:00
William Wilgus
bd444ebd0a BUGFIX keyboard.c make vp alloc static
don't stop playback to alloc viewports for the keyboard
For the moment it doesn't make much difference
each vp takes about 40 bytes (double that in the sim?)
so not the end of the world 120 extra bytes

Change-Id: I482d7e3061cf9fb8065dc28bf62a6f830770f3c7
2022-04-08 18:11:21 -04:00
Christian Soffke
132034346f Manual: Update PictureFlow
- Update the manual entry for PictureFlow with
the latest features and fix keymap

- Strongly suggest enabling the database's
"Load to RAM" feature (in my experience, this
can lead to a ~60x speedup when building the
album index)

- Suggest enabling the dircache, as it can
noticeably improve the loading times for
album art.

Change-Id: I12c7ce5d5388159da1790fc125f2e20bb78dbf96
2022-04-08 11:19:45 -04:00
Christian Soffke
77717f36e0 Manual: Update fiiom3k keymap
Change-Id: I98250262a3ec17edcd35487411c42db6bfd5ce66
2022-04-08 11:19:45 -04:00
Nick Peskett
db55d30372 Allow cuesheet index offsets longer than 99 minutes.
While the track number is limited to 99, I know of no documented
constraint on the value of offset minutes to 99.

As we are storing the millisecond offset as unsigned long, assuming
32 bit, we can allow 70,000 minutes (2^32 / 60000).

However, I've been unable to generate a test audio file 48 days long
under 2GB, so I've set the limit to 30,000 minutes.

In addition, this change reduces the maximum number of seconds to 59,
and frames to 74.

I've generated some silent test files with the filenames being
cue_[minutes].mp3

http://peskett.co.uk/rockbox/test_cues/

Change-Id: I3ca4468ebc88ba134c4e785e9395f90bf76941ac
2022-04-07 20:10:19 -04:00
William Wilgus
d1be73cfc0 keyboard.c Use viewports, move text box pos
allows items to be moved around with less code changes

remove scrolling I was not overly impressed with it
add test_kbd plugin

Change-Id: Ic183c7221bda9405891632704f3a7bbfd79bfe83
2022-04-07 19:46:56 -04:00
William Wilgus
bf3e67204c lastfm_scrobbler check for back to back repeat entries
if you skip a track after the halfway point the scrobbler may double post
with slightly different timestamps but the same track info

take a crc of the non-unique part and check against the previously
written track

Change-Id: I676342c4cd76f632131d9cb6d9f7d2f59df357e6
2022-04-02 08:05:37 -04:00
William Wilgus
43abe2d820 lastfm_scrobbler check pointers for validity
we need to make sure we don't deref NULL pointers

Change-Id: I9c564b681cd20222c3a134680e60a310b2eb846c
2022-04-02 07:42:06 -04:00
Aidan MacDonald
98f762316f system: update MEM_ALIGN_ATTR for targets with CPU caches
MEM_ALIGN_ATTR should take advantage of cache line alignment on
all native CPUs which define it, not just ARM CPUs. (This could
arguably be done for hosted targets too, but we don't necessarily
know the size of a cache line there.)

Change-Id: Ife9302105ea57388afd55ce31da848b00b5b1b25
2022-04-01 12:08:41 -04:00
Dana Conrad
de285741bf ErosQ Native: Make power delay bootloader-only
gotta go fast

Change-Id: Ic01e4aa70a2bec4c48ae7cf8f32f8dfd366decad
2022-04-01 12:04:46 -04:00
Dana Conrad
7aa2a23b95 Eros Q Native: Add Original Firmware Boot option
Hold "Play" to boot the OF, or boot it from the recovery menu
by holding "Vol. Up". If you had the hosted port installed on your
player before installing the native port, you'll still have to go
through the hosted bootloader.

A couple notes:

- When booting from the menu, the recovery menu disappears, then
  reappears before going into the OF.

- You need to hold the play button for like a half second after the
  blue light comes on in order to get into the OF.

The recovery appears to be there, but it doesn't seem to be intended
for end users - it just says "Updater V1.1 - Insert TF Pls". I haven't
tested it beyond seeing that it boots, so I'm going to comment it out
for now.

Change-Id: Ie271ee479bb628cc74141b7fe07273b3f193f358
2022-04-01 12:04:30 -04:00
Aidan MacDonald
5ffe520de4 playlist: use path_strip_last_volume, clarify path conventions
The comment regarding Windows paths was fairly confusing as to
its intent. What the code is trying to do is replace the drive
letter with the volume containing the playlist, which appears
reasonable. The middle of the comment was devoted to explaining
why the code below was potentially incorrect which only served
to add to the confusion.

AFAICT the last volume specifier in a path will cause search to
start from the root of that volume, so any incorrect result can
be avoided by using the new function path_strip_last_volume().

Finally, add a comment at the top of the function that explains
what it does.

Change-Id: If4e4938801f2f81eb52f5d32b5461872995e5e83
2022-04-01 11:40:02 -04:00
Aidan MacDonald
4f05a9d066 Add path_strip_last_volume
This gets the volume that the path eventually refers to by parsing
the last volume specifier and returning the part of the path after
it (which does not contain any volume specifiers). The initial part
of the path therefore contains everything up to and including the
last volume specifier.

Change-Id: I9a935543256f8f22e0b8b1e3c88d4e47bd9dae8a
2022-04-01 11:40:02 -04:00
Christian Soffke
ca0c3dee0a ImageViewer: M3K keymap allow scrolling up/down
Change-Id: I385354688b1d8f8df4d44e7e177e23bdb6ed3df4
2022-04-01 11:01:52 -04:00
James D. Smith
6e3937e836 lastfm Scrobbler: Substitute album artist for empty artist.
Change-Id: I66dda13ec2cbb592ebe0d269f0c7eff749bc737a
2022-04-01 06:11:42 -04:00
Aidan MacDonald
412dbaeffe hosted: call 'sync' before poweroff
Might be needed to avoid filesystem corruption with buggy OF kernels.

Change-Id: I589eec6c1536beccf849716f11204b4b83a942a1
2022-03-31 21:40:04 -04:00
Solomon Peachy
a9e02b4850 FS13338: Updated Slovak translation (Matej Golian)
Change-Id: I41f794a457435f0d02da180673e272438e3879b2
2022-03-31 21:33:53 -04:00
Solomon Peachy
f08d083ed0 FS13441: Updated Italian translation (Alessio Lenzi)
Change-Id: I442d79842ca1d58d122058171175a6fee844a353
2022-03-31 21:32:42 -04:00
Solomon Peachy
cbb5efd525 FS13340: Updated Polish Translation (Adam Rak)
Change-Id: I5b10231277c6c546400b3d74e3c0339f6026b729
2022-03-31 21:31:33 -04:00
William Wilgus
43830d0128 alarm_menu share setter with settime
share the time picker with the alarm

block the date portion, seconds are ignored

Change-Id: Idc6974466772c33248ff532c8f3c62c744ee06d9
2022-03-30 09:05:28 -04:00
Dominik Riebeling
4c1fe3a899 rbutil: Bump to 1.5.0.
Change-Id: I074da5a2ce33b65d554a7de22a993e536e93f48d
2022-03-27 20:46:54 +02:00
Aidan MacDonald
7243f6b343 x1000: Add multiboot support
Enables multiboot for the FiiO M3K, Shanling Q1, and Eros Q native port.
Note this requires an up-to-date Rockbox _and_ bootloader.

Usage instructions will (eventually) be found on the wiki:
https://www.rockbox.org/wiki/MultibootBootloader

Change-Id: Ia2da1ad6ef611e499d2fbafa93838387bc1023ba
2022-03-27 10:35:02 -04:00
Aidan MacDonald
bcbb5a8b00 multiboot: Allow searching in volume 0 for redirect file
Searching in volume 0 is necessary for multiboot targets with only
one drive, like the M3K/Q1/ErosQ. Without this the search code will
never look at the redirect file on these targets.

The search bound is configured with a setting MULTIBOOT_MIN_VOLUME,
which defaults to 0, but is defined to 1 for Sansa players so they
keep their old behavior.

Change-Id: I6dc5cf98db4258731de2c68c3ab1182b4a4a655b
2022-03-27 09:50:33 -04:00
Christian Soffke
df3afcfa3b PictureFlow: Configurable album sorting
Now offers sorting by:

- Album artist, then album name
- Album artist, then album year
- Album year
- Album name

Years are determined by the most recently
released track appearing on an album, if the
value differs between tracks.

On the M3K,  instead of by going into Settings,
volume buttons can also be used for quickly
adjusting the current sorting

Change-Id: I2c50059617114fb418336c466fdd37415473ac7d
2022-03-27 08:51:58 -04:00
Christian Soffke
aec8b36348 PictureFlow: Prevent queue overflow & simplify locking
Change-Id: I41f620a4fdaf155913a944e7caf4c015990a53d4
2022-03-27 08:51:58 -04:00
Christian Soffke
ae121de149 PictureFlow: Write bitmaps in one go
Analogous to an earlier change w.r.t. reading bitmaps

Change-Id: I68e71160b51eb893f18071cc77d9c9a3ef84de0f
2022-03-27 08:51:58 -04:00
Dominik Riebeling
a490ff896f rbutil: Update german translation.
Change-Id: I5c5cd8a0496dced977c4ed1e7189d43c1b0314f1
2022-03-27 12:57:48 +02:00
Dominik Riebeling
493dce212d rbutil: Fix langstat script.
Change-Id: I323b0e8dbf87f1d53881f5b89f26c5906796fde4
2022-03-27 12:56:34 +02:00
Dominik Riebeling
aaf0f1c371 rbutil: Fix Qt6 Windows build.
It seems Qt6 doesn't require explicit linking to QSvgIconPlugin anymore,
and cmake has trouble finding it. On native Windows builds it isn't
required, so remove it.

Change-Id: I87651f51ab212511947ab9fca3297b0dff276577
2022-03-26 20:29:14 +01:00
Dominik Riebeling
6bc19c98ca rbutil: Fix implicit type conversion on Windows.
Change-Id: I30c5edd5ce0344c47c0f9514eda830a2be8992c4
2022-03-26 20:29:14 +01:00