Commit graph

35180 commits

Author SHA1 Message Date
William Wilgus
b2732222e9 Talk.c Guard against use after free / failure to load voicefile
load_voicefile_data wasn't checked for success leading
to a use after free situation

get_clip now checks for valid index_handle before using it

Change-Id: Id66dba6dbd6becfc9e0fe922fbc1d0adec1f0393
2021-03-05 02:22:20 +00:00
Solomon Peachy
56a1e87501 ata: Make ata_disk_is_active() only special-case powermgmt-less devices.
SSDs that respect powermgmt commands should be treated the same, as the
powermgmt commands are an important part of ensuring it's safe to shut
down.

And greatly expand the comment explaining things.

Change-Id: Ia52b99fca802f495422b5ee097390a72dbc28f61
2021-03-04 17:37:51 -05:00
Christian Soffke
be99033cbb Always indicate inactive ata disk if device is solid state or doesn't support power management
Commit 5462907 made sure that SLEEP commands weren't issued on devices that don't support ATA power management commands (e.g. certain CF->SD converters including several iFlash models).

Since Rockbox waits for the disk to become inactive in shutdown_hw(), which won't happen in this case, the OS would previously stall during the shutdown process until a timeout was reached.

Change-Id: I03bb05f6f6401bb8f0da5d0b76bd3f07681fdc06
2021-03-04 16:50:50 -05:00
Aidan MacDonald
fb99d890a8 Fix typo in MIPS cache discard
Change-Id: I6a06e5f3098324d985bd59322755cd68122ec0bf
2021-03-04 19:39:28 +00:00
Solomon Peachy
cbace906c6 mips: Revert to commiting the cache when we're told to discard an unaligned block.
The filesystem API often passes in unaligned receive buffers, and some
code (eg BMP reader) processes data in-place, leading to data loss when
we dropped the cache.

(And document exactly what we're doing, so we don't go through this again
 at $future_date)

Change-Id: If47a7f2148a5a1a43777f0bd3be1bdfe8239e91e
2021-03-04 12:00:15 -05:00
Solomon Peachy
bcee955169 rolo: use audio_hard_stop() instead of audio_stop()
This kills the audio thread entirely, including voice stuff.

Change-Id: Id6fd58a97d5a57285016351bbfd3e843b2f339f2
2021-03-04 09:49:38 -05:00
William Wilgus
a4a5f5f33f Check core max allocations for valid handle
fix rolo warnings

Change-Id: Ia2c669a5517aec54e5b2c0dc5934c88a4f49f2a9
2021-03-04 14:25:58 +00:00
Solomon Peachy
2628155fc9 Clean up places that use #if defined(CPU_ARM | CPU_COLDFIRE | CPU_MIPS)
Since that encompasses _all_ of our native targets in a post-archos world,
either replace it with #if (CONFIG_PLATFORM & PLATFORM_NATIVE) or
delete it altogher as appropriate.

Change-Id: I9128a456e850d5c96a9e05806aad3acd923f90c5
2021-03-04 14:14:33 +00:00
William Wilgus
15b4d22913 ROLO check for OOM
Splqash failure and return on OOM

Change-Id: I97b8783ba42545e30a5639e8a751d1e6834aebc8
2021-03-04 08:58:34 -05:00
William Wilgus
80be135d0d OOM on playlist_resume
Discovered on ClipZip but applicable to other LOW MEM targets

Back off voice buffer on playlist_resume

Change-Id: Ia316c4b7fc1bcb089d3069a13dd7c193edf2ba1e
2021-03-04 13:32:45 +00:00
Aidan MacDonald
de53965e3f Third try fixing MIPS cache code
Changing this to be a pure discard operation after discussion on IRC

Change-Id: I62955ae7975fdbbfd9eef376476042a36fe3d95a
2021-03-04 02:47:13 +00:00
Solomon Peachy
b82298ae2c jz4740: Fix incorrect dcache flush in the USB RX DMA code.
Change-Id: I01eff581b16569bda97c55afc7adac897b29e0e3
2021-03-03 21:44:28 -05:00
Aidan MacDonald
8cb4c18310 Really fix the MIPS cache bug this time
In fixing the original bug I tried to optimize discard_dcache_range()
to minimize writeback and inadvertently introduced a second bug, which
typically ends in a TLB refill panic.

It occurs only if the range fits within one cache line, and when both
the start and end of the range are not aligned to a cache line. This
causes ptr to be incremented and end to be decremented, so ptr > end,
and the loop can't terminate.

Change-Id: Ibaac072f1369268d3327d534ad08ef9dcee3db65
2021-03-03 23:57:08 +00:00
Christian Soffke
cde5ae755f iPods: Allow using scroll wheel to change volume on QuickScreen
As suggested by forum user yuuiko

Change-Id: Ifb989f9513a9e3c59e4ab0f38c0a8e2675c68dd8
2021-03-03 22:37:14 +00:00
Solomon Peachy
0f439bee99 ihifi: use STORAGE_WANTS_ALIGN rather than STORAGE_NEEDS_ALIGN
Change-Id: I39284194d19785e92ca641c85b03d31849b85ec9
2021-03-03 17:05:31 -05:00
Aidan MacDonald
74a3d1f5be Fix MIPS cache operations and enable HAVE_CPU_CACHE_ALIGN on MIPS
- The range-based cache operations on MIPS were broken and only worked
  properly when BOTH the address and size were multiples of the cache
  line size. If this was not the case, the last cache line of the range
  would not be touched!

  Fix is to align start/end pointers to cache lines before iterating.

- To my knowledge all MIPS processors have a cache, so I enabled
  HAVE_CPU_CACHE_ALIGN by default. This also allows mmu-mips.c to use
  the CACHEALIGN_UP/DOWN macros.

- Make jz4760/system-target.h define its cache line size properly.

Change-Id: I1fcd04a59791daa233b9699f04d5ac1cc6bacee7
2021-03-03 20:50:28 +00:00
William Wilgus
f906df017d Open Plugin -- Make first run show at least one item to user
Open plugin needs the context menu to allow the user to add an item
on the first run there are no items and therefore nothing to pop the
context menu from

Change-Id: I7a78454ff29b20c7b60db44349dd23d500ed887c
2021-03-03 13:37:40 -05:00
William Wilgus
5317953f4a Battery Icon, Remove Hardcoded Overall Width
Icon no longer showed 100% with some fonts

Change-Id: I6bb9d47007fa42f91daa5c336f5e9e960140db0f
2021-03-03 03:11:02 +00:00
William Wilgus
2cde135cfe flac fix dumb typo
Change-Id: Ic6269ca35374bcb1d6a5ad2c1848a1718fa4e01c
2021-03-03 02:58:34 +00:00
Solomon Peachy
93d8be80ce Remove a couple more stragglers from the Archos purge
Change-Id: I57cbc3360775b90df53f334174d9c9b3e44dfbe1
2021-03-03 02:36:52 +00:00
William Wilgus
118191479d Nudge flac towards upstream FS#13266 -- Fix the Yellow still?
Change-Id: I76056b1a682db055857d759d2ebffae111a8a4c0
2021-03-02 19:47:07 -05:00
William Wilgus
2252bde144 Nudge flac towards upstream FS#13266 -- Fix Yellow
unused variables

Change-Id: I69e1435941da6207c75d0f3cb862dee296a5cc1a
2021-03-02 19:20:39 -05:00
William Wilgus
a017219488 Nudge flac towards upstream FS#13266
Some flac encoded files contain junk that our decoder
picked up

upstream has some sign and overflow fixes too

Change-Id: I5857b2fe56906a48f04944cdfee8fe2306f2c3fd
2021-03-02 23:48:05 +00:00
Christian Soffke
7d78958f9d Reset unknown file color when resetting filetype colors
The unknown file color is handled as a special case and also needs to be reset here

Change-Id: I0446b7f6586c265dee37fef303f8564f22f06dd4
2021-03-02 18:33:19 +00:00
spencer-brennessel
22cc4e4fcf Fixed bug in Fiio M3K port where up button didnt work in some menus
Change-Id: Ie90230cb841837b10e839e0fb2e80b5fc4401c42
2021-03-02 12:51:47 +00:00
William Wilgus
a6eafc86f8 Remove execute bit from file permissions from recent commit
Change-Id: I415cf235d2b179ae8c58b0427308103be3e00130
2021-03-02 02:10:53 +00:00
Aidan MacDonald
73cee8f177 Add RegGen-NG tool and definitions for Ingenic X1000
Change-Id: Ib9ec35c068e1cff8dcf120a13cfe3f5f58908a95
2021-03-02 00:36:01 +00:00
Solomon Peachy
7418ec5009 FS#13267: Fix crash when enabling Perceptual Bass Enhancment during playback
I think the assumption is that during playback, the DSP is already running
so it assumes PBE needs to be flushed before it is properly enabled.

Change-Id: I2bac3d02c80f97c8d9ce26a575175f6344a8e86a
2021-03-01 19:02:22 +00:00
Christian Soffke
640b14c08c Fix inability to reset filetype colors without restarting
0ce42df prevented read_color_theme_file() from being
executed when applying settings (from a cfg file)
if the filetype colors setting was set to "-". Resetting
custom filetype colors happens in that function though and
thus wouldn't work. You had to restart Rockbox for the
setting to be applied (at which point read_color_theme_file()
is called from filetype_init() which is called by the init()
function in main.c)

The safety check has been moved from settings.c directly into
read_color_theme_file(). This has the added
advantage that it will also apply during the init process
where there existed no check before (prevents the problem
mentioned in 2e3a8c7).

Change-Id: I547fe180f0bac79889bf2c44778bb1cc4f9d4307
2021-03-01 13:33:43 +01:00
Solomon Peachy
670812a44a Support MP3 audiostreams embedded in ASF containers.
Full credit to Igor Poretsky

Change-Id: I54769e33665cada1e1e0ef3a5511b56c8e1b859a
2021-02-28 16:11:54 +00:00
Aidan MacDonald
13c7f482ce Add ingenic_tools/usbboot utility
This is essentially an expanded version of jz4760_tools/usbboot,
able to support both X1000 and JZ4760 CPUs and easily extended to
handle other Ingenic CPUs using the same boot protocol.

Change-Id: I70ce3acc3531d65390c6bbae4d2b3352140acf0a
2021-02-28 02:52:56 +00:00
Aidan MacDonald
a3d41098c7 Adding myself to the credits
Change-Id: I1c37e6c7967b7ec679682d319822115653064ed2
2021-02-27 23:53:46 +00:00
Aidan MacDonald
aacb0811d9 Rename symbols of FiiO M3K Linux-based port
Mainly a straight replacement of FIIO_M3K -> FIIO_M3K_LINUX.

Change-Id: Id07c84f8150991d1b6851540c2c3f8f67e3f12c2
2021-02-27 23:53:28 +00:00
Solomon Peachy
55dc86f5db Specify correct dependencies for tools/descramble
Fixes the red introduced in 6224efb2

Change-Id: I21e61fdb8e1b87486417faf34bfa6963e5ab2349
2021-02-27 18:39:04 -05:00
Solomon Peachy
dad23a0607 database: Database tool was excluding all SWCODECs!
When fixing this, I used this this opportunity to clean up the Makefile

Change-Id: I5dea77a8a2048bbfce5930f8ce2899b597e425eb
2021-02-27 18:29:02 -05:00
Christian Soffke
ef685cc6da Update manual to reflect new behavior from abebc6b
When playback is stopped and the user inserts songs, Rockbox will not erase a dynamic playlist anymore, unless it has finished playing.

Change-Id: I50bd62fbfe3929a0b651b5136e9305b9bc9278f3
2021-02-27 22:53:12 +00:00
Aidan MacDonald
6224efb238 Fix build system not respecting TOOLSET
It seems that 'toolset=' in tools/configure was set but not used, with
the build system only generating a hardcoded set of tools. This change
fixes the issue by exporting the required tools in the TOOLSET variable,
and having root.make append those to the TOOLS list.

Change-Id: I07024bdf1dd2260c32cfeecaba0d3bb5bf00346d
2021-02-27 22:51:52 +00:00
Aidan MacDonald
96019d23aa Add regtools binaries to gitignore
Change-Id: I5d65e6680329311916a3d890c81f3c39e9b655c4
2021-02-27 22:03:13 +00:00
Aidan MacDonald
b8945734f5 Make headergen_v2's output include what it uses
Change-Id: Ie9790faac44c33a170bc2dc39d706575cefa0f2f
2021-02-27 22:02:31 +00:00
Christian Soffke
7d7a3156d3 Fix skin rendering issue entering dirbrowse
If the custom UI viewport (for displaying lists) changes size when entering dirbrowse, other viewports won't be correctly rendered and require a redraw.

The following is a minimal test case for an example SBS where (the specified background color for) the viewport at the top of the screen won't appear after the user has entered the (root menu of the) file or database browser:

%?if(%cs,=,1)<%VI(main)|%VI(other)>

%V(0,0,-,21,-)
%Vb(ededed)

%Vi(main,0,22,-,-,-)

%Vi(other,0,60,-,-,-)

Change-Id: I1aeed0561f16531802d0fb8dc5fd18d65ac8f25a
2021-02-27 14:41:54 +00:00
Christian Soffke
7d7850368e Disable UDMA 2 on iPod4G target
ATA DMA was enabled for all PP502x targets in d118f47 after previously reported instabilities were thought to have been fixed. The iPod 4G target remains unstable when UDMA 2 is enabled. File system corruption will eventually occur even using stock hardware in normal usage, according to both my own experience and that of several other forum users. UDMA 1 appears to be stable.

Change-Id: I8526bad9e879f5dad5174cfe07cd8828d8b72406
2021-02-27 14:38:49 +00:00
Christian Soffke
317908e8c3 Warn before permanently reshuffling the current playlist
Reshuffling a playlist using the WPS context menu for the current playlist is a destructive operation since the previous order of items can't be restored. A warning should be displayed, so that the user can still cancel the operation in case they intended to select another menu item (e.g. one of the harmless "Playing Time" or "Save Current Playlist" items right next to it).

Change-Id: Ib9fc379439d155be907872d77cf54d5035bd08a0
2021-02-27 14:38:29 +00:00
Christian Soffke
05f1006246 Convttf makefile: Replace freetype-config with pkg-config
Freetype-config has been deprecated and is no longer included in libfreetype-dev. Pkg-config serves as its replacement.

Convttf isn't built as part of Rockbox by default, but manually doing so will currently fail even when libfreetype-dev is installed.

Change-Id: Iafc31df3b40c11d7c790189eb9d3788ba97d3e54
2021-02-21 05:23:39 +01:00
Solomon Peachy
bdc3dd4fca MP4: append mdat sections together in metadata parser
mp4 files can have multiple 'mdat' chunks.  This is common for
audiobooks, where there is often a secondary mdat containing the
chapter names, but it's also legal to have multiple mdat chunks
for a single logical "track"

This confuses the mp4 metadata parser, which assumes there is
only a single mdat, and always uses the last mdat seen to
determine the "filesize" of the data we're trying to decode.

Work around this by appending each mdat's size to result in the final
"filesize"

Change-Id: I3e7a7efb0f05ef965e8d77f79e450c957524a480
2021-02-19 13:35:41 +00:00
Solomon Peachy
8c76c1b1c2 Revert "Always resume audio after user picks a new song from a playlist"
This reverts commit 69746d8400.

Change-Id: I33969c228a88cdba3537844a1962cac85cfa80e5
2021-02-19 13:35:15 +00:00
Christian Soffke
436e64e09e Fix playback queue bug when "Insert Next" is used with multiple songs at once
After using “Insert Next” to insert multiple songs at once (e.g. an album from the database browser or folder from the file browser), subsequent Insert operations will incorrectly insert items after the first song of all items that were previously inserted, instead of after the last song of the previously inserted items.

A bug fix was originally written by Costas Calamvokis for the file browser only. I adopted the original fix and added code analogous to it so that it works from the database browser as well.

See FS#7898, FS#7363 or this forum post for more info:
https://forums.rockbox.org/index.php/topic,53741.0.html

Change-Id: Ie2718e136df0b340000f7a171e9e806cf23a27b4
2021-02-17 11:34:59 +00:00
Christian Soffke
abebc6b9ac Don’t erase a user’s stopped dynamic playlist when inserting/queuing songs
Rockbox would unexpectedly and without warning erase the current dynamic playlist (when it hadn’t finished playing) if the user inserted or queued up items while playback was stopped.

This fix ensures that the playlist is only deleted if it has either finished playing or can't be resumed.

Change-Id: I73b7bd56e6399f9be4bb000bae39c8b6a5e1b79b
2021-02-17 11:33:25 +00:00
Christian Soffke
69746d8400 Always resume audio after user picks a new song from a playlist
Music currently doesn't begin playing after the user has selected a new song in a playlist, unless another item was already playing or the previous player state was "stopped" (but not "paused"). This results in an inconsistent user experience. The user's likely intention is to immediately listen to the song they select for playback regardless of the previous player state.

Change-Id: I68a8da01b06a81d8c3b61e351710431152bfdfaa
2021-02-17 11:32:32 +00:00
Wolfram Sang
422aa56243 rockboxdev: fix issues with relative paths for commandline options
I wanted to build into a 'toolchain' directory like this:

$ tools/rockboxdev.sh --dlwhere=toolchain --builddir=toolchain/build --prefix=toolchain/bin

This failed twice:

a) the extraction stage could not uncompress because of the relative
paths, so convert them to absolute paths in the script to fix the issue.

b) patches could not be applied because 'rockboxdevdir' was assigned a
string with the directory twice and '\n' in the middle. Using readlink,
this now works.

Change-Id: I9c7c30812e1fb4b58db7e6561d73678f34714c91
2021-02-05 17:29:05 +00:00
Wolfram Sang
a67c6934c1 rockboxdev: better error message for unknown compression
I hit this error and its message confused me because I interpreted it as
"bzip2 executable could not be found". The message was also outdated
because xz is supported meanwhile. Update the message to something
hopefully more helpful.

Change-Id: Ide2f8809dc0f8159d7d04fa22c29607dd6b35792
2021-02-05 17:29:05 +00:00