Commit graph

36162 commits

Author SHA1 Message Date
Dominik Riebeling
3cebc983a2 rbutil: Fix a crash for devices without bootloader file.
Don't try to get a bootloader filename from an empty list. This happens
if the device doesn't have a bootloader file on disk.

Change-Id: Idd4c265e7ae298913c5feefb3963120867a0e858
2022-03-08 22:32:13 +01:00
Dominik Riebeling
911b216aff rbutil: Properly initialize sansa / ipod bootloader buffer.
Fixes a crash on MacOS.

Change-Id: Ibb64a37266182c4ddfee32b2ac47b9d8f25a78e5
2022-03-08 22:32:13 +01:00
Aidan MacDonald
ca12478df6 x1000: add simple binary header to declare the load address
The header format is basic, a variable length list of values
tagged by 4-byte strings. The main application to to allow a
loader to determine the load address of the binary at runtime
instead of using a hardcoded address. But the header contents
aren't fixed and it could be extended for other purposes too.

Change-Id: If51d85b4c2eb53c919a91b54985b157e8e5c20ef
2022-03-06 23:22:49 +00:00
William Wilgus
19d95d7b56 keyremap add plain text import and export
allows users to edit and view keymaps in a text editor
(parser requires one entry per line (LF or CRLF work as line endings)

allow naming of files on save

Change-Id: Id6627171eb96210b2deeef8d15bab3f8d1e0ab3f
2022-03-06 17:00:27 -05:00
William Wilgus
bc3fa53937 Sansa Multiboot Root Redirect Enhance + bug fix
filename buffer was too small to retrieve redirect path

if redirected to sd root remove <SD1> as it is redundant

Change-Id: I1326601f1ba4a18d6bc173798759eb762b55528c
2022-03-06 16:42:26 -05:00
Aidan MacDonald
ee87bfb933 Add support code for dealing with U-Boot uImages
Adds a loader for the legacy uImage format that is commonly used on
embedded Linux systems. It verifies checksums and supports uncompressed
and gzipped images. Supports arbitrary reader functions to allow the
images to be streamed off any storage device, for optimal RAM use.

Change-Id: I93c35f9a6f323999a22a07300e05627fabfcbd2c
2022-03-04 09:02:56 -05:00
Aidan MacDonald
d541a3a191 x1000: fix nand driver reference counting
Somehow I screwed this up as well. Seems it didn't cause trouble.

Change-Id: I5ab99dd9182a4e60d55984fecbf20ca823dbd004
2022-03-04 08:57:35 -05:00
Aidan MacDonald
3cb7167e22 x1000: fix bug in nand_read_bytes
This didn't account for partial page reads properly which resulted
in corrupted data. Fortunately, current released bootloaders do not
perform such reads so they don't trigger this bug.

Change-Id: I426a95ef8d0f20f4567498530e216d80e1aceef2
2022-03-04 08:57:35 -05:00
Aidan MacDonald
3bd5f335f7 inflate: Add helper for getting decompressed data size
Helper for another semi-typical operation: find out how big of a
buffer should be allocated before decompressing. This can be useful
when the stream container doesn't specify the decompressed size.

Change-Id: I5f1536f809bb6f9bc6023120c024c3de7cea4269
2022-03-04 08:44:56 -05:00
Aidan MacDonald
ce4620413b inflate: Add helpers for using in-memory buffers
Using an in-memory buffer for the input or output data for 'inflate'
is likely to be extremely common and there's really only one way to
do it, so predefined helpers should be provided.

Change-Id: Ifd22e7b140a08e0e7dc05aec6b340dff5e2d9d0a
2022-03-04 08:44:56 -05:00
William Wilgus
fe4628fc30 Fix Red Multiboot Firmware Root Redirect
Exclude bootloaders

Change-Id: Id26120df0a047711efe49a43917dfec4c25107cb
2022-03-03 23:20:07 -05:00
William Wilgus
c9857098ac Multiboot Firmware Root Redirect - WIP
Loads external drive into root namespace
Root Redirects can now be put into different folders
For instance placing '/_test' into SD1/rockbox_main.<playername>
will redirect to /<1>/_test/.rockbox
Debug menu>Bootdata now has root directory listed in addition to RAW Bootdata

Redirect root work from Michael Sevakis g#1556, RESTORED -> g#4256

Change-Id: Ia97cf50ff5f5b440877f9c005da6f12c53af931e
2022-03-03 22:08:28 -05:00
William Wilgus
c7bbd5b090 Fix Red SDL, Android mounting root directory, and all the yellow too
Change-Id: Ic5077140fdcb1e3168111336bc428c27a782123c
2022-03-03 20:38:57 -05:00
William Wilgus
0ddac1fdaf Fix Red SDL, Android mounting root directory
Not actually used in either atm

Change-Id: I40e0143fdde1970ac485bf664962c62d4c493d57
2022-03-03 20:08:12 -05:00
William Wilgus
9daacabd65 [RESTORED!] Allow mounting of any directory as the root directory.
Provide definitions for the macros:
* RB_ROOT_VOL_HIDDEN(v) to exclude certain items from the root.
* RB_ROOT_CONTENTS to return a string with the name of the
directory to mount in the root.

Defaults are in export/rbpaths.h

It's a bit much for those that don't need the full functionality.
Some conditional define can cut it back a lot to cut out things only
needed if alternate root mounts are required. I'm just not bothering
yet. The basic concept would be applied to all targets to keep file
code from forking too much.

Change-Id: I3b5a14c530ff4b10d97f67636237d96875eb8969
Author: Michael Sevakis
2022-03-03 18:58:07 -05:00
William Wilgus
f88ea12bac tagcache compress uniqbuf 2 16-bit indices occupy a single 32 bit slot
a lot of space is wasted when file indices less than 65535
entries should be more than 1 byte apart so use the LSB as a flag
when indices are > 65535 set flag to 0 and proceed as before

explicitly mark uniqbuf as 32bit

Change-Id: I54e06c152c369eb6c0322186fe2c1e9a1e6d940d
2022-03-02 20:22:49 -05:00
Dominik Riebeling
ae97d410c5 utils: Set cmake build type to default to Release.
Change-Id: Ie4e6aa326840cb1fbae0fe8d025e592e139d4508
2022-02-28 20:37:32 +01:00
Dominik Riebeling
8d462a1edd rbutil: Rework Logo display.
Replace QLabel with QSvgWidget so the widget draws the svg directly
instead of first creating a pixmap from it.

This also avoids an issue when building with mxe which causes the image
to not show due to a missing svg plugin (which doesn't happen for svg
icons.)

Change-Id: Ic4e265f0567984d1ffe7a3e1cc641df27755e90b
2022-02-28 20:37:32 +01:00
Dominik Riebeling
83e4078d9c cmake: Strip Release binaries when building with gcc.
Change-Id: Iaf87d6b65a38b6d0ecb66c5cb8bc7164741d7419
2022-02-28 20:37:32 +01:00
Dominik Riebeling
72904569e3 Remove outdated theme editor deploy script.
This doesn't work anymore since the switch to cmake.

Change-Id: I3a829cc58412f2e1415c6c9defeb552137757214
2022-02-28 20:37:32 +01:00
Dominik Riebeling
fa1e6cc5bf rbutil: Replace deploy with tarball script.
The old deployment script doesn't work anymore due to the change to
cmake, and since we build the distribution packages (zip / dmg /
AppImage) with cmake directly there's not much need left for the old
deployment.

Change-Id: Ide20887c5bc2e22aabbfb47374d70529609fbc3c
2022-02-28 20:37:23 +01:00
William Wilgus
045f52d475 tagtree.c optmize clause operator parsing
makes WS after a clause conditional optional

Change-Id: I335b5381fb788c19130aa8d57dfb18bb43a07c18
2022-02-28 06:35:11 -05:00
William Wilgus
1bcb1e39ee tagcache, coverity cleanup, Add TAGS_ALL_COUNT
Change-Id: Ia880c921a00b603aa4ba81b0c0670ed00491e41a
2022-02-27 11:01:24 -05:00
William Wilgus
6b360d8b04 action.c keyremap clean-up add logf to core_keymap.c
move the remap out of the loop and eliminate a status flag

Change-Id: I9ab841037a8ea7dff736b452ff55e8242084af82
2022-02-26 00:40:42 -05:00
William Wilgus
887249671c TagTree Show file name for tag_title [UNTAGGED]
fallback to filename as [UNTAGGED] is a terrible way to browse titles

Change-Id: Ifcdc4c27562339b8a916313fb946c88c4eba3b5a
2022-02-25 22:54:47 -05:00
William Wilgus
836616b937 Tagcache Don't create filters when parsing a logical OR
if possible search clauses are converted to filters

once a logical OR is added to the mix (CLAUSE1|CLAUSE2 & CLAUS3))
if CLAUSE1,2 are database non-numeric tags they get made into filters
but the logical OR gets carried to the next CLAUSE

Rather than trying to figure this out just keep all clauses around a logical OR

Change-Id: I03e064e7f897033c5d47d78a1d34238217cde485
2022-02-25 22:04:49 -05:00
William Wilgus
bba0564ec1 keyremap plugin use yes_no prompts, bugfix
use the supplied yes_no dialogs for file delete, key reset, save prompt

return to root menu automatically after loading a file

fix bug where deleting the last file in the list exited the menu

Change-Id: Ib98f6b200b9dee3e4350ad4d7ef80bbb95c77481
2022-02-24 00:26:40 -05:00
William Wilgus
295ec3790d Core Keyremap Allow setting keymap from plugin
Allow setting and removing keyremap on the fly

It was pretty annoying trying to work out a keyremap with a restart
required to set the remap and was quite annoying when I was no
longer able to navigate to the plugin or filebrowser due to setting
the wrong remap

now you can try out a keymap and if it doesn't work a restart will
sort things out

Change-Id: I848fb3bd759f9684ac2497324a371f92b7464f7b
2022-02-23 21:38:27 -05:00
William Wilgus
f7bb9e2167 Add custom action mapping to core
results of an idea I discussed in IRC

changed the way the lookup in the remap file works..

 entries consist of 3 int [action, button, prebtn]
 context look up table is at the beginning
 action_code contains the (context | CONTEXT_REMAPPED)
 button_code contains the index of the first remapped action for the matched context
 [0] CORE_CONTEXT_REMAP(ctx1) offset1=(3), count=(1)
 [1] CORE_CONTEXT_REMAP(ctx2, offset2=(5), count=(1)
 [2] sentinel, 0, 0
 [3] act0, btn, 0
 [4] sentinel 0, 0
 [5] act1, btn, 0
 [6] sentinel, 0, 0

 Note:
 last entry of each group is always the sentinel [CONTEXT_STOPSEARCHING, BUTTON_NONE, BUTTON_NONE]
 contexts must match exactly -- re-mapped contexts run before the built in w/ fall through contexts
 ie. you can't remap std_context and expect it to match std_context actions from the WPS context.

-- Done --

Code for reading core remap entries

-- Done --

import of core remap entires from disk
-- Done --

plugin to set new key mapping (the hard part)

The plugin is started and FULLY functional
you can add actions and contexts
you can change context, action, button, prebtn
delete keymap files
load keymapfiles
save user keymaps
test keymaps before applying them
loading keymaps to core still requires restart
-----------------------------------------------------------------------------------------------

Change-Id: Ib8b88c5ae91af4d540e1829de5db32669cd68203
2022-02-23 08:47:12 -05:00
Solomon Peachy
7952687185 FS#13337: Updated Slovak translation (Matej Golian)
Change-Id: I067c5a8e26b44def88fa60b38aabd1d014555e23
2022-02-22 11:15:02 -05:00
Aidan MacDonald
e8faf2f2ad buflib: add a common dummy callbacks struct & use it
There are various allocations that can't be moved or shrunk.
Provide a global callback struct for this use case instead of
making each caller declare its own dummy struct.

Also fixed ROLO and x1000 installer code which incorrectly
used movable allocations.

Change-Id: I00088396b9826e02e69a4a33477fe1a7816374f1
2022-02-12 10:24:32 -05:00
Wolfram Sang
95dfc489b5 sync clock with RDS time
Tested with my SansaClip+. I don't think this will need extra battery
but let me know if I am wrong.

Change-Id: I287dae134113e0f8a138af68f5087b8ea45b0f4c
2022-02-07 22:04:10 +01:00
Wolfram Sang
5b8873bf33 RFT: convert Gigabeat RDS to thread
This kind of reverts 7b596416bf ("Gigabeat S: Update RDS processing to
use asynchronous I2C rather than thread."). However, requiring RDS to
run in thread context will a) allow more upcoming features and b) remove
quite some complexity from the codebase (see the diffstat here) because
Gigabeat is the only user. iMX31 should be able to handle one more
thread, as it can even run Linux.

Change-Id: I46130034595ba66392c5417c275d036f4bd26943
2022-02-07 22:01:20 +01:00
Christian Soffke
8d453ae9c3 Fix glitches with custom list title viewports
Elements were not being drawn correctly or
title text appeared delayed in several places
when using themes with a custom viewport
for list titles.

E.g.:
- after deleting a shortcut
- when returning from a warning screen in
Playlist Viewer
- returning to some Settings screens
- in "Playing time" screen

Change-Id: I8ab07a31d4b6f290e089ecd7857f43ec195a06e0
2022-02-06 11:20:34 -05:00
Solomon Peachy
04cbb3c7e4 misc: Add 'mpga' as a valid file extension
Some podcasts use this, apparently.

Change-Id: I24f372ed760f15e204dba3a99552ad3b6a051515
2022-02-01 13:23:39 -05:00
Christian Soffke
fb91184c4f PictureFlow: Fix broken (iPod) keymap
I must have only tested de8ee6c9e9 using my
custom iPod keymap. Re-mapping the "Left"
and "Right" buttons in this context badly breaks
existing behavior in Pictureflow when using
Rockbox's default iPod keymap.

Change-Id: I2aff6297d7e229a056383afe6074c41829b38e2d
2022-01-30 16:36:07 -05:00
Solomon Peachy
2ddbb9cad5 Fix manual build on some targets (76a2a00732)
Change-Id: Iaf87d11cd2ce3faf9b98da0a1978dfd3fcdb2ba8
2022-01-30 16:33:58 -05:00
Aidan MacDonald
b25d8457bc Shanling Q1: fix DAC power mode switching
The OST prescaler bugfix (7a5130a277) broke runtime switching
between 1.0V and 2.0V modes. The 1ms delay after shutting down
the DAC isn't long enough to reset it, so it gets stuck in the
power mode assigned at boot. Change the delay back to 4ms, the
effective value prior to the OST bugfix.

Change-Id: Ic4583d1a6fa82540062aa185386f14bbf785a3f4
2022-01-30 17:37:24 +00:00
Wolfram Sang
76a2a00732 si4700: optimize RDS cache update a little
use si4700_read() instead of si4700_read_reg() to make it clear we are
not interested in the register itself but in the cache update. Also, a
tiny bit more efficient as we save a function call and don't request a
return value we don't use anyhow.

Change-Id: Ibbb66fd9e5ea748ba11ac3c2a0570f5219b72637
2022-01-30 12:27:30 -05:00
Wolfram Sang
68887b4730 manual: reenable "Configuring the Theme" for devices without remote LCD
Commit 0c4f89370d ("[2/4]  get rid of HAVE_LCD_CHARCELLS") missed a
closing brace which disabled the above topic in my Sansa Clip+ manual.

Change-Id: Ic7a104757f258a37628645389dbfa1b6c8499415
2022-01-30 12:26:36 -05:00
Solomon Peachy
e91e8439ca FS#13335: Updated Polish translation (Adam Rak)
Change-Id: I6288e6c64d82cc737c5ec1dd3651aa0793894d29
2022-01-30 12:15:51 -05:00
Solomon Peachy
6fd18ef4a5 FS#13334: Updated Italian translation (Alessio Lenzi)
Change-Id: Icfc81db225911d1b034e5c77b3d4cf0baec210c2
2022-01-30 12:15:03 -05:00
Aidan MacDonald
127bb1b6e1 FiiO M3K: remove volume setting on rec. screen
This controls the playback volume, which is not useful for
the M3K because it's impossible to play back and record at
the same time.

Change-Id: I5b0931c22b484f3ff6441d6c88079f18ec70f7f8
2022-01-29 15:13:54 -05:00
Aidan MacDonald
c1f1d91404 FiiO M3K: audio recording
Recording works now, although I'm sure there will be a few
things that need fine-tuning. A major issue is that writing
to the SD card creates noticable interference, which happens
on the original firmware too but seems worse under Rockbox.

(Since Rockbox waits until RAM fills up before writing data,
the interference will only be heard on >50 MiB recordings.)

Change-Id: I5561dd9668c3bdd34e92f34ef50848aef8c0b7eb
2022-01-29 19:28:03 +00:00
Christian Soffke
bc5a638594 Option to switch off album art or to prefer file over embedded
Large embedded album art can cause pauses during
playback or when skipping between tracks, especially
on older devices, but embedded art is currently loaded
even when separately stored smaller image files would be
available.

A workaround is to remove large album art from the
metadata of files.

This now adds a setting to either turn off loading of
album art completely, or to prefer loading the album art
from a separate image file and thus ignore the embedded
versions.

Change-Id: I22fb581abf56072e35e6c29d72e553747ec1a96a
2022-01-22 08:29:40 -05:00
Aidan MacDonald
aafe2dd2d1 tagcache: don't allow temp commit buffer to be moved
The temporary buffer used during database commit did not
have any buflib callbacks set, which allows it to be moved
by buflib at any time. The code is not prepared to deal
with this, so things break horribly if anything tries to
allocate during the commit.

The solution is to pass dummy callbacks to prevent the
buffer from being moved. I expect this may create other
issues since the commit uses up all available RAM, but
at least things won't get silently corrupted anymore.

Change-Id: I3183aaee58c94bfbaf4e24424030b8be6e341d22
2022-01-18 19:45:55 +00:00
Aidan MacDonald
525eb15864 recording: fix mono mode mixdown functions
Rewrite copy_buffer_mono_* functions for correctness.

Bad pointer arithmetic in copy_buffer_mono_l produced
wrong results, or panics on archs which can't handle
the unaligned pointer.

None of the functions handled zero size copies properly
though this probably wasn't an issue in practice.

Change-Id: I81c894e1b8a3440cb409092bec07fe3778a78959
2022-01-17 00:37:12 +00:00
Aidan MacDonald
f68c6c14d9 recscreen: clean up menu building code
Remove the use of constants and ifdefs in favor of a
single enum and build the menu with a counter. This
simplifies the source and optimizes to the same code.

Change-Id: Ib07f0634ac8f663452c3e6e3c3d92fb6da1a1b4c
2022-01-17 00:37:12 +00:00
Aidan MacDonald
acc7d16e3b Fix some hardcoded assumptions in recording.c
There were some hardcoded branches handling left/right gain for line-in
or FM radio inputs. If the target only has a microphone, these bits are
useless and cause compile errors due to missing audiohw settings, etc.
This patch #ifdef's them out.

Change-Id: If6a6918b2fabb256261c84651803bbf44deacb1a
2022-01-17 00:37:12 +00:00
Aidan MacDonald
8e65f1db55 manual: Document the DAC power mode setting
Make a note of the fact that the M3K DAC's high performance
setting is not necessarily the highest quality setting --
see forum post
https://forums.rockbox.org/index.php/topic,52917.msg249741.html#msg249741

Change-Id: If0196d2a224868aae10d61f66bac2e8c6843263f
2022-01-16 19:35:40 -05:00