Commit graph

33812 commits

Author SHA1 Message Date
William Wilgus
c0682e0944 Clean up rocklib_img
optimize both size and speed
fix invert for color screens

Change-Id: I7edecae32dcb3daf5b3ed984a0e5b3d463269e60
2018-10-09 01:02:25 +02:00
William Wilgus
e4b843335b lua rocklib cleanup
removes tslf allocations from do_menu and gui_syncyesno_run in favor of
lua_newuserdata

removes some luaL_opt functions in favor of equivalent lua_to functions

moves some definitions to the rocklib.h file

Change-Id: Iaacc3249b8f1af2c220ce59dead0050c66cb3b04
2018-10-08 23:15:16 +02:00
Solomon Peachy
ebaddc671e build: Log the zipfile creation
Change-Id: I7d5b923cfe6bc133a1b2ac39b39bbe07e327d9cd
2018-09-28 11:53:15 -04:00
Solomon Peachy
3e209f34e4 misc: Fix some assorted compiler warnings
Change-Id: Ibc4aac79e6fce92ad4414ed50122c2d4d6295f89
2018-09-28 11:53:15 -04:00
Martin Nowak
e18425197e fix FS#13060 - Seeking in long opus files leads to crash on Sansa Clip+
- increase decoder thread stack size just enough (2KiB) to
  avoid stack overflows when seeking in opus files
- only do so on devices with at least 8MiB of RAM

Change-Id: I7e7182ae866338b4aad6ed7e32391ddd667121bd
2018-09-28 17:47:28 +02:00
Solomon Peachy
a454b7f9ef jz4760: Lots of stability fixes to the USB driver.
It actually works for transferring data now!

Igor Poretsky gets full credit for this patch.

Change-Id: I247c70fdf45e590b4699b9b8668bbdab7bc3ef03
2018-09-20 21:11:40 -04:00
Solomon Peachy
a26c1c1459 xduoo_x3: Disable keypress IRQ since we poll for keypresses.
Change-Id: Ieab5f864751cf798b62c4e89e670acf7ade756ab
2018-09-20 19:38:58 -04:00
Solomon Peachy
640ada0389 jz4760: Enhancements and fixes to SD driver.
* Fully Interrupt-driven, with proper task yielding
 * Much more robust error handling
 * Eliminate duplicate code
 * Pile of bugfixes

 (Much of this adapted from Igor Poretsky's tree)

Change-Id: I46006412323cba2088b70094635d62a241be1d7e
2018-09-20 19:38:25 -04:00
Solomon Peachy
8edf4052c7 jz7460: Silence codec when changing playback frequency/mode
Silences some annoying clicks.

Change-Id: I3d32d4b33c0ccc61877e10f5af97fe05084d66e5
2018-09-20 18:59:19 -04:00
Solomon Peachy
1020897794 jz7640: SD driver improvements:
* Better multidrive support
 * Common slot1/slot2 handling code

Change-Id: Id0aed90cbba4246fdc71b42e03f016f8060d258a
2018-09-20 18:59:19 -04:00
Solomon Peachy
679a0bd193 jz74x0: MSC clock needs to be divided from PLL clock.
Change-Id: I0cf2f0d55e0859f896afef289e833935d7c5a599
2018-09-20 18:59:19 -04:00
Solomon Peachy
72820d8b2d jz4760: Greatly enhance debug code and silence some compilation warnings.
Change-Id: I1746d67c818ad099edea83e6242ffd5c79be0000
2018-09-20 18:59:19 -04:00
Solomon Peachy
08ab3aea4f Get rid of the last remnants of HAVE_FUNCTIONAL_MODE
Change-Id: I4f9339019884aceedc8c9d0ab779a2e32ace0288
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
2018-09-20 22:03:03 +02:00
Solomon Peachy
3671f923eb Xduoo_X3: Update target configuration
Change-Id: Ibc6b204357524550a0d6fa917e7d074ec2e52773
2018-09-20 22:02:28 +02:00
William Wilgus
dc6f23ec36 lua optimize integer and string consts in rocklib
use a table approach for registering integer / string constants

Change-Id: Idbccae9c2203de1c694f6dd5a7014a7fccedae9b
2018-09-14 01:13:22 +02:00
William Wilgus
733c20d5d3 lua move RLIMAGE to own file
Change-Id: Icd10e4c348deec7729d4a6e2bf1152e1dfc70243
2018-09-14 01:00:35 +02:00
Solomon Peachy
be801c61bb mips: Update the MIPS threading code
Taken from Amaury Pouly's Fiio X1 patches in gerrit.

   Xduoo X3 no longer panics on startup

Change-Id: I4c2dee832306755b9e496084cb47fb61f804af20
2018-09-07 09:55:12 +02:00
Marcin Bukat
734be0d6aa MIPS: fix memset()
swr/swl instructions used for word aligning were wrong. This
made memset() terribly broken. I can't imagine how it went
uncaught for soooo long. Spotted by Solomon Peachy.

I run unit tests for alignments 0,1,2,3
size 1, 2, 3, 4, 5, 63, 64, 65, 127, 128, 129;
and fill pattern 0x00 and other (since 0 is special case in this
implementation).

Change-Id: I513a10734335fe97734c10ab5a6c3e3fb3f4687a
2018-09-07 09:43:05 +02:00
Solomon Peachy
b1ee789f97 libmad: Back out a change that disabled optimization for libmad.
(Caused non-realtime playback on mips..)

Change-Id: I878229e16e31d49156f1ae71ab9c7bb627e4c17b
2018-09-02 11:55:39 -04:00
Sebastian Leonhardt
91500e1296 pacbox: fix screen and buttons for Creative Zen
* rotate screen counterclockwise
* rotate directional buttons

Change-Id: Icbdf26fe1e14638eb8b0746a9eea99e0236ac6b1
2018-08-05 15:19:07 +02:00
Sebastian Leonhardt
5dfcadc45b manual: nitpicking on '-' character and other minor details
Change-Id: Id204276387d55ba2276530ed1cb6ee827e28062a
2018-08-05 12:57:05 +02:00
Cástor Muñoz
7442742208 iPod Classic: disable IRAM1
On Classic, IRAM1 (second 128Kb of a total of 256KB available IRAM) is
slower than DRAM. Codecs that actually are using regions of IRAM1 runs
faster when DRAM is used, so IRAM1 is disabled and only IRAM0 remains
enabled: 48KB for core and 80KB for codecs/plugins.

The next test_codec results shows how decode time is decreased:

file           boosted     unboosted
*.ra           ~1.5%       ~0.5%
*.mpc          ~21%        ~4.5%
*.ogg          ~0.5%       ~0%
nero_he*.m4a   ~8%         ~1%
nero*.m4a      ~25%        ~7%
wmapro*.wma    ~4.5%       ~0%
wma*.wma       ~25%        ~7%

In addition there is a small power save when IRAM1 HW is disabled.

Change-Id: I102adee11458e82037f23076d5d5956e23235de8
2018-07-30 18:50:27 -04:00
Cástor Muñoz
8f38f85fbd Workaround for usb_storage_init_connection() panic
For s5l8701, s5l8702 and as3525v2 targets.

The crash occurs when USB is inserted or extracted while the playlist
is being loaded or updated (it could take a few seconds for huge
playlists), at this point all buflib memory is allocated and not freed
before usb_starage_init_connection() is executed.

This workaround mitigates this panic by using static memory for USB
buffers, so this memory cannot be used for other tasks, in addition
the problem still persist when playlist load is 'paused' by USB
insertion and then updated after USB extraction.

Change-Id: Iff1db5a949361fd543e0b494924d1f2906c84b5e
2018-07-30 17:54:51 -04:00
Franklin Wei
210881ca35 Remove leftover merge conflict marker
Change-Id: Ie34657fe652d3613429d3fa233faac9608a8b826
2018-07-29 12:23:28 -04:00
Franklin Wei
e9bdb4b028 Fix syntax error in builds.pm
This should fix the build system.

Change-Id: I7af7628083cf20aa85278dfa3fee70a0ccb2dcc3
2018-07-29 12:05:16 -04:00
William Wilgus
d8bd356e56 Revert "As3525 v1/v2 Add power savings menu"
This reverts commit 6f0320a953.

Change-Id: I7425d422a4a0af7a49e9194cfe0bb55d431bc401
2018-07-28 17:35:07 +02:00
William Wilgus
16f10e2abd Revert "Fix Red on PowerSave in Simulator"
This reverts commit 568b81202e.

Change-Id: I2af42cd53d0ce490bf96c68288e9fbde034c0069
2018-07-28 17:34:31 +02:00
Michael Giacomelli
c75aac8424 Slightly raise voltage on FuzeV2 devices.
Some devices seem to have trouble accessing the storage at lower voltages.
2018-07-28 11:05:59 -04:00
Michael Giacomelli
3e91ad5df2 Fix download link for the MIPS toolchain. 2018-07-28 10:56:31 -04:00
Solomon Peachy
0662793ca0 Add cleaned-up xDuoo X3 support
Cleaned up, rebased, and forward-ported from the xvortex fork.

(original credit to vsoftster@gmail.com)

Change-Id: Ibcc023a0271ea81e901450a88317708c2683236d
Signed-off-by: Solomon Peachy <pizza@shaftnet.org>
2018-07-28 10:56:31 -04:00
Amaury Pouly
b3e2bd619b Update MIPS toolchain to GCC 4.9.4 and binutils 2.26.1, update configure
Change-Id: I4d3dad4521bdf0b0d6ee5d1635ddbf57483d2b42
2018-07-28 10:56:31 -04:00
William Wilgus
8fb1740a78 Fix scroll_engine truncation
fix one off error

Change-Id: I9b3b23c9f6c36107e73e511d8cb1bc5cd987e765
2018-07-28 15:36:13 +02:00
William Wilgus
568b81202e Fix Red on PowerSave in Simulator
Change-Id: Ic5d9de230efceabc2c428e5c78fa6596a5a34840
2018-07-28 14:55:52 +02:00
William Wilgus
6f0320a953 As3525 v1/v2 Add power savings menu
Allow user to select cpu undervolt

There have been quite a few issues across the SANSA AMS line related
to CPU undervolting while most players show greatly increased runtime
some crash.
Rather than constanly upping the voltage we now have a
setting with a safe value for all players and the option for lower voltages

I plan to add a few other options here later such as disk
timings and maybe some other clocks/experimental settings

Added: Disk Low speed option for AS3525v2 devices cuts
	frequency to 12 MHz from 24 MHz
Added: Disk Low speed option for AS3525v1 devices cuts
        frequency to 15.5 MHz from 31 MHz

Added: I2c Low Speed AS3525 devices, should be bigger improvement for v1 devices

Fixed: Debug menu for AS3525v2 No SDSLOT frequency,
	Showed IDE freq though it is unused

Added: DBOP and SSP underclocking affects display on v1/v2 respectively

Fixed: debug menu now has SSP frequency, and SSP_CPSR

Update: made settings menu more generic

Update: cleaned up code

Added: Clip v1 & Fuze v1 didn't have HAVE_ADJUSTABLE_CPU_VOLTAGE.
	not sure why but,  waiting on testing to confirm

Added: C200v2 and E200v2 devices and HAVE_ADJUSTABLE_CPU_VOLTAGE.

Fixed: v1 devices don't like display timing set lower (dbop)
       v1 devices don't have a divider set for ssp (causes divide by 0)

Fixed: ClipZip display lags with Max SSP divider changed from 0xFE to 0x32

Fixed: v1 devices didn't work properly with highspeed sd cards
	Added code from http://gerrit.rockbox.org/r/#/c/1704/
	Added powersave and IDE interface enable/disable

Added: V2 devices now have powersave enabled on sd interface

Update: cleaned up code, lang defines, added manual entries

Update ssp clock mechanism added calculated ssp divider to clipzip

Update turn display clock off when clip+ turns off display

Fixed: clipzip wrong register for SSP clock

Change-Id: I04137682243be92f0f8d8bf1cfa54fbb1965559b
TODO: add other players?
2018-07-27 23:56:32 +02:00
William Wilgus
400603abdf Lua -- Fix device hang when scroll function active on clear_screen
I previously noticed that manually clearing the framebuffer while scroll
function was active caused lua to crash

I could reproduce in sim and on device but I thought using the plugin
supplied rb->lcd_clear_screen was immune to this issue

Unfortunately some devices exhibit this behavior with the plugin function
as well

This patch adds rb->lcd_scroll_stop() before lcd_clear_screen at lua start-up
and to the supplied include file lcd.lua

Change-Id: I9800145e5c834ea27df5db5f1bca50b0d40faa49
2018-07-27 15:09:55 +02:00
William Wilgus
dcd71e66bd Optimize lcd-ssd1303 driver (clip series)
Saves 100+ bytes (50 of it in iram), saves a bit of power

Internal LCD clock decreased but with added efficiency of drawing routines
loses only around 2 Hz on the scanrate (~75Hz) while fps is slightly increased

Column offsets are now calculated outside the loops saving a few instructions

Passing a LCD_NOP command after lcd_update turns off Data/Cmd# gpio
saving a bit more power

Added a function lcd_write_cmd_triple() that allows 3 commands to be sent at once
when enabled with LCD_USE_FIFO_FOR_COMMANDS it sends them back to back without
checking FIFO status in between or sending to thhe D/C# Gpio.
Makes an assumption about the FIFO being large enough to
accept 3 commands after being emptied which should be the case on the
clipv1, clipv2, clipplus. I have only enabled it for the clip plus
as thats the only device I have to test it on.

On clip+ the SSP clock is now turned off when screen is off

Change-Id: Ib5fd24697bfe4ac8b8ee017361e789e4a7910d21
2018-07-26 04:23:28 +02:00
William Wilgus
056d4b0ec0 Update AS3525 v1/v2 debug menu; add scrolling and missing frequencies
On the clip zip most debug menu items get cut off and there is
no way to read most of the debug menu items.

This patch makes the menu button scroll the text 1 character
to the right with each press and the center (select) button
re-aligns the text

Adds SSP frequency(v2) & register
Adds SD slot frequency(v2)

Change-Id: If4705d6790e25061931ca654062e22fc2e0a6f16
2018-07-26 04:00:28 +02:00
William Wilgus
ff7d2bdee1 Fix lcd-scroll.c truncation warnings
Change-Id: I312ec7ad06fde5b2f9747661cd2d4ffcb4cbf755
2018-07-25 20:53:17 +02:00
William Wilgus
1054b5748c Revert "Ignore truncation in lcd-scroll.c"
This reverts commit 540637ed33.

Change-Id: I88e71ef47a11818a5acb407ff9c0723d3c197243
2018-07-25 20:41:48 +02:00
William Wilgus
7b5ce736db Fix playersim CHAR_WIDTH re-definition
Change-Id: I49d2b3635c62277723665d0bdd68808cc82ca1a9
2018-07-25 20:16:02 +02:00
William Wilgus
540637ed33 Ignore truncation in lcd-scroll.c
Change-Id: Id1008300e58cf12ab920c1023354a74a6d32daae
2018-07-25 19:56:53 +02:00
William Wilgus
5e5ddce270 Fix truncation warnings in tree.c, filetree.c
Change-Id: Ic5ae1e5f904a3da4bba07cdef7f4bb003dc091b2
2018-07-25 19:33:52 +02:00
William Wilgus
7bec71368b Fix formatting cuesheet.c
Change-Id: I51edd5319882b2928b565c27615e20937399a1f9
2018-07-25 19:32:25 +02:00
William Wilgus
2fb6b2b458 Fix truncation warning playlist.c, tree.c
Change-Id: I0c62f06fea3ccb55efa21b719a44a263dedc32e2
2018-07-25 18:34:53 +02:00
William Wilgus
2eeb338e90 Ignore cuesheet title truncation
Change-Id: I0de8a1468379f60140fb30b6c086fe15ea753da2
2018-07-25 14:14:45 +02:00
William Wilgus
bdbc7f7b7b Revert "Remove truncation from cuesheet"
This reverts commit a81c63160c.

Change-Id: Ie6d3e780fd6318b6173943167015f78f4a9c327a
2018-07-25 08:33:14 +02:00
William Wilgus
021124f868 Revert "Fix cuesheet printf truncation"
This reverts commit c332180afd.

Change-Id: Ic7a85a0fe82cd13514e85011e0a5cbd79ec36c2b
2018-07-25 08:31:13 +02:00
William Wilgus
c332180afd Fix cuesheet printf truncation
Change-Id: I48189c3ce29f27d4b3bb4f874c80636c1f0ca6b6
2018-07-25 08:13:19 +02:00
William Wilgus
a81c63160c Remove truncation from cuesheet
Lets see if this works..

Change-Id: I1fa7f17a07b3a7b479f987694ffcd59bc4e0bf5b
2018-07-25 07:33:13 +02:00
William Wilgus
c15af64452 AMS v1/v2: Fix I2C2_CSPR debug menu entry
I2c controller needs to be enabled in order to read CSPR0, CSPR1
registers function sets CGU_I2C_AUDIO_MASTER_CLOCK_ENABLE
and only clears if it wasn't previously enabled

Use divider set in register to calculate frequency rather than
hard coded divider

Change-Id: I54ecc0c1859e906c00f4c2ae8ae2424a4619df98
2018-07-25 06:03:44 +02:00