Commit graph

36619 commits

Author SHA1 Message Date
Aidan MacDonald
a9b93bb4cd buflib_malloc: fixed signed/unsigned comparison
Change-Id: Ie346759a0dda96debd8448fd44ca3e86d40ef348
2023-01-16 16:57:23 +00:00
William Wilgus
d521020d21 [Feature] Add total entries to database info
show total database entries in debug>Database Info

Change-Id: Ic22b6a032ae0ee23e0f38c0da6a9cf1433ba29e2
2023-01-15 22:57:00 -05:00
Solomon Peachy
d39fcf5c89 Update english-us "translation"
Change-Id: I479e1fd337d3384241959782f3f2720e0cac6578
2023-01-15 20:32:14 -05:00
Solomon Peachy
0d8b3fe0b9 FS#13385: Updated Polish Translation (Adam Rak)
I applied the wrong diff, which missed a bunch of stuff.

Change-Id: I3c4da707243c5c0d579ad3130194bfb70fcb4d45
2023-01-15 20:32:14 -05:00
Solomon Peachy
2cb9c7ac29 FS#13385: Updated Polish Translation (Adam Rak)
Change-Id: I346440642c6de0ad5fe73a9cf384dafe266c1e03
2023-01-15 16:41:48 -05:00
Aidan MacDonald
56442f6b7f rbcodec: Fix FLAC out of bounds read
Commit 6bcd830490 ported an optimization to decode_subframe_fixed()
from FFmpeg (upstream commit 08965b22e2). This contains an out of
bounds read, which doesn't affect the decoder output, but makes ASAN
complain.

FFmpeg fixed the out of bounds read (upstream commit 0ec7b71de8) but
that appears to increase code size a lot.

Inlining the initialization of a, b, c, d into the switch produces
similar code as the non-bounds-checked version with only a handful
of instructions of overhead (checked on MIPS & ARM).

Change-Id: I053fac4efc4676b133eb7545c80e23f37fb00d86
2023-01-15 16:11:28 -05:00
Aidan MacDonald
67cb2e3cdc Add core_get_data_pinned(), use it where possible
Change-Id: I1b2f62f27780f99423085d2fffc972ea2701f998
2023-01-15 08:57:45 -05:00
Aidan MacDonald
9e53d5541f "Fix" warble build warnings 800bc000a0
Not really sure how best to deal with the warnings (redefinition of
ARRAYLEN, etc.) short of splitting things out of system.h but this
is good enough for now.

Change-Id: Ibea9f693d128c7995f564f0f5c81d572462a5553
2023-01-15 13:33:22 +00:00
Aidan MacDonald
800bc000a0 buflib: Add pinned get/put data functions
These are more efficient than separate pin/unpin calls because
pin count increment and decrement can be done cheaply when the
data pointer is known.

Secondly, pinned access can be made safe against preemption by
hardware interrupts or other CPU cores; buflib_get_data() can't.
This makes it more useful under different threading models and
for SMP targets; both of which are not particularly relevant to
Rockbox now, but might be in the future.

Change-Id: I09284251b83bbbc59ef88a494c8fda26a7f7ef26
2023-01-15 11:06:27 +00:00
Aidan MacDonald
92565e9246 buflib: Add malloc-backed buflib
This is intended for improving the effectiveness of tools like
ASAN when debugging memory errors in the sim. It's not meant to
be a serious allocator for hosted targets.

Enable it by changing the buflib backend in config.h.

Change-Id: I0cf23cefa47ee35dede7b49e0e5b72dac60e8d3e
2023-01-15 10:04:13 +00:00
Aidan MacDonald
f2f198663e buflib: Move the API back into buflib.h
To minimize code duplication between buflib backends move the
public part of the API to buflib.h. Also rewrote documentation
for the whole API.

Change-Id: I4d7ed6d02084d7130cb41511e63c25ec45b51703
2023-01-15 10:04:13 +00:00
Aidan MacDonald
f995c26de9 buflib: Add CONFIG_BUFLIB_BACKEND for selecting a buflib backend
Defaults to the normal "mempool" backend, which is currently the
only implementation.

Change-Id: I56d034a6e0f5edc90c39526d1551945eec6ca336
2023-01-15 10:04:13 +00:00
Aidan MacDonald
680261fbb7 buflib: Prep for multiple backend support, rename to buflib_mempool
Rename the current buflib implementation to buflib_mempool.

Change-Id: Iefdf74be1f7d8fcd19e6ce2289c3d1459b54d013
2023-01-15 10:04:13 +00:00
Wolfram Sang
e23c78522a si4700: remove unneeded ';' directly after a 'case'
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Change-Id: I3527308cc2495ef5c09b63a071a2c3bdc8ad0e5e
2023-01-14 21:17:58 +01:00
Christian Soffke
e61a5c957c PictureFlow: Add ability to insert into playlists
Songs or albums can now be added to new or
existing playlists directly from PictureFlow.

Change-Id: I6ea27e393fee0d5688385f9e91cf835be1756a7a
2023-01-14 19:44:11 +01:00
Christian Soffke
1e4ee1917c Fix red in 7f265ee
Change-Id: Ib2496af0ed6176ea537e1f61804c1ba514374fb6
2023-01-14 19:40:29 +01:00
Christian Soffke
7f265ee8dd Database: Add ability to insert multiple files into playlists
You could only add single files to playlists
from the database browser before. This
enables adding any database selection to
a new or existing playlist.

Change-Id: I811c7167641c589944bb2afc18dcc1d299a7b979
2023-01-14 12:14:28 -05:00
William Wilgus
cc79f1b543 on_play.c clean up playing_time
move seconds and sizes to arrays indiexed by enums
use a loop for the display and talk of each
stop exiting on SYS_EVENTs

Change-Id: I49d5b9827df4e711b38326e5fef3c54292000370
2023-01-14 10:31:56 -05:00
William Wilgus
6e08731835 [Feature] onplay.c Playlist Playing Time more fault tolerant
bad tracks now get skipped with a message at the end of scanning
rather than an error killing the count

Change-Id: I6d8c14ce00e78416b772bc5e9093a889351bc3de
2023-01-14 00:46:08 -05:00
William Wilgus
202d8939c8 [Feature] xduoo X3 add pitchscreen hotkey to wps
Back(home) + option in that order will bring up the pitchscreen

Change-Id: Iee1f7faf9415033ec8dbd0832e8550e86cd0a844
2023-01-13 23:56:10 -05:00
William Wilgus
958daa925e [BUGFix] ClipPlus move picker below yellow screen split
Sansa Clip and Clip+ have a split monochrome screen
 some versions have a dead line of pixels
having text split at this line makes it hard to read
move text picker below this split on these devices

Change-Id: I1ebcb4c4c7b1ea950f38e35fed06ed85437a657f
2023-01-13 23:12:28 -05:00
William Wilgus
91c7e333d7 Revert "keyboard.c make editline respect current UI font"
This reverts commit ebebef5566.

Reason for revert: I don't want to get too deep into this till I come back to the keyboard rewrite (hopefully)

Change-Id: Ia273f1a19a042be2dd0f1ee46690c03f2865cd95
2023-01-13 22:46:25 -05:00
Solomon Peachy
255a34c685 fix red from #641e91aa2f
Change-Id: I7e648a7bdf1d706258afd49c1edd63655b2d2830
2023-01-13 17:02:23 -05:00
Solomon Peachy
641e91aa2f jz47xx: Add support for INIT region
Change-Id: I100cd661e9b1225167463542800c6aafbc3c17b3
2023-01-13 16:14:42 -05:00
Solomon Peachy
fe16ab33dd toolchain: Bump zlib to 1.2.13, for reals this time.
Change-Id: I4907b2785b7b05d92d2f09de8228525b84947213
2023-01-13 16:04:39 -05:00
Solomon Peachy
dc0d05e220 toolchain: Bump zlib to 1.2.13 due to 1.2.12 being withdrawn
Change-Id: Ia79e19464f5042305fc1707bf4b18483f9051071
2023-01-13 15:29:04 -05:00
William Wilgus
40355caefd buflib_shrink use NULL to signal start isn't changing
Change-Id: Id3e86d3860b8ed860dc6dcbc394b1b8f9f3274b5
2023-01-13 09:50:29 -05:00
Aidan MacDonald
719d48afc4 buflib: Refactor various debugging features
Gate buflib_get_data() checking, debug printing, and buflib
integrity checks behind individual defines in buflib.h, and
turn them all off by default. If needed, they can be turned
on manually when compiling.

The buflib debug menu is only available if debug printing is
enabled, so after this commit it will no longer be included
in normal builds -- it isn't very useful to end users.

Change-Id: Iab25b7852bc7c5592ce04c9c45762046a87d5bc3
2023-01-13 10:32:57 +00:00
Aidan MacDonald
e492b51d83 buflib: Remove block start / end distinction
Removing the variable-length name in the middle of buflib metadata
makes it a lot easier to deal with.

Change-Id: I6eaf236c2285cae40fb6ff0fa5acf827972cdd8b
2023-01-13 10:32:57 +00:00
Aidan MacDonald
5a3ee83555 buflib: Remove CRC checks
The CRC is a fairly useless safety check because we already
have specific checks to validate the metadata, and CRCs are
only verified before calling the move callback. Removing the
check should not significantly reduce buflib's robustness.

Change-Id: Ica99bd92fc514819b4fd9f359b4272e581020f75
2023-01-13 10:32:57 +00:00
Aidan MacDonald
31f03d9433 buflib: Optimize away the BSIZE metadata field
Now that allocations are unnamed, BSIZE is a constant.

Change-Id: Iab52cbebe426ea0d12f428582347e20ed243367f
2023-01-13 10:32:56 +00:00
Aidan MacDonald
1e9ad3ca0d Remove buflib allocation names, part two
Remove allocation names from the buflib API and fix up all callers.

Change-Id: I3df922e258d5f0d711d70e72b56b4ed634fb0f5a
2023-01-13 10:32:54 +00:00
Aidan MacDonald
3301c5aa6d Remove buflib allocation names, part one
Remove the name handling code, but leave the allocation structure
otherwise untouched; it's as if all callers provided a NULL name.
The public API still accepts names but names are no longer stored
or returned.

Change-Id: I6c4defcdfd255774f02030949a0fd731477e6a54
2023-01-13 05:12:17 -05:00
Aidan MacDonald
879888b158 Avoid using buflib names for storing font paths
Naming your allocations is more of a debugging feature; it's a
bad idea to abuse this feature for storing some random string.
The font code does exactly that to remember the path used to
load a font, and it's the only code that uses buflib names in
this way.

Store the path inside the font allocation instead as a regular
char array. For simplicity it's MAX_PATH sized, so this'll use
a bit more memory than the buflib name method, maybe 1-2 KiB if
a few fonts are loaded.

Change-Id: Ie286a1a273d6477af9e5d3f76e0534b62f72e8f7
2023-01-13 04:54:05 -05:00
William Wilgus
ebebef5566 keyboard.c make editline respect current UI font
Change-Id: I4dc95d42544a10df8086cc58c4a305d45b56bb1b
2023-01-13 01:36:45 -05:00
William Wilgus
2d9cb673e5 add chunk_alloc to playlist.c #2
dc_thread_playlist was asking for invalid indices
since previously the name buffer would have been valid
it just got whatever junk data was left over

add dc_discard_playlist_pointers for HAVE_DIRCACHE targets
this allows the dc_playlist_thread to stop its current lookup loop

Change-Id: I6f25b97b8c4e314d27c5e1e6ff0925b5a3e93f26
2023-01-12 19:36:38 -05:00
William Wilgus
00c7817c9c [BugFix] playlist.c DIRCACHE stop scanning when changing indices
dc_playlist_thread may continue loading pointers even while
underlying indices are changing instead stop the loop by marking
pointers as clean and rebuild later

Change-Id: If154f673b4af8d6e9c364499d58f1321834a76a4
2023-01-12 19:36:38 -05:00
Aidan MacDonald
16a32c576c Fix red in 7e5fc4076a
Change-Id: I1704ea0de243bff05262556723daea5b3531558b
2023-01-12 11:56:47 +00:00
Aidan MacDonald
7e5fc4076a Add INIT_ATTR to i2c_init()
It's usually only called from init() in main.c, so this is safe.

There is one more call in system-dm320.c from system_init(), but
that's also "safe". I don't know if it's okay to call i2c_init()
twice, but presumably it works...

Change-Id: I9c1cd918d162d9955f7cf03209e836cbd5e30c57
2023-01-12 06:33:50 -05:00
Aidan MacDonald
39439f6909 Add INIT_ATTR to system_init()
On single-core targets, system_init() is only called from init()
in main.c, which is also INIT_ATTR, so this is safe.

Multi-core targets additionally call system_init() from cop_main(),
which isn't marked INIT_ATTR. I'm fairly certain that it would be
safe to add INIT_ATTR to cop_main() with a bit of refactoring, but
I don't have a way of testing it. So for now, leave INIT_ATTR off
for multi-core targets.

Change-Id: I8fe4358f975880ca317d46bda01d7d9db529d3e3
2023-01-12 06:05:55 -05:00
Aidan MacDonald
541960a110 rbcodec/dsp: restore configure loop in dsp_init() (FS#13386)
It seems removing this causes a crash on the Clip+ when playing
any file. Appears to be a timing-related issue as replacing the
loop with an mdelay() also fixes it. Needs further investigation
to identify the real cause of the problem, see FS#13386.

Change-Id: Ia93a2887a79b376de50563d6bb3bbc79cee11a1c
2023-01-12 04:56:06 -05:00
William Wilgus
746fd7f2db Revert "add chunk_alloc to playlist.c"
This reverts commit 89c021fbfa.

Reason for revert: crash when playing on disk playlist then playing a directory as an in-ram playlist

Change-Id: Ia5cf5da9f46f8c10c5c0f3707e7978c05664b8a4
2023-01-11 01:14:22 -05:00
William Wilgus
89c021fbfa add chunk_alloc to playlist.c
Change-Id: Ia2e02a61f0b269dc0508717a56a2ca1a334d2378
2023-01-10 23:59:19 -05:00
William Wilgus
7faf6be35f chunk_alloc
chunk_alloc allows arrays (or any data) to be allocated in smaller chunks

you have to save the indices..
 variable data will have variable indices you need to
 store these as [chunk_alloc] doesn't keep track
 if you have a fixed size for each
 alloc you can do indice / sizeof(data)
 or index * sizeof(data) to convert

Lots of debug stuff still in and it needs optimization

User provides chunk_size and max_chunks
max_chunks * struct chunk will be allocated at start
with (1) chunk_size allocation initially

alloc_chunk() with size = 0 shrinks the last allocation to the size of the data used

add OOM checks on buflib_alloc -- oops

move bytes available to the header -- less memory per chunk & better alignment
keep track of the current in use chunk index -- should speed things up a bit

Now allows:
realloc chunk header
larger allocations than chunk size

reallocs smaller than existing will shrink the current array
rather than alloc a new and copy data

Comments welcome :)

Change-Id: I8ed170eef73da95da19430a80b32e5debf0c8276
2023-01-10 23:59:19 -05:00
Christian Soffke
a513cee822 PictureFlow: Add 'Track Info' for tracks or whole albums
Context menu gains new option to view
metadata for individual tracks or albums.

Will display an album's length and total file size.
Other fields are displayed only if they are identical
across all tracks (except for the album year, which
is determined by the highest value encountered).

Change-Id: Ibc14cfaf2cb3d91b8d1cfbee05c6261db4975355
2023-01-10 18:50:12 +01:00
Christian Soffke
d5e38062ea Fix hotkey strings
missed in 7d13c0c

Change-Id: I7299b6a646dc143943b2c8d1d89ecdc4a16667c7
2023-01-10 17:05:53 +01:00
William Wilgus
3694314058 [BugFix] voicefont.c buffer overflow
voicefont.c expected a max of 999 voice IDs we are at 1013 or so
bad stuff happened TM new limit is 2048 and added an error message
(no file will be created if limit exceeded)

Change-Id: Ifda6dc5c45883551f8ae8f0d4efc9f7acdb7c90f
2023-01-08 15:43:05 -05:00
William Wilgus
282a54b23c [Feature] filetree fallback to loading a playlist from disk
give user option to load playlist from disk when
namebuffer is too small -- max_playlist size still
limits the total entries but filename length
 won't stop them from playing the directory

Change-Id: I1787689417661ea670a211f575f2c52e84465869
2023-01-08 09:52:23 -05:00
Aidan MacDonald
593103cd8b lcd: Fix 4bpp optimized 16-bit alpha blit
Fixes a bug introduced by commit 5d0c382a59 that caused graphical
corruption on anti-aliased fonts.

Change-Id: I6052ca758382bd9a1154d2e2208dee633dd17715
2023-01-08 10:50:39 +00:00
Christian Soffke
528b6a9a15 manual: Update screenshots
Change-Id: I264210ee0a759fc3a7e89578f7d9d32d58dfd609
2023-01-07 19:48:26 +01:00