1
0
Fork 0
forked from len0rd/rockbox
Commit graph

3477 commits

Author SHA1 Message Date
Solomon Peachy
60c3fdbc11 More red fixes:
* hostfs_removeable()/present() needed IF_MDVOID() in their prototypes
 * SIM_EXT_INSERTED/EXTRACTED are gated by HAVE_HOTSWAP

Change-Id: Id8c688f3538db99586a4f5062c83466374451883
2024-07-07 15:40:27 -04:00
Solomon Peachy
5a2bd580cd Hopefully fix the last of the stragglers.
* xDuoo X3 fix some warnings due to an incorrect #ifdef
 * stub storage_removeable() and storage_present() for non-HOTSWAP builds
 * sim_trigger_external() is gated by HOTSWAP, not MULTIDRIVE

Change-Id: I38f14fdfeba13957899c378051d49afc2e8245e5
2024-07-07 15:13:53 -04:00
Solomon Peachy
1528b44349 More red fixes
Change-Id: If22cdb286edac47b08b158bee6910ba7a539b041
2024-07-07 14:47:07 -04:00
Solomon Peachy
dc364e44ef Disable HAVE_MULTIVOLUME for bootloaders
Multivolume support is only necessary if mounting multiple volumes
simultaneously, which the bootloader won't do.

Change-Id: I725061dd2aa47abe7652b0d27258dd3af821c913
2024-07-07 12:43:10 -04:00
Solomon Peachy
f37b5a8349 Fix the remaining red in red from ea80d1cc9ca
Notably:

  * double-paste in ihifi760 config.h
  * jz4740 ATA & SD drivers used MULTIVOLUME instead of MULTIDRIVE
  * Simulators implicitly rely on HAVE_HOTSWAP

Change-Id: I44fc7f98f0f6df366f016567c330f87e9f3ca6a6
2024-07-07 12:29:19 -04:00
Solomon Peachy
181fe7530a Fix most of the (extensive) red in ea80d1cc9ca
Change-Id: Ie494df80caa222423a52977031920d54bd058c3c
2024-07-07 12:05:18 -04:00
Solomon Peachy
ea80d1cc9c config: Change default HAVE_MULTIVOLUME settings
* HAVE_MULTIDRIVE implies HAVE_MULTIVOLUME as the latter is always
   removeable storage
 * SD storage implies MULTIVOLUME
 * ATA storage (with HAVE_LBA48) implies MULTIVOLUME
 * Replace HAVE_MULTIDRIVE && NUM_DRIVES == 1 with HAVE_MULTIVOLUME

Since SD and ATA can exceed 2TB, we need multiple volumes to fully
utilize available storage with FAT32.

In practice I believe this only affects the ipod devices.

Change-Id: Ia597770948b0e2b47630f7264ad34f225a33a640
2024-07-07 11:35:04 -04:00
Solomon Peachy
e2fb4ecd5c xduoox3: Completely strip USB support out of the bootloader.
Change-Id: I7167e051a56a3be3c285c209b1c8fca7de251b09
2024-07-03 16:51:58 -04:00
Szymon Dziok
f7a3b4dfa3 Radio support and detection for Samsung YH92X [FOR TESTING].
Status:

- tested on:

  Samsung YH920 - it uses this detection too, it always should have
                the radio.
  Samsung YH925 with the radio.

- untested on:

  Samsung YH925 without the radio.

Change-Id: I68b39c09d6b7e26a4c373fbd8bf9401a97e86123
2024-06-23 20:11:59 -04:00
William Wilgus
7b12cc3927 pathfuncs.c remove strip_leading_separators()
This should actually be strip_extra_leading_separators() but
its not used anywhere else yet and I don't see enough callers
in core to make it worth the extra overhead

Change-Id: Icdd292869b4198bed7725c51820f6b2111ad739d
2024-06-16 12:33:16 -04:00
Solomon Peachy
8b8c0c7c2a checkwps: Validate translated strings (%Sx)
In verbose mode it will log valid the strings found, otherwise it will
only complain when we encounter a missing string.

Unfortunately a missing string is not inherently a problem, due to
conditional expressions.  So all we can do is complain in checkwps
or if wps debugging is turned on.

Meanwhile, this is the first step in actually enumerating the translated
strings used by themes.

Change-Id: Ia93b333085e825d5b085c4d372ad8e13aa3e3ba1
2024-05-24 21:37:54 -04:00
Solomon Peachy
8c86fb6da0 arm: Use -masm-syntax-unified when compiling with gcc8 or newer
Annoyingly, this makes all of the '.S' files we compile get treated as
divided syntax, so we need to make the syntax in them explicit.

Change-Id: I56a3916b7b24c84a1214a5d6bc4ed4d651f002cf
2024-05-08 21:45:42 -04:00
Solomon Peachy
886060475e ata: Heavily rework sleep and poweroff logic
* Use of ata_disk_can_poweroff() was inverted, resulting in SATA SSDs
   getting powered off but leaving _everything_ else on, including spinning
   rust!
 * Replace the can_poweroff() heuristic with a test for the mandatory
   ATA power mgmt feature flag. Notably, the CF->SD adapters don't claim
   to support this!
 * Eliminate duplicated tests in sleep code
 * Wrap all poweroff-related code with HAVE_ATA_POWER_OFF
 * Don't ever use SLEEP command, only STANDBY_IMMEDIATE
 * Gate call to STANDBY_IMMEDIATE behind a can_poweroff() test
 * Prefer FLUSH_CACHE_EXT to FLUSH_CACHE where available.
 * Improve SSD detection heuristics to any of these:
   * Explicltly identifies as SSD (covers newer CF and SATA)
   * TRIM support
   * CFA compliant AND (CF level 0 OR high speed support)
 * Report SSD detection in debug menu

Change-Id: I7fcb83b6d6eabddc11c64326a573b08ab85412b5
2024-04-22 15:46:30 -04:00
Roman Artiukhin
f5a852304b Sansa e200v2: bootloader: enable SD boot
Use rockbox_main.e200v2 for boot redirect

Max allowed size: 120860
Thumb build: 119579

Change-Id: I4683b1bdd247d41eaf4393b999db4ef5cd7a4010
2024-04-01 11:44:22 -04:00
Aidan MacDonald
cc210a7161 Fix red in c36d7768c5
Change-Id: Iadcfd322b32cf8523579c9e21a59928a621f15e1
2024-04-01 16:30:41 +01:00
Roman Artiukhin
c36d7768c5 Sansa e200v2: bootloader: fit size
Max allowed size: 120860
Old thumb build: 128494
New thumb build: 118514 (fits!)

Disabled:
Logo;
alpha blending capabilities for bitmaps;
Arm stack unwinder (backtrace);

Related forum discussion: https://forums.rockbox.org/index.php/topic,54768.0.html

Fixes FS#12380

Change-Id: I978720d795cb0ef5169103e467cf8386c21d8e93
2024-04-01 11:02:04 -04:00
Aidan MacDonald
dc9d354ed2 multiboot: Add v1 boot protocol
v1 passes the drive and partition number of the boot volume
instead of using the volume number. The volume number isn't
reliable because the same filesystem might get a different
volume number once the firmware is loaded, which will cause
the firmware to use the wrong root volume and fail to locate
the correct .rockbox directory.

Using drive and partition numbers avoids this issue because
drive numbering is fixed and determined by the target.

Change-Id: I7e68b892d9424a1f686197a6122e139b438e5f7e
2024-03-31 16:57:19 +01:00
Aidan MacDonald
6ffd42548b multiboot: Refactor boot data validation, add version numbers
Instead of verifying the CRC before every access of the boot data,
verify the CRC once at startup and set a flag to indicate the boot
data is valid.

Also add a framework to support multiple boot protocol versions.
Firmware declares the maximum supported protocol version using a
version byte in the boot data header. The bootloader chooses the
highest version supported by it and the firmware when deciding
what boot protocol to use.

Change-Id: I810194625dc0833f026d2a23b8d64ed467fa6aca
2024-03-31 16:57:19 +01:00
Aidan MacDonald
af644e02a1 Fix red in 5fd5f56cac
Change-Id: Icbc6e234a2fcdd7c8e0cdd0562f49fcbdf52480b
2024-03-31 16:57:19 +01:00
Aidan MacDonald
5fd5f56cac Disable unused LCD scroll functions in bootloaders
These functions just reset some state related to the scroll engine,
which is already disabled for bootloaders. They get called from the
LCD code and compiled into the binary, but have no real effect when
the rest of the scroll engine is not present. Replacing the calls
with inline stubs gets rid of this dead code from bootloaders.

Change-Id: I12a6d8926e19477ae3a5913e7fc8aff41cecd970
2024-03-31 11:36:16 -04:00
Aidan MacDonald
b0a8cacd1d rolo: simplify parsing scramble header in load_firmware()
The standard load_firmware() function is used on targets which
use the "scramble -add" method for generating Rockbox binaries.

While it tries to be a bit more generic and allows the CRC/data
offsets to be placed anywhere in the file, there are no targets
which actually need this flexibility, because they are all using
plain old "scramble -add".

So we can actually simplify load_firmware() and remove defines
from the target headers. All the targets used CRC offset = 0 and
data offset = 8, except for a few which I assume never supported
ROLO or were never tested -- eg. samsungyh820: the CRC and data
offsets cannot both be 0.

The actual motivation for this is removing the calls to lseek(),
which can help make bootloaders a tiny bit smaller, as lseek is
typically not used anywhere else in bootloaders.

Change-Id: Ic2d01e5b75a32e88363f085e3e839146a0710bf4
2024-03-31 11:24:07 -04:00
Aidan MacDonald
7dc8d754a2 Disable legacy codepage handling in bootloaders
Turn off legacy codepage handling in the filesystem code for
bootloaders, and support ISO-8859-1 (Latin-1) only.

This only affects DOS 8.3 filename parsing when FAT32 long
names are unavailable; long names are Unicode and can always
be decoded properly regardless of this setting.

In reality, bootloaders never supported codepages other than
Latin-1 in the first place. They did contain the code to load
codepages from disk, but had no way to actually change the
codepage away from Latin-1.

Compiling out this useless codepage handling code frees up
precious space for very size-constrained bootloaders like the
Sansa e200v2.

Change-Id: I26b049dd648fed4a0cc61fa938faa84e9816ab7d
2024-03-31 11:07:08 -04:00
William Wilgus
fe00906abb pathfuncs.c add path_strip_leading_separators()
added to path_append as well

Change-Id: Ieb6ec4f4c475ca5e60c8246c7f044bcc7651f6bf
2024-03-30 11:01:53 -04:00
Roman Artiukhin
6e058fe77f platform: hiby: Increase CODEC_SIZE to 1 Mb
Unifies codec size with most targets.

Apart from other things increased size improves seek accuracy in long m4b audiobooks.

Tested on Agptek Rocker and XDuoo X3II

Related discussion: https://www.rockbox.org/tracker/task/13049#comment44591

Change-Id: Id246969e78386b71ac66aace128cfba72a3f209e
2024-03-26 02:31:48 -05:00
roman.artiukhin
ed27dac432 Fix CODEC_AAC_SBR_DEC check with undefined CONFIG_CPU
Define CONFIG_CPU if not defined

This fix makes sure that  AAC-LC decoding is used both on device and simulator.
It's important for testing purposes as proper AAC-LC decoding requires changes both in decoder and in metadata handling.

Fixup for 4cd65b9d9.

Change-Id: Idef88825458761fffa3f5c5f4f221b555c509d89
2024-01-02 10:05:17 -05:00
Dana Conrad
8cc7476735 ErosQ Native ES9018K2M: Add digital filters capability
Setting not yet hidden for older hardware revision.

Change-Id: Iaaa5727e63c38de578a6bbc73498ae1073180e65
2024-01-02 08:19:23 -05:00
Dana Conrad
a3fe07ff12 ErosQ New Revision HW volume
Add HW volume control via ES9018K2M, and reorganize
eros_qn_codec.c/.h, audiohw-erosqnative.c.

This automatically detects the presence of the new DAC and
uses its hardware volume scaling. If not present, use same
SWVOL we have been using so far.

Add debug menu readout of SWVOL/I2C result.

Break out es9018k2m stuff into its own file so that
maybe it can be useful to other ports.

Note that we may need to get smarter about detecting the DAC
type if/when another model emerges.

Change-Id: I586a1cf7f150dd6b4e221157859825952840af56
2024-01-02 06:51:07 -05:00
Solomon Peachy
161c861153 Fix red in 4cd65b9d9
Change-Id: Ic3f136f5c88c46da68b78bc21ddefdf9fdbf2745
2023-12-31 21:30:18 -05:00
roman.artiukhin
4cd65b9d97 Codecs: mp4: Disable SBR decoding for PP5002 - PP5022 platforms
Includes ipod video (5G) and earlier models, sansa c200 and others players not capable to decode AAC-HE.

Allows to play backward compatible files as AAC-LC.

Change-Id: Ic9f5c0f255d9a4308c3414d402f8f27f4328ca94
2023-12-31 20:44:15 -05:00
William Wilgus
cb3b5397b3 Revert "Extend path_append_ex to truncate compname, remove some strmemdupa"
This reverts commit dbe20d453d.

Reason for revert: Crashes ipod Classic

Change-Id: I9ea329ce73383535353832d17c7c5e494e5ad516
2023-11-23 21:26:13 -05:00
William Wilgus
dbe20d453d Extend path_append_ex to truncate compname, remove some strmemdupa
remove some duplicated strings previously allocd off the stack

just removing string duplications that are easily handled with truncation
now available with path_append_ex()

this also has an advantage of less stack used in worst case scenarios

Change-Id: I3a43e33ef8a8c36599e4c6c036a0ccdd8ed0c883
2023-11-19 12:00:02 -05:00
William Wilgus
7ac4d34dd6 Playlist slight optimizations for playlist_resume
Change-Id: I766ce032a9b6b36d750a9231ff9f5d5a0167e5a5
2023-11-09 21:03:25 -05:00
Uwe Kleine-König
1ee152b5a4 sansaclipplus: enable usb-hid mouse support
Change-Id: Ifbebf9ff8474882a29378515e010e9c9d39df5c3
2023-10-27 19:31:41 +02:00
Aidan MacDonald
781f955aa2 Remove structec API
In my opinion this API is just not very useful - design is kind
of questionable. There are hidden limits on the struct size and
bugs on 64-bit platforms due to assuming sizeof(long) == 4.

At the end of the day, the only major user was the tagcache and
it's actually less code size to do endian swapping manually.

Change-Id: I451c7f1a10cf3e28744c32c0f1f39a710d5cc100
2023-10-01 12:10:41 +01:00
Aidan MacDonald
a6eaffe40d powermgmt: Remove CURRENT_USB
CURRENT_USB overrides CURRENT_NORMAL when USB is plugged.
It defaults to 2 mA and wasn't defined on any target, but
this doesn't make sense to me. After all, the current
drawn by the CPU or other components won't change just
because USB was plugged in.

As far as I can tell, the only side effect of removing
this is reducing the estimated USB charging current.
This might mean CURRENT_MAX_CHG should be increased by
CURRENT_NORMAL on some (all?) targets to compensate,
but I'm not sure which targets would be affected.

Change-Id: I5aa5c3893ae1e4ce6b8803ab4e8c897d534eb08f
2023-09-30 03:21:52 -04:00
Aidan MacDonald
fee5013514 disk: Remember the partition number for each volume
Change-Id: Ied6b0a558eec57435f9299f3e3326714f5e3cdca
2023-09-28 18:07:26 -04:00
Aidan MacDonald
028f283ee5 disk: Add "struct volumeinfo" to store volume related info
Change-Id: Ifd338d38db127d7896c43d1d25e70d0fae29fa1c
2023-09-28 18:07:26 -04:00
roman.artiukhin
7bbaf74c5c Ability to control backlight for soft lock action
See Settings -> General Settings -> Display -> LCD Settings -> Backlight on Lock

Change-Id: I201cb1c2907bb6842bf5d0b7a657e9db27aa905a
2023-09-09 22:00:14 -04:00
Christian Soffke
03d326fc90 Remove obsolete alias for audio_record function
Rockbox doesn't support HW codec anymore

Change-Id: Ia20d3f02f0d9db88b23cf9074e4d76aa21fd53b0
2023-08-17 13:40:09 +02:00
Solomon Peachy
5dc0e4e0bc disk: Support GUID Partition Tables (GPT)
Notes:

 * Currently limited to 32-bit sector addresses due to internal Rockbox
   APIs. So this means a practical limit of 2TiB per drive.
 * Only 'General Data' GPT partition type is recognised, as that's
   what SD cards seem to use for exFAT/FAT32.

Note that _booting_ off GPT-partitioned drive will require rebuilding
the various rockbox bootloaders, and even then there may be platform
limitations that preclude this.

Change-Id: Ibfaae1960adcb1e81976d4b60dd596c6d16318e4
2023-05-21 20:34:03 -04:00
William Wilgus
78c92c5ca8 [Feature] Supress voice during sleep timer shutdown
if show_shutdown_message == false and sleep timer is active
talk will be disabled on shutdown

Change-Id: Ia660e753700f3e283691f41797ef7a77a2d9a8d9
2023-04-08 17:13:07 -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
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
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
Aidan MacDonald
5b27e2255a Add perceptual volume adjustment
The perceived loudness change of a change in volume depends
on the listening volume: at high volumes a 1 dB increment is
noticeable, but at low volumes a larger increment is needed
to get a comparable change in loudness.

Perceptual volume adjustment accounts for this fact, and
divides the hardware volume range into a number of steps.
Each step changes the dB volume by a variable amount, with
most of the steps concentrated at higher volumes. This
makes it possible to sweep over the entire hardware volume
range quickly, without losing the ability to finely adjust
the volume at normal listening levels.

Use "Volume Adjustment Mode" in the system settings menu
to select perceptual volume mode. The number of steps used
is controlled by "Number of Volume Steps". (Number of steps
has no effect in direct adjustment mode.)

It's still possible to set a specific dB volume level from
the sound settings menu when perceptual volume is enabled,
and perceptual volume does not affect the volume displayed
by themes.

Change-Id: I6f91fd3f7c5e2d323a914e47b5653033e92b4b3b
2023-01-22 21:19:57 +00:00
Dana Conrad
66519000f4 ErosQNative: Enable Line Out capabilities on new revision players
The newer players have some changed hardware, but most importantly
the line out now appears to be routed through the stereo switch
instead of being hardwired directly off the DAC.

Disable muting the headphone amp, enable switching the stereo switch,
and rename some of the GPIOs to be more generic since the DAC,
headphone amp, and stereo switch all appear to have changed.

Change-Id: I220fe5e37bcbcd959b544183e1fcf70673a83c13
2023-01-22 15:11:35 -05: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
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
Solomon Peachy
255a34c685 fix red from #641e91aa2f
Change-Id: I7e648a7bdf1d706258afd49c1edd63655b2d2830
2023-01-13 17:02:23 -05:00