Commit graph

16444 commits

Author SHA1 Message Date
William Wilgus
f9c5d1fccf open_plugin.c (CORE) File input Bugfixes
Explicitly Null terminate char fields
0 is a valid file descriptor

Change-Id: I0faa9f5ec919ca913bceabf919fbaefcb38c39b9
2021-07-29 23:15:33 -04:00
William Wilgus
ea438ee132 cuesheet.c Fix potential NULL in INDEX parsing
untested

Change-Id: I6160348eeece364e3242f047437877ea34136f9c
2021-07-30 02:30:49 +00:00
Aidan MacDonald
77ec752248 shortcuts: fix file handle leak on OOM condition
Change-Id: If09db7a084d83e9bdeeafb8e8f434fcb502c45c5
2021-07-25 14:53:00 +01:00
William Wilgus
42ba117952 tree.c use strlcpy to avoid buffer ovfl
Change-Id: I6ac4ec6306c2101b11bc0495edd7bbe2717acf9c
2021-07-24 13:44:35 +00:00
William Wilgus
26fd90bb49 talk.c check for proper file load
few sanity checks on voice clip loads

Change-Id: I15fdf05d2964e9f6d00360b9730357dac6054af7
2021-07-23 22:53:25 +00:00
Solomon Peachy
68294da574 Document an intentional fallthrough in the volume limit menu code
Change-Id: I51d331ff788b73aa84fece63bfdca9c3e08c0384
2021-07-22 23:55:03 +00:00
William Wilgus
1fea6f4670 plugins pong, properties remove dead code
Change-Id: I6645ff850a637343dde129600f0b5eaa2e4f6d31
2021-07-22 23:24:12 +00:00
Aidan MacDonald
00129ac872 Fix battery_bench bug by using a static buffer for stack
Since battery_bench is a TSR (terminate & stay resident) plugin it
cannot allocate the plugin buffer -- various parts of the Rockbox
core make use of it as temporary storage space. The buffer was used
for stack space so this generated false 'Stkov' panics when one of
those in-core users overwrote the buffer.

The default stack size of 1kb is a bit small, so use 4x the default
size to be on the safe side.

This also fixes a minor issue where trying to view OS stack usage
while battery_bench was running would cause audio dropouts, due to
scanning the possibly huge stack with IRQs disabled.

Change-Id: I2e6b76f9946db9090c1af61f7aa0a0dac0698c20
2021-07-22 13:50:26 +00:00
Solomon Peachy
f0e3a36fe4 autoresume: Properly check the path string, not the pointer.
(the pointer is _always_ valid as it's to a fixed buffer)

Change-Id: I88489012b76ed3b5b214cf01da1a6260e259fe87
2021-07-21 15:06:28 +00:00
William Wilgus
8cd4b8da84 talk.c check for 0 talk clips file descriptor leaks & announce_status fix typo
talk.c potential division by zero warrants a check

desowin pointed out multiple fd leaks

announce_status.c dumb typo

Change-Id: Iae99bd64696afdd9585952245a7a04cdc9f88ef1
2021-07-21 11:26:29 +00:00
Aidan MacDonald
48c29e3b3b Fix announce_status usage of plugin buffer
Since this is a TSR plugin, it is not safe to use the plugin buffer.
Convert to using static buffers instead.

Change-Id: Ic5b297468a99d77d56f5b75e52dafabeb80d2f78
2021-07-21 11:26:14 +00:00
Aidan MacDonald
966e210e6d Small fixes to kbd_create_layout
- Make the argument const since it's not actually mutated
- Actually return the size of the buffer used since this is what it
  was supposed to do (although no existing callers cared anyway)

Change-Id: I0802071cf63d4af419f427ff54adca50b14918ad
2021-07-20 21:30:55 +01:00
Aidan MacDonald
6f042e91dd FS#13302 - Updated Polish translation (Adam Rak)
Change-Id: I3dd2c75d3e51061b71f3057b1a4ed4f398127ced
2021-07-20 15:24:02 +01:00
Solomon Peachy
df37450f91 talk: Explicitly cast -1 as unsigned before a left shift.
The code is explcitly relying on twos complement numerical represntation
so this just shuts up the compiler and static analysis warnings.

Change-Id: If11cd0a3a4127e8a872a752119d347ac6e09424c
2021-07-20 00:09:33 +00:00
Dana Conrad
3e7a09cb0d New Port: Eros Q Native
What works:
- LCD: 16-bit RGB565
- all buttons, including scrollwheel
- SD Card
- Battery level and charging/not charging status
- USB
- audio
- sample rate switching
- HP / LO detect, with "safe" fixed LO volume -
   LO volume will only be put to user-defined max volume
   if headphones are not present.
- rtc
- Plugins build, tried a couple and they seem OK
- Bootloader, installable to nand via usbboot

What doesn't work:
- Dual Boot
- power on/off has intermittent, low volume audio click
   (sometimes it's completely silent, sometimes there's
    a click)
- Audio uses 16-bit volume scaling, so clicking/popping
   is pretty bad at lower volumes - need 32 bit volume
   scaling, 24 bit I2S data
- USB HID keys not yet defined
- no jztool support

Unknowns:
- Stereo Switch pins: Direction select, AC_DC
   (probably not even hooked up)
- What is the actual purpose of the Stereo Swtich?
- How does the bluetooth module connect?

"Someday" stuff:
- get LCD working at higher bit depth
- Bluetooth

Change-Id: I70dda8fc092c6e3f4352f2245e4164193f803c33
2021-07-18 12:14:35 +00:00
Solomon Peachy
cd17decd5a xduoox3ii: Add "Super Slow" filter roll-off
I'm not happy with the proliferation of filter-roll-off options
but I don't have a less ugly solution.

Change-Id: I740fca006fa0c3443a467acfea55b6574d48346b
2021-07-17 08:18:31 -04:00
Solomon Peachy
144d1b1e81 misc: Fix up a few warnings uncovered by LTO
* direct use of memcpy() instead of ci->memcpy() in flac and mod
 * uninitialized variable in mpegplayer

Change-Id: I2d08682d5f66c319780e69e3ff63d600c61d8f5a
2021-07-15 18:37:42 +00:00
Aidan MacDonald
4c60bc9e68 New port: Shanling Q1 native
- Audio playback works
- Touchscreen and buttons work
- Bootloader works and is capable of dual boot
- Plugins are working
- Cabbiev2 theme has been ported
- Stable for general usage

Thanks to Marc Aarts for porting Cabbiev2 and plugin bitmaps.

There's a few minor known issues:

- Bootloader must be installed manually using 'usbboot' as there is
  no support in jztool yet.

- Keymaps may be lacking, need further testing and feedback.

- Some plugins may not be fully adapted to the screen size and could
  benefit from further tweaking.

- LCD shows abnormal effects under some circumstances: for example,
  after viewing a mostly black screen an afterimage appears briefly
  when going back to a brightly-lit screen. Sudden power-off without
  proper shutdown of the backlight causes a "dissolving" effect.

- CW2015 battery reporting driver is buggy, and disabled for now.
  Battery reporting is currently voltage-based using the AXP192.

Change-Id: I635e83f02a880192c5a82cb0861ad3a61c137c3a
2021-07-13 22:01:33 +01:00
Tomasz Moń
321680973b
Sansa Connect: Display battery info in debug menu
Show battery temperature, current, discharge power and available energy
in battery debug menu.

Change-Id: I799af4e5ca7ec168d726e689264e0f092ebc2bf7
2021-07-12 14:14:59 +02:00
Tomasz Moń
60e2cd6de9 DM320: Regorganize LCD and TTB memory layout
Do not introduce any change for M:Robe 500 as it uses the two LCD frames
in non-obvious way.

Sansa Connect and Creative ZVM use only single front framebuffer.
Place TTB at DRAM end to minimize memory loss due to alignment.
Reserve as little as possible memory for the LCD frames.
On Sansa Connect this change extends audio buffer by 858 KiB.

Change-Id: I21bdeec4cfba86d71803a39acd651a87e73767e6
2021-07-09 09:24:38 +00:00
Solomon Peachy
2ff3425ab1 build: Rename SHARED_LDFLAG to SHARED_LDFLAGS
Change-Id: Icb81c72fbcfcdad624112a386ba38a40a830d18f
2021-07-08 19:53:05 -04:00
Solomon Peachy
a952cf52d5 voice: Corrections to 24-hour time voicing:
* Voice leading "Oh" if hours is under 10.

 (ie "0900" is read as "oh nine hundred hours"

Change-Id: I09853909221e0dd6da354f7e4bb9733ff5edca90
2021-07-08 10:57:57 -04:00
Solomon Peachy
7f638e54ee RFC: Fix a couple more dangling stack-allocated viewports
They could end up getting referenced after the stack has been popped.

Change-Id: I12abbf3f436ecfde76a37f2623a044915800d2b2
2021-07-07 15:19:43 +00:00
Tomasz Moń
e11fa5f74e Sansa Connect: Initial libertas WiFi driver port
Import non-free firmware image from linux-firmware package.

Firmware loading works but is disabled at compile time because just
loading firmware without configuring device results in higher power
consumption without any benefit to end user.

Change-Id: I8fd252c49385ede1ea4e0f9b1e29adeb331ab8ae
2021-07-04 07:41:44 +00:00
Franklin Wei
d1a92aafff sdl: increase default worker thread size.
This fixes a mysterious, long-standing crash that's been bothering me on
ipod6g for ages: a silent stack overflow in the sound mixing thread (which
is triggered upon loading a new sound, apparently) will thrash the memory
which is located directly before it in the address space.

In this case, it was the SDL_ButtonState variable which stores the mouse
button state that was being trashed. This was manifesting itself by making
the player always run forward, since MOUSE2 is mapped to +forward by
default.

Fix this by quadrupling the stack size of SDL-spawned threads (not the main
thread) from 1 KB to 4 KB.

Change-Id: I2d7901b7cee1e3ceb1ccdebb38d4ac5b7ea730e1
2021-06-28 02:51:48 +00:00
Tomasz Moń
3738510953
Sansa Connect: Implement RTC functionality
Use 32-bit monotime AVR counter for time tracking. Set the time by
adding fixed offset to the counter value. Store the offset in rockbox
directory to make it persistent between reboots.

Do not implement alarm functionality as wakeup is only possible from
sleep and not from complete power off.

Change-Id: I615c7eb4df8ab0619dcbfcff107bc7051a15aace
2021-06-25 16:12:06 +02:00
Aidan MacDonald
6da490099b Touchscreen: absolute point mode scrolling bugfix
Due to this inadequate bounds check, it was possible under certain
conditions to cause a crash by touching & scrolling in the empty
space "after" the last item of a list.

Change-Id: Ic6c30214d887e1c7ccb212de272248ca24f60856
2021-06-22 21:42:02 +01:00
Aidan MacDonald
76e07a7fd2 Touchscreen: adjust how bar padding is handled
The old way of padding out bars was to just create a bigger touch
region, the intent being to make it easier to touch the end of a
bar. Unfortunately, this didn't even accomplish that, and caused
an annoying offset between the bar graphics and the touch point.

New method is to account for padding explicitly and clamp touches
in the padding region so they are within the proper touch region.

Change-Id: Id39e571fc1b033a4da94f0eb1143a2fc276bab03
2021-06-22 21:37:02 +01:00
Aidan MacDonald
02860d67c3 Touchscreen: adjust calculation of bar touch position
Increased the precision of the bar from 100 steps to 1000 steps so
it is possible to make finer adjustments, and made it possible to
pick the maximum value in a bar rather than just the maximum - 1.

Change-Id: I2e694d3e86e4a151e014da1bd15ab3ade4c4b95e
2021-06-22 21:37:02 +01:00
Aidan MacDonald
8a6b2f3abc Touchscreen: make volume bars respect volume step increment
Change-Id: I449b305ec4070e61f3619f8b7ac01a74c3ac59a6
2021-06-22 21:37:02 +01:00
James Buren
fc92081080 rockbox: add a crc32 reverse polynomial function
This uses the reverse of the polynomial used by the current crc_32
function. The code for this was derived from the implementation used
by tinf. This version is space optimized and should be a good way to
reduce code duplication in other parts of rockbox that use the same
crc32 algorithm. This is mainly of use in areas where DEFLATE is in
use.

Change-Id: I918da5b4ea4dc441c0e7e6b5007abcc2da463bcb
2021-06-21 03:37:17 +00:00
Aidan MacDonald
7aade87863 Fix yellow from 9ccae042
Change-Id: Iad4eaab8b766d1d0aad051971fd49a64126ca4be
2021-06-16 21:22:49 +01:00
Moshe Piekarski
9ccae0421a Implement x^y in calculator
Change-Id: I868b703131675876bd91198b8a53a921152aecba
2021-06-16 19:50:14 +00:00
Dana Conrad
c067b344e8 FS#13297: M3K Autolock allows one action before disabling touchpad
Intercept buttonpress and action, and nullify both if the button
is part of the touchpad. Only affects autolock functionality.

Adding removal of note about autolock in the manual - the lock
button no longer needs to be pressed at least once to prime
the autolock, if enabled, since commit 14f7a95

Change-Id: Ic3582764df490d96abc2d78116f23cbe0fdd6173
2021-06-12 21:11:28 +00:00
Dana Conrad
4c94c17913 ErosQ: undo ACTION_YESNO_ACCEPT button release
I accidentally left this in commit 8056b7f, and I think I'm giving
up on this for now - it just gets too complicated in the usb use
case. Revert to BUTTON_PLAY.

Change-Id: I9e392a3d7f2c18f34de54ecbafdb27cdf863b28c
2021-06-06 21:44:24 +00:00
Dana Conrad
14f7a958af Softlock Improvements
Add a check to see if the keys are currently locked and allow
them to be unlocked to ensure we don't get stuck when the current
playlist ends while the WPS is locked.
(Original by Aidan MacDonald)

Adding initialization for unlock_combo and to arm the autolock
(if enabled) without the user needing to press the lock button
at least once every boot (which is the prior behavior).

Removing screen_has_lock check from is_keys_locked()

Change-Id: I0fbf9b9746b011a7086ec8505a7ecc4b84f2d332
2021-06-04 00:00:57 +00:00
Dana Conrad
8056b7fd1a Yes/No Screen: Allow accept to be button release
Allows the ACTION_YESNO_ACCEPT action to be set
to a button release by ignoring certain system events.

Moving USB init in main.c to the last thing to prevent
getting stuck in the USB prompt, if enabled.
Also changing ACTION_YESNO_ACCEPT to button release on erosq

Change-Id: I5e7498521a13cb4e840223dd0b9c8633e99093bc
2021-05-27 19:58:09 -05:00
Dana Conrad
10d199f9d5 Allow Softlock to happen in most contexts
All this tested on erosq, I'm not sure if this will break on other targets or if there is a reason this shouldn't be done.

apps/menu.c:

Added CONTEXT_MAINMENU|ALLOW_SOFTLOCK in do_menu(), this allows the user to lock the keys in most places within the main menu tree.

apps/tree.c:

Added CONTEXT_TREE|ALLOW_SOFTLOCK in dirbrowse(), this allows locking the keys in most other contexts not covered by the above.

Notable exceptions I've found that still cannot be locked: View Playlist, any settings change screen (ex. Shuffle No/Yes, Volume Select dB)

Adding fix for Advanced Key Lock feature brought to light by this change in apps/action.c.

Expected behavior for Advanced keylock is now (according to my testing here):
        Volume:	Can be exempted	from keylock anywhere
        Skip/Scrollwheel: Can only be exempted in WPS
        Seek: Can only be exempted in WPS
        Play: Can only be exempted in WPS

Backlight exemption is same except the Volume exemption doesn't work outside the WPS, but I don't believe that is due to this change.

Change-Id: Ifa3d1a03cf4884520a37dd91ed53a825cdb66778
2021-05-24 02:30:09 +00:00
Aidan MacDonald
5cbeb88541 FiiO M3K: keymap improvements & fixes
- Add support for skip and seek while the player is locked.
  (Thanks to @bahus for the suggestion)
- Fix touch zones because the down button zone ended up being
  a lot smaller than expected due to the touchpad's wonkiness.
  Also added a visual display of the touchpad to its debug menu.
- Fixes the pictureflow keymap because it was mostly unusable.

Change-Id: Ic0da4f8df3613ff7828ce1cb940ed9e77ada3281
2021-05-22 12:20:44 +00:00
Aidan MacDonald
a2bac25a63 Allow alternative keymap when keys are locked
To enable support targets must define HAVE_LOCKED_ACTIONS and then
handle the CONTEXT_LOCKED flag from get_context_mapping().

Change-Id: I92703b534e4a45b4ebbf9bf98af42df9b8ac3b1a
2021-05-22 12:20:23 +00:00
William Wilgus
e910f63bba lua add a way to filter settings on read
rather than dumping all the settings allow a filter function
to choose desired settings

in menucoresettings you can see an how to do exact text matches
or wilcard matches you can even use luas version of regex

Change-Id: I4c7f7592498ea194e06e9a556b77ffd57f5d4223
2021-05-19 23:29:10 -04:00
William Wilgus
dcff9b85a3 lua latebound function update
return the nextfunction and nil instead of pairs it allows a faster
return to lua rather than calling the lua function
pcall(fnpairs) from c and returning the result back
into lua to kick off the search
yeah, no clue why I didn't realize that before..

testing in x86 and ARM..
its more RAM efficient to do the initial creation
of the stack in lua code for the __pairs functon
its not faster but being that its a one time hit per
iter creation the reduced churn alone should be worth it
along with a reduced peak RAM usage

fix bug where a failed module can not be reloaded

optimize filetol

fix potential bug in splash scroller when no break character is found
Change-Id: I42c922e07039a19138b97c0d0e80cf3cf2426471
2021-05-19 23:28:35 +00:00
Solomon Peachy
3ed035769c FS#9093: Database initialization hangs if there's no music file on the player
Original patch by William Poetra Yoga Hadisoeseno

Change-Id: I198a4d1b2899bd9200a35dbefd034a2e9857fa19
2021-05-19 16:30:32 -04:00
Solomon Peachy
64bed8361d FS#13289: Updated Polish translation (Adam Rak)
Change-Id: I6680eac724a480006126d9128f8cc852f6221095
2021-05-15 11:18:59 -04:00
Aidan MacDonald
237919f1c3 Fix invalid use of bool in doom
Settings code tries to cast the bool pointer to an int pointer
and then write through it, which makes AddressSanitizer whine.

Change-Id: I1d6162fc98144cd6b40444016b3b48ef02967324
2021-05-13 18:33:27 +01:00
Dana Conrad
84a3cbe24d ErosQ: Small keymap changes
- Move WPS Stop to Power (Hold)
- Add WPS Hotkey to Wheel scroll Fwd/Back
- Add WPS Quickscreen to Play (Hold)
- Add Tree Hotkey to Play (Hold)

Change-Id: Id74622138353521f736c0de1009a354307b108eb
2021-05-12 11:01:27 +00:00
William Wilgus
adff45ca21 lua -- temp loader
fix a few bugs, improve memory usage

Change-Id: I6ceefd033000a6178eab0dd513679b5d72cec81c
2021-05-06 21:36:55 -04:00
Solomon Peachy
244aad750c Update the english-us "translation"
Change-Id: Ife8dc52dd60fa10e8713f85969cebb6a865fd624
2021-05-04 21:56:41 -04:00
William Wilgus
9b2f23319c lua fix yellow and add temploader
temp loader allows some lua requires to be loaded and
later garbage collected unfortunately the module needs to be formatted
in such a way to pass back a call table in order to keep the functions
within from being garbage collected too early

BE AWARE this bypasses the module loader which would allow code reuse
so if you aren't careful this memory saving tool could spell disaster
for free RAM if you load the same code multiple times

Change-Id: I0b6f81e481b8c779edbd620c8403794f8353926f
2021-05-03 23:13:25 -04:00
William Wilgus
489a5f3ff7 lua add ability to use custom kbd layouts
bring custom keyboard layouts to lua
conversion to the proper format requires create_kbd_layout.lua
just pass a lua string with your desired layout

Change-Id: I14a392410846311a4f3cf8dda0e88d39834d0418
2021-05-04 01:52:08 +00:00