Commit graph

36739 commits

Author SHA1 Message Date
Christian Soffke
31d56d4a59 Database: Disable delete hotkey unless audio file is selected
Fixes behavior where Rockbox would offer to
delete nonexistent directories.

Change-Id: I219da382b181372023b9408ac9a85189bffdcb74
2023-04-05 07:16:18 -04:00
Dana Conrad
b31127db7d [bugfix] x1000: Wait for FIFO to be empty rather than flushing
When data is not in packed-16-bit mode, flushing the fifo
may result in swapping left and right channels if there
happens to be an odd number of entries in the FIFO.
This is especially likely when switching sample frequencies
for some reason.

When stopping PCM DMA, disable DMA and Underrun Interrupts
and then wait for FIFO to be empty before stopping AIC's playback.

Change-Id: I45b6b022c9e3889627842663cd9b7d2e0affb7c6
2023-04-02 11:34:39 -04:00
Christian Soffke
287747591e plugins: vbrfix: Fix fd leak & error handling
- mp3info returns true for error
- fd wasn't closed for non-vbr files

Change-Id: I5432025d3384ddf92ed0a478587dcc1715fcf524
2023-04-01 08:19:22 -04:00
William Wilgus
2456d28e21 [BugFix] open_plugin didn't recognize opx shortcuts
opx shortcuts allow an easy way to add parameters to plugins
you should be able to set them as shortcuts now

the plugin hd a use after free bug on the dat file file descriptor

Change-Id: I5fe3b0628e7da003c03b9b54f5788b0d0dbfea74
2023-03-30 01:04:51 -04:00
William Wilgus
a2e5d9563f [Feature] resume TSR plugins after interruption WIP
save tsr plugin path for later

resume tsr plugin when user stops the interrupting plugin

expand return of tsr_exit function to allow
continue, suspend, terminate

tsr plugins check parameter at start to determine if
the plugin is being resumed

Change-Id: I6fc70de664c7771e7dbc9a1af7a831e7b50b1d15
2023-03-25 10:02:43 -04:00
Aidan MacDonald
2e99e2175b playlist: Remove control file cache
Control cache entries cost 24 bytes per command, but cacheable
commands are always less than that when written out to the file.
We can actually cache *more* data by writing commands directly
to the fd (native Rockbox has a 512-byte cache per fd) and it's
much simpler.

Change-Id: Ibb1b9ffa56ef17431b281419a04082e14d0cbd85
2023-03-24 19:02:56 +00:00
Aidan MacDonald
a4cfa8ae6a playlist: Unconditionally strip bogus dirs in playlist_peek()
The intent behind the check is to only do this if the filename
comes from an on-disk file. With the RAM buffer is gone this is
now "always" the case.

Change-Id: I4c26e32c482dde176b69a6071e9562e9955d7171
2023-03-24 19:02:56 +00:00
Aidan MacDonald
aab6a44fc5 filetree: Remove dead code in ft_build_playlist()
This checks for an out of memory condition when the filenames
were buffered in RAM. The playlist no longer buffers anything
in RAM so the code is unreachable.

Change-Id: I4c2d0b2ac4ba3b7e7c94fe554a0cf7cb1a798e09
2023-03-24 19:02:56 +00:00
Aidan MacDonald
1f1893f520 playlist: Remove in-ram filename storage
Use the playlist control file for directory playback instead of
storing filenames in RAM. The implementation of that feature is
very iffy and probably responsible for random crashes that may
occur when skipping through directories rapidly.

Change-Id: I3863940cd4542410d8046a3ca47508b5d97309a1
2023-03-24 11:10:12 +00:00
Aidan MacDonald
ac1cbd5dd0 playlist: Clean up close_playlist_control_file()
Move locking outside the function since most callers already
hold the lock.

Change-Id: I4b6774e2322c86962b4cc7a5f33d13cd4ffb1c7b
2023-03-24 11:10:12 +00:00
Aidan MacDonald
e6534b051e playlist: Add helpers for opening/closing .m3u playlist
This helps maintainability and ensures the opening is done
consistently.

Change-Id: I7805716182dfa93f917d54d40f8e420e87da16b0
2023-03-24 06:36:23 -04:00
Aidan MacDonald
5eb24a9582 playlist: Cleanup get_next_dir()
Pass the direction as a signed integer to avoid jumping through
unnecessary hoops.

Change-Id: I1a36c3804b5f7103464f0d2ee69d060505261274
2023-03-24 06:12:01 -04:00
Aidan MacDonald
58b2e45782 Fix unified syntax in ARM inline assembly
GCC 4.9 always emits assembly with divided syntax. Setting unified
syntax in inline assembly causes the assembler to complain about
GCC's generated code, because the directive extends past the scope
of the inline asm. Fix this by setting divided mode at the end of
the inline assembly block.

The assembler directives are hidden behind macros because later
versions of GCC won't need this workaround: they can be told to
use the unified syntax with -masm-syntax-unified.

Change-Id: Ic09e729e5bbb6fd44d08dac348daf6f55c75d7d8
2023-03-23 18:16:33 +00:00
Chris Chua
86429dbf1e Using ARM Unified Assembler Language
Change-Id: Iae32a8ba8eff6087330e458fafc912a12fee4509
2023-03-23 13:28:22 -04:00
Aidan MacDonald
a64cad847e playlist: Simplify playlist modified detection
Any modifications to the playlist (insert, delete, shuffle, etc)
will cause the modified flag to be set. The flag is cleared when
the playlist is saved. Code that generates playlists can manually
clear the modified flag if appropriate; there is now a proper API
for this so the tagcache and pictureflow don't need to resort to
hacks.

Change-Id: I8d3c723265a41db07a13de3f1d2abb0444528d57
2023-03-23 13:01:23 -04:00
Aidan MacDonald
d40a598970 plugins: Simplify plugin/codec API versioning
Replace the minimum version bound with a check on the size of
the API struct. The version only needs to be incremented for
ABI breaking changes. Additions to the API won't need to touch
the version number, resulting in fewer merge conflicts.

Change-Id: I916a04a7bf5890dcf5d615ce30087643165f8e1f
2023-03-21 16:23:54 -04:00
Aidan MacDonald
2fb2364686 makefiles: Fix escaping issues under GNU make 4.2
Make 4.3 and newer doesn't interpret comments in a shell call,
whereas Make 4.2 and older do. Escaping the comment directly
works on old makes, but on new makes the backslash is passed
as well -- which we want to avoid.

The safe way to pass a literal "#" character to the shell on
both versions is by embedding it in a variable and expanding
that. It's ugly, but it works...

Change-Id: I1a217c42d747fd5aa83f9990c234e06966ac1a00
2023-03-21 09:31:18 +00:00
Aidan MacDonald
ed7ab52e27 makefiles: Suppress stray backslash warnings with grep 3.8
GNU grep 3.8 warns about "\#" when compiling. The "#" has to be
escaped for Makefiles and shell, but it isn't special to grep so
grep thinks it's an invalid escape sequence.

Change-Id: Ieb2607d42b7daa1939ca0101b915ec0c7afd4298
2023-03-21 04:48:31 -04:00
William Wilgus
977bc698db [Feature] lastfm_scrobbler add option to set beep volume level
Change-Id: Id045f0f844b67f07ba5cd47d084f5d8f1841dad8
2023-03-20 19:04:12 -04:00
Aidan MacDonald
a0a59ab610 Fix locked context fallthrough
Enabling locked actions for all softlock targets accidentally
broke keylock on touchscreens because the generic touchscreen
keymap was missed. Trying to lookup CONTEXT_WPS|CONTEXT_LOCKED
returned the mapping for CONTEXT_STD because the locked version
wasn't explicitly handled.

But on almost all cases, a context's keymap does not change when
the screen is locked. It makes more sense to mask out the locked
flag and only check for it where needed.

Change-Id: I65cda2de82950d272d4394fd772286699e7c3779
2023-03-18 17:47:19 +00:00
William Wilgus
0c29d1788e [Bugfix] open_plugin_browse() not showing plugins
rockbox_browse() overrides the desired dirfilter with
global_settings.dirfilter if you aren't using one of the
SHOW_ modes > NUM_FILTER_MODES (which come with their own sideeffects)

add flag BROWSE_DIRFILTER to
override global_settings.dirfilter with browse_context.dirfilter

add ability to set tc->browse to NULL to exit dirbrowse immediately

Change-Id: I2f40d394f9dc0864b2041293eda219f7436a7bf0
2023-03-18 04:23:43 -04:00
William Wilgus
b6d04d1ac0 [BugFix] chunk_alloc pass NULL to buflib_shrink
old_chunk has already been unpinned therefore the address
could be incorrect
NULL will ensure buflib_shrink uses the same start address

Change-Id: I9371e4f8263c6e5bf769108a8558dc938d4c8b87
2023-03-09 20:15:38 -05:00
Solomon Peachy
4faffe0a9c Update english-us "translation"
Change-Id: Ief43b8b7c852af5fca0225b26a94801fdf6ab2e1
2023-03-03 09:36:16 -05:00
Solomon Peachy
f6db0c60e0 FS13390: Update Polish Translation (Adam Rak)
Change-Id: I7dc58071b37cf149a620d462dd73a28d482d6f0d
2023-03-03 09:35:49 -05:00
William Wilgus
fcf24ae387 [BUGFIX] chunk_alloc pinned buffer
if there weren't previous chunks new buffer was pinned
without being unpinned

Change-Id: Ia45bc0eb67673e8df5154447d9116fcd4c147f6b
2023-02-16 15:43:59 -05:00
William Wilgus
a749a95840 font.c cleanup
find_font_index can use font_filename_matches_loaded_id()

font_path_to_glyph_path doesn't need strcat

Change-Id: I8d1d36a68abbc700078d651eed930035641b6240
2023-02-15 23:02:36 -05:00
Wolfram Sang
e7a01ca4b2 usb screen: honor HAVE_LCD_SPLIT
Clip+ displays the logo with the LCD split inbetween. Calculate the y
offset to be directly after the split if possible. Thanks go to William
Wilgus for fixing a similar issue and pointing me to macros I was
looking for.

Change-Id: I2183aec1149ce74ffb840716910d2051e4a284ed
2023-02-15 22:43:33 -05:00
William Wilgus
ff98a54cd9 font.c return false if id is out of range instead of NULL
forgot to change this to match the bool return

Change-Id: I2cc6dc985b07f2bc0ae493b060aff6105f329097
2023-02-15 01:27:50 -05:00
William Wilgus
91c8633e8c [BugFix] font.c filename was movable
stupid bug on my part font_filename was pointing to a movable
alloc therefore that data could be moved out from under the returned pointer

instead pin the internal calls to core_get_data and
remove font_filename in favor of a function that checks if a
filename matches the loaded font as this was all it was used for anyway

Change-Id: Iebb47ffe3f81aa9d5e3968975f26d64283633ffc
2023-02-15 01:15:59 -05:00
William Wilgus
3bb75e0039 tagtree.c optimize get_tag()
store tag length to shortcut strcmp

this is nearly as fast as making a hash table using gperf

its not the hottest path but its
even slightly faster to shortcut
based on string length

    if (tagstr_len > match->len)
        continue;
    else if (tagstr_len < match->len)
        break;

but I found no measurable difference
I don't think its worth the extra constraint of keeping tags sorted

Change-Id: I4bb47cc6c5b8266d5f13c4ac78ae11d55ecb2d67
2023-02-09 06:56:58 -05:00
Solomon Peachy
23cb6139bd SID: Disable SID on 2MB targets, as cRSID needs a lot of RAM.
Also add a note that SID might not play in realtime on all targets

Change-Id: Ic14b20a7c1427e31e38204ae3ecff6bd235ec1b4
2023-02-07 11:25:02 -05:00
Wolfram Sang
88f4f1c8d0 metadata: sid: allow RSIDs as well
cRSID also allows to play RSIDs (hence the name of the library). So,
allow them as well.

Change-Id: Iae8f0ac083ed714771767a4c23f5a09bad637208
2023-02-07 09:19:32 -05:00
Wolfram Sang
70ce734ece codec: sid: use cRSID as a library for playing SID files
Change-Id: Iee70933e47ff8df8f26c9a63112de4da4a8e6c17
2023-02-07 09:19:32 -05:00
Wolfram Sang
15c0f0576e codec: sid: split cRSID header into a public and a private header
Needed to compile cRSID as a proper library.

Change-Id: I276967f46037bd65db1ff38985a781183fc26a00
2023-02-07 09:19:32 -05:00
Wolfram Sang
e8135fea5a codec: sid: add cRSID-1.0 for 21st century SID playback
Plain import of the library parts first. Adaptions to Rockbox will
follow. A *lot* of kudos go to Mihaly Horvath for creating this library
from his already lightweight cSID-light, mainly for Rockbox. Besides a
lot of other things, he made his algorithms integer-only and
significantly improved the C64 emulation, so finally RSIDs could be
played as well as PSIDs. TinySID was nice for what it is, but this is a
quantum leap in SID playback quality for Rockbox. Check for example:

https://hvsc.csdb.dk/MUSICIANS/P/Page_Jason/Eighth.sid
https://hvsc.csdb.dk/MUSICIANS/J/Jeff/Blowing.sid

Change-Id: I353e12fbfd7cd8696b834616e55743e7b844a73e
2023-02-07 09:19:32 -05:00
William Wilgus
1c26f565bf tagnavi make track submenu
add some faster options to the track menu
add a shortcut for basename formatting
sort basename results

filename - by sorted filename
title - just title no formatting untagged items are unsorted as well
title mm:ss - title and duration

Change-Id: I90aea95051f6231580ef7f1fc08cd2d0d69601fb
2023-02-07 08:44:57 -05:00
William Wilgus
b5d93a6605 Revert "tagtree remove unneeded strlen"
This reverts commit 8379c6eb07.

Reason for revert:
tcs.result_len is not the same as strlen(dptr->name) + 1
since it gets filled with filename

Change-Id: I1264afc0a43ffe75adf1de00d27ab98e3adbca19
2023-02-05 06:47:38 -05:00
William Wilgus
d5a84d42b0 [BugFix] tagcache.c fix off by one error in find_entry_disk()
the tagcache counts the null terminator strlen however, does not
no matching entries makes for a terrible amount of disk searching
and a hang on devices without dircache to save them

Change-Id: Id3460037199ee9853de0f11e4763a7ff11130e45
2023-02-04 11:39:43 -05:00
William Wilgus
c955d93075 font.c dynamic path name
only alloc enough space for the path  instead of a fixed buffer

round up the path buffer size to slightly more thna the longest
common path length to reduce reallocations

Change-Id: I51b8b17584d6a905ea3a66a7c38b7b1b9da2e786
2023-01-30 23:36:34 -05:00
Aidan MacDonald
78718aa7eb playlist: Annotate locks as read/write
Distinguish read locks from write locks to aid converting the
mutex to an MRSW lock at some point in the future. Everything
is a write lock for now and a mutex is still used, so there's
no change in behavior.

Change-Id: I25aeed580580bdb0c3048fc7e1eaad1c32c30159
2023-01-29 08:24:48 -05:00
Aidan MacDonald
25bd3bc971 playlist: Optimize playlist_remove_all_tracks()
This was insanely slow for large playlists. Implement it as a
constant-time operation to avoid the O(N!) blowup, and add a
new "clear" command to the control file to avoid flooding it
with individual delete commands.

Change-Id: Ied82d1cba015591edd583f2a2ff6772108f4e176
2023-01-29 07:55:10 -05:00
Aidan MacDonald
2c4546ba99 playlist: Remove unused PLAYLIST_DELETE_CURRENT
Change-Id: I4d1a8798aca249d343ca27a9973213d427b73963
2023-01-29 07:32:26 -05:00
Aidan MacDonald
d85f4b5e1c pdbox: Move core thread off COP
This is all but guaranteed to be broken since pdbox doesn't use
SHAREDBSS_ATTR or SHAREDDATA_ATTR, needed to share memory safely
with COP threads.

Judging by the codec performance comparison on the wiki, if the
iRiver H100 and H300 can run PDbox on one core, PP targets should
have no problem doing it - they are 2-4x faster even on codecs
that don't have multi-core optimizations.

Change-Id: I8f556013146cb670f69cc42e80b1c768ba0f74cd
2023-01-29 07:15:40 -05:00
William Wilgus
4e5fcbe898 fix red #2 d6fb80d4
Change-Id: I147e9b8f7c8e64234f55d39f9ac7c7253b065f9a
2023-01-27 01:12:42 -05:00
William Wilgus
1d6ce5193f fix red d6fb80d4
Change-Id: I805490f660626f48220b41de3ee1026c260d0067
2023-01-27 00:40:20 -05:00
William Wilgus
00e5c81ecb debug_menu database delay redraw
only redraw every 100 entries

Change-Id: Ie0bb54812c1b8341aa4d8303341904d17baa2890
2023-01-27 00:10:47 -05:00
William Wilgus
d6fb80d4ff Tagcache - Ramcache Move ref checks, speed up disk searches
move loading file reference to a separate function

some optimization of the disk search function check tag length before
reading the actual entry & reduce number of lseek calls
this affects startup resume as well before tagcache is done loading

Change-Id: I2bd2fc53c4870416ecd1a4034b34cb6984d8ad51
2023-01-27 00:03:51 -05:00
Aidan MacDonald
1025283042 usb: Fix iPod video connection issues
Apparently a response is coming out of nowhere and tripping this
check. I can't be bothered to look into it; it would be better to
just update the ARC USB driver to the new control request API...

Change-Id: Ic5062443e060534f170d3afe17c00d3c25d1d3bd
2023-01-23 16:04:16 +00:00
Aidan MacDonald
c0c1a6e5f0 Fix yellow 65b3ff81c5
Change-Id: Ibf99e4e6f98021b35d420520219287336bf25f0e
2023-01-23 14:46:02 +00:00
Aidan MacDonald
65b3ff81c5 playlist: Fix dircache scan thread deadlocks
Fix deadlocks in the dircache scan thread caused by incorrect
lock ordering. Mutating operations need to stop the thread to
prevent it from accessing invalid data; this must always be
done before taking the playlist lock to avoid deadlocking the
scan thread.

Change-Id: If719a8b28ed0b0b3eac068073581e606c4a5f58a
2023-01-23 12:24:12 +00:00