Commit graph

36247 commits

Author SHA1 Message Date
Aidan MacDonald
e05aa27124 x1000: move NAND commands to header file
Change-Id: Ic95b80494a101f7b349e115d82e9dfe3a64b643f
2022-05-30 14:02:13 +01:00
William Wilgus
1d39261338 lastfm_scrobbler Add settings WIP
add settings to the scrobbler plugin
Start Playback -- resume playback at plugin start
  (while enabled if nothing to resume will bring you back to scrobbler menu)
Save Threshold 0-100% -- when this much time has passed the track will be
  saved and marked (L)istened

Verbose -- Supress messages such as 'Scrobbler Started' and 'Scrobbler Flushed'

run the plugin a second time to bring up the menu
if you have resume playback enabled and there is nothing to resume
it brings you back to the scrobbler menu as well

Change-Id: I48d96ea3dc8f37d76a723136004af149429e0b2e
2022-05-28 06:23:37 -04:00
Aidan MacDonald
7345666d9c plugins: use menu for lastfm scrobbler TSR exit callback
Use standard menus and yes/no screen for the TSR exit callback,
similar to the recently added test_usb plugin. This removes the
need to define key bindings and it provides a more consistent
user experience.

It also allows the "flush cache" message to be popped up in the
main thread - doing it from the worker thread is unreliable and
the message often disappeared because the main thread did a UI
update immediately after leaving the plugin.

One issue is that quitting the plugin by selecting the scrobbler
plugin itself immediately restarts the scrobbler. This is because
there is currently no way for TSR plugins to terminate themselves
either through the exit_tsr callback or otherwise.

Change-Id: I9690239d5bd58ad2fbb36fd15a10683757aff0ff
2022-05-28 06:23:08 -04:00
Aidan MacDonald
85232fadbb simulator: fix off by one error in USB ack calculations
The sim's printout of the number of expected USB acks was off by one.
Since the sim queue is not registered for broadcasts, it will not
receive an ack message and does not need to account for itself when
determining the number of acks to expect, unlike the USB code.

Change-Id: I6715039c05c1ea95099716c5251d401e37f5b085
2022-05-22 15:34:42 +01:00
Aidan MacDonald
5ee9a45126 mips: stop backtraces at main()
Initialize ra=0 before calling main so backtraces don't walk
through the startup code.

Change-Id: Ia8796ce38b32d14025b47b3e00061267ee25cbaf
2022-05-22 07:16:11 -04:00
Aidan MacDonald
981e972839 mips: add native backtrace implementation
Should make debugging crashes on native MIPS targets far easier.
This is by no means a 100% complete or robust implementation but
it seems to handle the vast majority of functions.

Change-Id: Id5f430270e02b5092b79026b6876675c784aa649
2022-05-22 07:16:11 -04:00
Christian Soffke
cade488b08 pictureflow: Fix 'Update Cache' function and update manual
The artwork cache was previously always rebuilt,
even if you had selected the option to update.

"Preparing artwork" should be much quicker now
after a database update.

Change-Id: Ie81486e29d596b52afd21b01ba54c73f1b402be2
2022-05-22 06:55:58 -04:00
Christian Soffke
b357585852 pictureflow: Fix slide_index bound
Parameters for fbound were in the wrong order
and slide_frame wasn't assigned the bounded value

Change-Id: I9b466e8b45e4318cadf59298f8c1145fa4d30ede
2022-05-22 06:55:58 -04:00
Christian Soffke
5146c3043f pictureflow: Fix concurrency issues building art cache
Guards against possible image corruption

Change-Id: Id7e1e3a09cb13c255eea0ffdd2e4c4d558086997
2022-05-22 06:55:58 -04:00
Aidan MacDonald
c116db6065 plugins: add USB TSR test plugin
This is intended for testing USB event delivery to TSR plugins.
Usage:

1. enter plugin -> select Start
2. plug and unplug USB
3. reenter plugin -> select Status
   it should display "State: disconnected" then "Prev: connected"
4. when done -> select Stop Plugin

Change-Id: I6c70f452db642f3fcbfbcb4f06c57f93e60f4cfd
2022-05-21 14:58:55 +01:00
Aidan MacDonald
2f71571c0a Fix faulty Play Shuffled behavior (FS#13347)
When replacing a dynamic playlist with Play Shuffled, the current
track could incorrectly be left at the end of the new playlist.
Fix this - the current track should always be at the beginning,
so it can be skipped past regardless of the repeat/shuffle mode.

Change-Id: Ia86539bc23ad8ebd714b8dc50b5720671b4ad0a9
2022-05-15 15:23:36 +01:00
Aidan MacDonald
2315266628 kernel: remove unused function mutex_test()
No longer needed since the only user was in the Archos code.

Change-Id: I763f58050c70f2bb1d8cc0a044c63698f3157a8d
2022-05-14 11:29:55 -04:00
Aidan MacDonald
dafc8e5904 kernel: remove unused kernel/pthread/*.c files
These don't seem usable and it looks like the files were added by
accident by d66346789c "buflib: Check the validity of of handles
passed to buflib_get_data() in DEBUG builds."

Change-Id: I4d4601f1fef7901c08ae86448853d008f48d5f43
2022-05-14 11:29:55 -04:00
Aidan MacDonald
d20071def0 apps: Add "keep current track when replacing playlist" setting
Add a setting that makes Play and Play Shuffled in the playlist
context menu leave the current song (if any) playing when they
replace the playlist. Default to on, since this was the behavior
of the old "Clear List & Play Next" option.

Change-Id: I1340aed5c28bb3244e36d0953b3308ae59681c97
2022-05-14 16:05:46 +01:00
Aidan MacDonald
70087fb9f3 apps: Change playlist context menu behavior, fix FS#13336
Rename the "Clear List & Play" options to simply Play and Play
Shuffled, and change their behavior slightly. Previously they
would leave the current song playing, but now they will start
playing the first song of the new playlist immediately.

Shuffle options are now consistently hidden whenever a single
file is selected.

Fixes FS#13336 -- Play Shuffled is now always displayed where
applicable, regardless of playback state.

Change-Id: Idd454b4f9ab2c98cda3ce0389add747a3273fb42
2022-05-14 16:05:45 +01:00
Solomon Peachy
7363d65f10 manual: Fix up some issues to try and get texlive2021 working ok.
Change-Id: I6fd5cfd7f27792cffbd061d96fdc8c852cc85050
2022-05-09 10:36:42 -04:00
Christian Soffke
f3358eb20a Properties plugin: Eliminate redundant Track Info code
When opening an audio file from the file
browser or database using the Properties
plugin, it will now use existing code from
the Show Track Info screen for displaying
metadata. The menu option has been
renamed accordingly.

Change-Id: I5a824865b9f980151b91aff3c3c18ec45830a12c
2022-05-09 09:44:23 -04:00
Aidan MacDonald
4b293285ea pictureflow: fix album index alignment in load_album_index
Change-Id: I7c3c86ffdab62859ce88faeeb84160ea52a4626a
2022-05-07 16:28:27 +01:00
Aidan MacDonald
f661dc596e pictureflow: fix bug in calculation of album art buf size
I intended to check for enough space in buffer but this isn't
really doing it and it is making aa_bufsz slightly too big so
it's a possible buffer overflow.

Restore the old ALIGN_DOWN(..., 4) rounding in case it's important,
if not, then no harm done.

Change-Id: I904f255ac79a77d5328b44667502ceae8308e659
2022-05-07 15:52:26 +01:00
William Wilgus
2c4480979f tdspeed.c remove buffer name strings
get rid of the magic buffer size and the whole name buffer
naming the buffers individually doesn't serve any real purpose
instead add a static string for all td buffers

Change-Id: I962a966456453e1b84bab6fec6f4df7cb075ef4e
2022-05-05 00:31:07 -04:00
William Wilgus
09ef94ed8b add const to const * strings iriver Fix Red
the iriver devices overwrite the pointer

Change-Id: I20ae6db2aec0f957824b61db349c7c45a95e58d9
2022-05-03 23:58:00 -04:00
William Wilgus
79864c6ec2 add const to const * strings
I don't think this will amke any difference except maybe for hosted ports

Change-Id: I84f898aea92a6963901a6d889dd18b63f24c9a41
2022-05-03 23:00:58 -04:00
Aidan MacDonald
4dd3c2b33e codecs: m4a: improve seek accuracy
Seeking doesn't work well in M4A files with very few chunks due to
the seek method used (chunk based using the info in the 'stco' atom).
According to libm4a/demux.c the expected seek resolution using this
method is 1/4 to 1/2 seconds. However, ffmpeg generates files with a
1 megabyte chunk size, so the resolution is much worse than expected
on some files: around 30-40 seconds at 256kbps.

There was a bug with the seek position reported back to Rockbox: the
codec pretended it could seek exactly to the requested sample, but it
would only seek to the start of a chunk. This could leave the UI in a
confusing state because the real playback position was different from
what the elapsed time showed. Fix this by recalculating the reported
sample position using the chunk start.

To fix the low seek accuracy, use the table in the 'stsz' atom to skip
individual packets within a chunk. This is very accurate, but it takes
a lot of RAM to allocate the table. Currently the table is not allowed
to use more than half of the codec RAM, which should suffice for short
files on most targets. On files where the table is too large the codec
will fall back to the less accurate chunk-based seek method.

Change-Id: Ide38ea846c1cdd69691e9b1e1cd87eb0fa11cf78
2022-05-02 12:16:21 -04:00
Aidan MacDonald
b79eefc858 apps: fix tagtree arithmetic on null pointers
It was possible for the tag tree's buflib move callback to turn a
null pointer non-null. The tagcache_search_clause->str can be null
for OR clauses. Also ensure that clauses are zeroed on allocation
to ensure garbage pointers don't creep in.

Change-Id: Ic823a8eecc501eeaa75798066521e427a9a89190
2022-05-02 16:48:19 +01:00
Aidan MacDonald
6e37b31851 apps: fix use of negative fd in open_plugin.c
Bug reported by UBSan.

Change-Id: I3223a496dfa5df4e3df97fb88a14ea0174d4b428
2022-05-02 16:42:32 +01:00
Aidan MacDonald
dadfbfc6a5 apps: fix close of negative fd in talk.c
Bug reported by UBSan.

Change-Id: I02276521510acac8696499895fec15993c55aaf6
2022-05-02 16:34:18 +01:00
Aidan MacDonald
e5e457b526 apps: fix int/long mismatch in playlist.c
A couple of places use sizeof(int) for allocations and copying but
the indices are longs, which causes bugs in the simulator on 64-bit.

Change-Id: Ie101ac57d44217c4b1657cf0152c97e276bd7043
2022-05-02 16:10:15 +01:00
Aidan MacDonald
6b8c94a6e3 Fix some non-portable alignment values
UBSan reports an avalanche of unaligned pointer bugs stemming from
hardcoded 4-byte alignments used in certain places. Use sizeof(long)
instead to align to the machine word size.

Change-Id: I28e505212462c5268afa24e95df3a103ac3e2213
2022-05-02 15:38:48 +01:00
Aidan MacDonald
366f00a3d3 plugins: fix out of bounds read in chopper
GCC complains about this when compiling with UBSan.

Change-Id: I4bd8ff2b47882ab95620dc7750a9a80f823cc2ea
2022-05-02 15:38:48 +01:00
William Wilgus
ab71b9e334 tree.c update settings when new theme selected
Change-Id: I376aba4258dd3c54c45d97317aa1e7bc8f2a3a17
2022-04-28 18:56:13 -04:00
William Wilgus
f0d3a62d91 keyboard.c change math for editline above picker
Change-Id: I59e7f7face07f3f97fc6e016ee333cd3139ad5fd
2022-04-27 21:40:49 -04:00
Aidan MacDonald
9e93796407 buffering: remove bufgettail/bufcuttail
These operations can only be used in limited circumstances and have
exactly one user. bufgettail especially seems of dubious value; how
often do you need to read N bytes from the end of a file without
changing the file position?

strip_tags() was the only function using them, to strip off ID3v1
and APE tags off the end of buffered tracks. This would save only
32-192 bytes per track -- if the container format uses APE/ID3v1.
It hardly seems worth the effort.

Change-Id: I8fc3c1408517eda6126e75e76d76daea904b50eb
2022-04-20 16:51:49 -04:00
Dana Conrad
931d616071 Manual: Add Eros Q Native Bootloader download link
Forgot this in the previous patchset

Change-Id: I3f58e31e57e90cf3bc5f4b02a37ac4c99e8e52b4
2022-04-19 21:27:57 -05:00
William Wilgus
002575dbcf [BUGFIX] gui_synclist move global display settings to list struct
forgot to add the update function to the list_wraparound callback

Change-Id: I7ee7940f126726c727344d7d09371f1bf3295c81
2022-04-18 23:08:04 -04:00
Christian Soffke
1c3f6e063a fiiom3k Yes/No screen: Only accept Play button for YES
According to the on screen instructions, any other button
should mean No.

More importantly, in my experience at least, the Select
"button", since it is touch-activated, can sometimes be
pressed by accident, especially when a warning screen
is displayed as a result of pressing that same button.

Change-Id: Ieeadfa8018b5df99605297bc47948a181c22dab4
2022-04-18 22:28:13 -04:00
Dominik Riebeling
f8d54d0d1e rbutil: Bump to 1.5.1.
Change-Id: Idfc846ee1922271a709a097989c7a9a31e9d7279
2022-04-18 21:02:12 +02:00
Dominik Riebeling
3ed515872c rbutil: Fix progress dialog abort changed too early.
Don't change the abort button to Ok after a successful bootloader
install, this will be done by the following steps.

Change-Id: I4275de1f44bddf0580b10b36240a36a43daa68d0
2022-04-18 19:35:36 +02:00
Dominik Riebeling
80ac6893c0 rbutil: Update changelog.
Change-Id: I0d3ad4cba8cc5393d86cf2b96fc755ad6ec90b01
2022-04-18 19:35:36 +02:00
Dominik Riebeling
e4cb1615f4 rbutil: run lupdate on all translations.
Change-Id: I676cddf93724e07790cd393b697c127928f3949b
2022-04-18 19:35:36 +02:00
Dominik Riebeling
e2dc0a2c07 rbutil: Make zip install log less noisy.
No need to show a separate entry when a cached file has been used, do it
the same way as bootloader downloads do.

Change-Id: I42a21a37474a778975e82af0102e0152677a0343
2022-04-18 19:35:35 +02:00
Dominik Riebeling
1155851ffb rbutil: Make "Info" tab more responsive.
Loading the information can take a bit depending on the speed of the
disk. To make the application not appear as frozen update the UI more
often, and display a "Loading" text during data retrieval.

Change-Id: I012487d031ea71e62b583ca1c40220ea709e7034
2022-04-18 19:35:35 +02:00
Christian Soffke
e71a441762 ImageViewer: Fix buffer overflow
np_file is a buffer of size MAX_PATH. After
removing only the file name component and
leaving the rest of the path, the
available space may not be sufficient
for appending another file name (possibly of
size MAX_PATH itself) to it.

This can occur after a file of acceptable
length is opened in ImageViewer, and you
then advance to another file whose path
(including the file name) is longer than
MAX_PATH.

Change-Id: Ideadd9451359bd5735bce92fca5d983e61f300e9
2022-04-18 10:58:40 -04:00
Christian Soffke
1c66e97522 Database: Remove File View menu
These options don't seem to
apply to the database...

Change-Id: I777073eeaed4099acf44996b95fa05b4c2b3abc4
2022-04-18 10:48:41 -04:00
Aidan MacDonald
a234df30df Fix sim build for glibc >=2.34
Change-Id: If63787514b6bffc0afb71f9d651f8c6f0c328a2d
2022-04-18 09:54:07 -04:00
Christian Soffke
4d7327b04d Album Art: Eliminate redundant check
When the 'Album Art' setting was set to
'Prefer Image File' and neither image file
nor embedded artwork were found,
playback would check for files twice.

Change-Id: Ibe392928d58ec04103e2572124841724509bd859
2022-04-18 09:13:31 -04:00
Dana Conrad
b02123d349 Manual: Add Eros Q Native
Here is the PDF this patchset produces: https://www.dropbox.com/s/v1uz8p2fsgsz1ng/rockbox-erosqnative-923dabb5cd-220409.pdf?dl=0

Change-Id: I27554cb65a6498a6ccb714d4f93f25264b516e99
2022-04-18 09:09:03 -04:00
Bernd Busse
dc67d821c3 toolchain: update zlib to 1.2.12 for native mips targets
zlib has been updated to 1.2.12 on March 27, 2022 with the following note:

    Due to the bug fixes, any installations of 1.2.11 should be
    replaced with 1.2.12.

The previous version has been removed and is no longer available for
download on the official site.

Change-Id: I807fbb4605378d99654be3e4c1b28bd04de729c9
2022-04-18 09:07:39 -04:00
Dominik Riebeling
fc38cd8215 rbutil: Fix uninstall not updating install log.
Change-Id: Icd71f1a2de73d23c6580523de8c810b5a10a194b
2022-04-17 23:21:19 +02:00
Dominik Riebeling
37a60d5461 rbutil: Enable themes install depending on theme selection.
Don't store the "Install Themes" option. Automatically enable themes
installation if the themes selection has at least one entry selected
instead.

Change-Id: Ib46e8b53b0204555b79dea51545dd7c380f003ff
2022-04-17 23:21:19 +02:00
Dominik Riebeling
62108a9613 rbutil: Use references to avoid creating temporary objects.
Get rid of some unnecessary object creating / copying by using
references.

Change-Id: Ia44e34f6f66d230caa9af7ef7c0eca73be12de2a
2022-04-17 23:21:19 +02:00