Commit graph

3426 commits

Author SHA1 Message Date
Solomon Peachy
2b358ffa7f Disable 88/96KHz from targets that lack the IRAM to hold the mix buffers
Change-Id: I67b15d4c517a74a23639f8659acbc89022c264b5
2020-10-03 15:27:30 -04:00
Solomon Peachy
d4a620e85a alsa: introduce AUDIOHW_MUTE_ON_PAUSE, and have rocker use it.
Change-Id: I1edbb8e71a9c73baaeecb01b66cbee6c3f7b5f8f
2020-10-03 14:41:40 +00:00
Solomon Peachy
b5cb99a7bf For backlights that have a wide control, support skipping steps.
the rocker, x3ii, and x20 now take advantage of this, and fades
are far faster now.

Change-Id: Iceb1a5a6c1d1389c3fdb859b32016b5114a80a22
2020-10-02 02:45:43 +00:00
Solomon Peachy
f4f3255edf xduoox3: Work out clocks for 176/192KHz support.
Note:  PCM mix buffer sizes are _way_ too small for these high bitrates

(We really need to make the mixer stuff use dynamic buffer sizes based
 on the bitrate.  Maybe pre-allocate a max size based on upper bitrate limit,
 but use only part of it at lower bitrates?  So we can have sane latency..)

Change-Id: Id7b4afd73dba7f1ffb84b2e1c016859fae5d6835
2020-10-01 17:30:22 -04:00
Solomon Peachy
b030bf5885 xduoox3ii/x20: Proper lineout detection and volume mangling.
hotplugging hp and lineout works, without blowing out eardrums.

Change-Id: I2df5c7a618bb2d1d77d416548d45dff9cfc619db
2020-10-01 15:41:30 -04:00
Solomon Peachy
6d47dc9a88 fix some of the red introduced in e43726d
Change-Id: Id1abb0dd11f8a8e79a80fc54e58a5a22706a03ad
2020-10-01 12:55:52 -04:00
Solomon Peachy
e43726df2c hosted pcm-alsa improvements
* xduoo x3ii/x20:  Better line out support
 * less granular volume settings (too many steps before)
 * Better handling of swiching sample rates
 * Log actual sample rate in debug menu

Most credit goes to Roman Stolyarov
Additional integration [re]work by myself

Change-Id: I63af3740678cf2ed3170f61534e1029c81826bb6
2020-10-01 11:56:57 -04:00
Solomon Peachy
01650b8bc9 audio: Add support for 192 and 176KHz playback
* SAMPR_CAPS_ALL -> SAMPR_CAPS_ALL_48/96/192
 * All targets claiming SAMPR_CAPS_ALL now get appropriate subset
 * No need to explicitly define HAVE_PLAY_FREQ
 * Rates that are a multiple of 44 or 48KHz can be used for playback

Inspired by a patch by Roman Stolyarov, but substantially rewritten by myself.

Change-Id: Iaca7363521b1cb9921e047ba1004d3cbe9c9c23e
2020-09-30 21:37:11 -04:00
Solomon Peachy
ff408fd717 Leave HOME_DIR out of default recording and playlist paths
The hosted filesystem code will automatically prepend HOME_DIR.

Change-Id: I36a76e51637ab2bb68353f8eb9ffac25ca75bad1
2020-09-30 18:56:54 +00:00
Solomon Peachy
0fe7db2460 xduoo: x3ii and x20 also have their CPUs clocked at 1008 MHz.
Change-Id: I59fbd1edc934a6e2b2323e13b4efc3cc1caad903
2020-09-28 21:17:39 -04:00
Solomon Peachy
ae58b5aafe xduoox20: UI Simulator support
Change-Id: I2a03cea07fbad9fb5862ca69e4cfca2e8ca6b17f
2020-09-28 21:12:52 -04:00
Solomon Peachy
43980bb877 rocker: CPU is actually running at 1008MHz, not 532.
Change-Id: If5204574cb604d1ea82f0863d300468bedcf541d
2020-09-29 00:37:11 +00:00
Solomon Peachy
ec413f7692 jz4760: Heavily rework USB driver to add working DMA support
* DMA Bulk IN (ie our TX) results in sequential transfers 33-68% faster.
 * DMA Bulk OUT (ie RX) is mostly stripped out due to complete brokenness.
 * Interrupt and control endpoints remain PIO-driven.

Other improvements:

1) Use consistent endpoint references (no magic numbers)
2) Greatly enhanced logging
3) DMA support can be compiled out completely
4) Setting lockswitch will disable all DMA operations at runtime
5) Much more robust error checking and recovery

Change-Id: I57b82e655e55ced0dfe289e379b0b61d8fe443b4
2020-09-17 11:26:04 -04:00
Solomon Peachy
90a4f28c27 jz47xx: Audio path tweaks:
* Increase audio buffer size to better handle IRQ latency (256->2048)
 * Ensure DMA engine is idle prior to starting transfers
 * Set AIC to repeat last sample in case of underflows

Change-Id: I9c45c20481ee072e5882b7586fb7d50bd8ef2f35
2020-09-04 15:57:00 -04:00
William Wilgus
06e9abc428 XduooX3 Tweak LCD drive strength and slew
Change-Id: Ic5ee9e700a0c8acffc39b51cedc24ff44d230fd3
2020-08-30 17:26:43 -04:00
Solomon Peachy
3dc4f817de jz4760: Disable dynamic clocking entirely.
Back off to 480MHz [max] clock, bus/mem clock of 120MHz.

576 is unstable on at least one unit, and 528 still glitches.

Change-Id: I020e48532524e739f3bfa42bed570381ccd34959
2020-08-29 14:59:46 -04:00
Solomon Peachy
6296b220e5 cs4398: Change default volume to -25 dB (from 0 dB)
Change-Id: Iac216951b6f21bd83bb1d529e231bbb3e0aa0da6
2020-08-29 08:51:35 -04:00
William Wilgus
31a1a29004 Xduoo X3 Tweak LCD settings
Adds contrast setting which actually sets the drive voltage

Change-Id: I173238e2efe9e50c6ef4cda9bf991e7ee5568ff5
2020-08-29 04:31:37 +00:00
Solomon Peachy
fc7eb3b2a3 xduoox3: When not using dynamic clocks, use max cpu
Change-Id: I789bb4eccc5b663156f5d1b7cd5d291b60ccb18d
2020-08-29 02:53:06 +00:00
Solomon Peachy
a2b77446c2 xduoox3: enable HAVE_GUI_BOOST
Change-Id: I719057b3539d6fb80cef10238a13c5071def1be5
2020-08-28 21:16:24 +00:00
William Wilgus
5fb4c74bfb Xduoo X3 - Grey scale lib update
greylib on the xduoo x3 now matches the rest of the 1bit targets

Change-Id: I2685869da6734404356552cc9f4ed5f59ebd6650
2020-08-27 14:33:23 +00:00
Solomon Peachy
a52eb1d8cc xduoox3: Include curves for both battery types
There is no way to detect this at runtime so it is a user setting

Change-Id: Ibc5b87312238c59e3678d512af27e3a3bcb9a58a
2020-08-26 18:18:02 +00:00
Solomon Peachy
f791df1375 xduoox3: Update battery discharge curve and runtime estimates
(Brand new unit lasted one minute shy of 12 hours!)

Change-Id: I0330f43065412d432a45b555bb310f943eb526e7
2020-08-26 08:34:07 -04:00
William Wilgus
f850bbbbc4 Revert root_redirect :(
This reverts commit 31fc46ded6.

Change-Id: Ia78618c0e8b25ca65f7c8ae0db1cb9c9b321bad9
2020-08-20 21:54:00 -04:00
William Wilgus
5ef28cccf9 Allow mounting of any directory as the root directory.
Provide definitions for the macros:
* RB_ROOT_VOL_HIDDEN(v) to exclude certain items from the root.
* RB_ROOT_CONTENTS to return a string with the name of the
directory to mount in the root.

Defaults are in export/rbpaths.h

It's a bit much for those that don't need the full functionality.
Some conditional define can cut it back a lot to cut out things only
needed if alternate root mounts are required. I'm just not bothering
yet. The basic concept would be applied to all targets to keep file
code from forking too much.

Change-Id: I90b5c0a1c949283d3102c16734b0b6ac73901a30
2020-08-20 23:08:57 +00:00
Johannes Rauh
da190727e7 Enable boot from SD for Sansa e200
Change-Id: I0940f2cd5fc914d6d5061b5798b1a636009649b7
2020-08-19 19:17:01 -04:00
Solomon Peachy
4d9f190cab xduoox3: Fix build when disabling adjustable cpu freq
Change-Id: Ia8526ad81d7a9744972d9c4fb394e61175ad2391
2020-08-12 20:43:46 -04:00
Solomon Peachy
ae18cac2a9 Enable full sample rate sets for X3ii, X20, and Rocker
Change-Id: I89e139efb8a7662afaaabec360e6579907f8d025
2020-08-09 17:00:27 -04:00
Solomon Peachy
491b696669 Fix HOME_DIR path for Rocker, X3ii, and X20
Prevented plugins from accessing their config files properly

Change-Id: Ic3b115aaa9168fa30b98607aeacb1a12b5498a5f
2020-08-09 17:00:27 -04:00
Solomon Peachy
eb0e41c1cc jz4760: Support dynamic reclocking!
default/low speed is 192 MHz, Max is 576

Downclock PCLK/MCLK/etc to 96MHz to save a bit of juice

Honestly the high speed could be dialed down to, eg 384
as this thing is so bloody fast..

Change-Id: Ie65597c74290f1603e65f69dae8e75b59c8ba0b4
2020-08-07 11:42:45 -04:00
Solomon Peachy
89c7a4e393 xduoox3: Enable HAVE_PLAY_FREQ
This way the player can natively play back 48KHz audio

Change-Id: I1d525ec7cb5540062b9e13489d3b53479e68435f
2020-08-07 03:44:18 +00:00
Solomon Peachy
e0bb30a1bd xduoox3: Set PLL0 to 480MHz, not 492.
PLL0 Needs to be a multiple of 48MHz for sane USB operation!

(Indeed, "typical" clock for this part is 528, but that seems a
 waste of power)

Also fixes a minor bugaboo in the jz4670 usb divisor calculation
that won't matter until we enable reclocking

Change-Id: I40b1fd1ae48871e50885981ccc8b01feb711b9a5
2020-08-07 03:44:01 +00:00
Solomon Peachy
5d1d431b97 FS#9295: Detect external power supply for ipod 1st & 2nd gen (Mark Fawcus)
Change-Id: I7b64c37ead60152c8a12556cfa344e225abc1980
2020-08-06 09:28:28 -04:00
Solomon Peachy
658026e626 [4/4] Remove HAVE_LCD_BITMAP, as it's now the only choice.
Note:  I left behind lcd_bitmap in features.txt, because removing it
would require considerable work in the manual and the translations.

Change-Id: Ia8ca7761f610d9332a0d22a7d189775fb15ec88a
2020-07-24 21:20:13 +00:00
Solomon Peachy
8cb555460f [3/4] Completely remove HWCODEC support
'swcodec' is now always set (and recording_swcodec for recording-capable
units) in feature.txt so the manual and language strings don't need to
all be fixed up.

Change-Id: Ib2c9d5d157af8d33653e2d4b4a12881b9aa6ddb0
2020-07-24 21:20:13 +00:00
Solomon Peachy
0c4f89370d [2/4] get rid of HAVE_LCD_CHARCELLS
HAVE_LCD_BITMAP is now redundant.

lcd_bitmap is always-on in features.txt so manual and lang strings
don't have to change

Change-Id: I08eeb20de48099ffc2dc23782711af368c2ec794
2020-07-24 21:20:13 +00:00
Solomon Peachy
092c340a20 [1/4] Remove SH support and all archos targets
This removes all code specific to SH targets

Change-Id: I7980523785d2596e65c06430f4638eec74a06061
2020-07-24 21:20:13 +00:00
Solomon Peachy
2b9c85a41b storage: Clean up storage_xxxx macros when STORAGE_MULTI is not set
Change-Id: I1652eac1743f4b8b84da08ea5a6d04ac7e17e21d
2020-07-16 23:23:25 -04:00
Igor B. Poretsky
30fb53d47f Enabled hotkey for Sansa Clip players
Change-Id: Ic0fb331415bf0cc0fce5916befce64f4a41c46ee
2020-07-14 12:42:16 +00:00
Amaury Pouly
278a76b3a6 add some documentation in usb.h and usb_drv.h
Change-Id: Icd39ee5c017fc219144b33ef96b0df85c5d430da
2020-07-09 14:09:10 +00:00
Solomon Peachy
65a91333ef FS#12082: Add Tuner support to the Nano2G (Bertrik Sikken)
(The serial portions of the patch were already present, this just pulls
 in the tuner enablements)

Change-Id: I8090e318f34835769ac0a56d7a48b9250631eb4f
2020-07-09 13:24:14 +00:00
Solomon Peachy
c0276c8352 yp-r1: Fix some of the simulator build issues.
Change-Id: I167b801acaff9d36f3fd2fa57ba295d05816c60d
2020-07-07 18:34:28 +00:00
Franklin Wei
a65a341a00 button: allow disabling software poweroff
On some devices, the button driver allows a "software poweroff" by long-
pressing a certain key. This behavior is inconvnient when that button needs
to be held down for other purposes, such as moving the cursor in rockpaint
or sgt-untangle.

This patch allows selectively disabling the software poweroff (enabled by
default) from both core and plugin code.

Change-Id: I7580752888ae5c7c7c5eb1be5966e3d67f17d4b4
2020-06-27 13:27:40 -04:00
Solomon Peachy
2434b6ca25 misc: Remove all 'twiki' references in favor of up-to-date 'wiki' links.
(This migration happened over a decade ago!)

Change-Id: Ib396414a16f2d763e549af49e3f3b03047dab49c
2020-06-07 01:38:55 +00:00
Solomon Peachy
ea9ed2f9e8 cowond2: Disable internal NAND storage; use only the SD card.
This allows the player to be usable.

Slightly adapted from:

 https://forums.rockbox.org/index.php/topic,10164.msg245357.html#msg245357

Change-Id: I7bdd681b132cac4c82e3ba6aabe74169645eee4c
2020-05-24 13:37:04 +02:00
Solomon Peachy
683abd77d2 Fix checkwps build for dx50 & dx90 targets
Their codec headers weren't in the right place.

Change-Id: Iae16c10defc937cc227afd8992ff45cd6d664898
2020-04-14 08:15:19 +02:00
Solomon Peachy
a820a98361 obsolete: Nuke the very-incomplete Archos AV300 target
It's even missing a config header file.  Just shoot it in the head.

Change-Id: I4c5cdb4fb63361a4e4fc893e93d73d3890fe17df
2020-04-13 22:06:22 +02:00
Solomon Peachy
2ad6c3438e RTC: Add stub support RTC alarms on hosted targets
No targets are enabled, but the hosted Hiby-based targets could have this
feature enabled if they weren't so buggy:

 * No generic way to determine wakeup reason under Linux
 * No generic way to be asynchronously notified if the alarm is
   triggered when we're already awake
 * Shutting down may clobber RTC wakeup (driver/etc dependent)
 * Rocker's kernel's RTC driver has some 24h clock and timezone-related
   issues.

So, the infrastructure is arguably useful, but the only applicable
hardware I have is pathologically brain-dead.

Change-Id: Ie1aa38e72b831c8a0695ff684f260e514eef9710
2020-04-11 12:07:47 -04:00
Solomon Peachy
6984a7ce15 RTC: Add support RTC alarms on hosted targets
Only AGPTeck Rocker is enabled for now, and it doesn't work properly:

 * No generic way to determine wakeup reason under Linux
 * No generic way to be asynchronously notified if the alarm is
   triggered when we're already awake
 * Shutting down may clobber RTC wakeup (driver/etc dependent)

And finally:

 * AGPTek kernel's RTC driver has some 24h clock and
   some timezone-related issues.

So, the infrastructure is arguably useful, but the only applicable
hardware I have is pathologically brain-dead.

Change-Id: Iac6a26a9b6e4efec5d0b3030b87f456eb23fc01d
2020-04-11 18:02:26 +02:00
Marcin Bukat
180cef835b xDuoo X3II and X20 port
Provided by Roman Stolyarov
Integration, Refactoring, and Upstreaming by Solomon Peachy

X3II confirmed working by forum tester, X20 is nearly identical.

This includes bootloader, main firmware, and the flash image patcher.

Eventual Todo:

 * Further refactor AGPTek Rocker & xduoo hiby bootloaders
 * Further refactor AGPTek Rocker & xduoo hosted platform code

Change-Id: I34a674051d368efcc75d1d18c725971fe46c3eee
2020-04-06 18:15:41 +02:00
Solomon Peachy
a463f68abb checkwps: #undef CONFIG_STORAGE_MULTI for __PCTOOL__ builds
Fixes checkwps build on xDuooX3  (only target that uses it!)

Change-Id: I4dfe095338c938f88a2791351c82f310d0531ad7
2020-04-05 21:17:01 +02:00
Solomon Peachy
6450cbbdca headers: Don't blindly include <inttypes.h> in files used by ASM
Causes things to go boom with newer toolchains.

Change-Id: Ibd00edc9ea16aae8115b63ebce08ac920b0608a2
2020-03-29 00:49:06 +01:00
William Wilgus
1da2708a7c Fix timer Agptek Rocker (other hosted players)
on timer_unregister callbacks are not removed

It seems (at least on the Rocker) timers continue to fire (for a bit??)

Now we store the registered callback in the sigev structure and check
that the callback matches the one registered when the timer is created.

This should stop the possible case of a new timer getting spurious callbacks
We also now NULL the callbacks on un-register which should stop the segfaults

Added some notes to timer.c and timer.h

Change-Id: Ia155c3a4e4af89f474d55ed845560ccc1fab85aa
2019-10-17 21:19:00 +02:00
Solomon Peachy
5b23c9eb0a Introduce HW_SAMPR_MIN_GE_22 macro
Gives us the lowest HW sample rate that's >= 22KHz.

Needed because some targets that don't support 22K support 11K or 8K, so
HW_SAMPR_MIN will give us much lower quality than is acceptable.

Take advantage of this new macro in the SDL, MIDI, and MIKMOD plugins,
and implement a crude "fast enough" test to enable higher sample rates
on more capable targets.

Change-Id: I6ad38026fb3410c62da028e78512e027729bb851
2019-08-08 22:37:30 +02:00
Sebastian Leonhardt
d3a3a41b0f Remove "HAVE_TRANSFLECTIVE_LCD" from iPod 6G config
The screen content is only poorly visible without backlight, it's not
really usable this way.
Removing HAVE_TRANSFLECTIVE_LCD also fixes the "flashing screen"
issue that appeared on some models when "lcd_awake()" is called.

Change-Id: I3ba954c944077a32016820462f782dc27a31f8d8
2019-08-01 23:10:57 +02:00
Solomon Peachy
349e111c81 Revert "cleanup: Remove HAVE_MULTIVOLUME from targets with HAVE_MULTIDRIVE"
This reverts commit a89bf68e88.

HAVE_MULTIVOLUME && HAVE_MULTIDRIVE implicitly means "allow 4 volumes
per drive" whereas the normal MULTIDRIVE behavior is to only allow 1
volume per drive.
2019-07-31 17:22:58 +02:00
Solomon Peachy
a89bf68e88 cleanup: Remove HAVE_MULTIVOLUME from targets with HAVE_MULTIDRIVE
The latter always enables the former.

There are no remaining HAVE_MULTIVOLUME users in-tree.

Change-Id: I0f4fd03a6ffed5c0eb3fb5f916f671bd199f1c8e
2019-07-30 04:32:05 +02:00
Solomon Peachy
bad461a9ce Correct MODEL_NUMBERs used by xDuoo X3, and IHIFI 770, 770C, and 800.
This should correct ROLO operation on all targets.

Change-Id: Icefbf1af83fd756283a0f6c78ba2370fe41f4473
2019-07-29 17:03:26 -04:00
Solomon Peachy
51fe1b6705 volume_ismounted is gated by HAVE_DIRCACHE rather than HAVE_MULTIVOLUME
Should fix the various sim builds.

Change-Id: I1dc5e8228698afb32c84ada2aa916e52e19f49d7
2019-07-28 15:27:04 +02:00
William Wilgus
5f9d1f59d3 Add sound_current to plugin api
Adds:
	sound_current(int setting)
		returns the current sound setting from global_settings
		complements sound_max, sound_min and sound_default

Change-Id: I35bd893753c958f808492906fe533edc51d5d57c
2019-07-25 00:48:40 -05:00
Sebastian Leonhardt
26e0c64e34 Fix red and remove duplicated function declaration
Change-Id: I5fed7fdad077eedfc1e36fbd9e1669f11b90288d
2019-02-08 00:04:20 +01:00
Sebastian Leonhardt
e662ae4e9e Add YH820 current usage for runtime estimation
Change-Id: If50d7e6db3077853dfba438d9765cdb3513f2910
2019-02-07 23:07:19 +01:00
Sebastian Leonhardt
287685932e Fix lcd not waking up when backlight is always off
This patch is relevant for targets with a transflective display.
If the backlight was set to "always off" (e.g. to use the lcd
in a pure passive way), and the sleep timer ran off, the LCD
would stay disabled and didn't wake up when a button is pressed.

Change-Id: I0a157c7f421d9fc4c7d8ba903f2cf93f6cef51d0
2019-02-07 22:10:52 +01:00
Sebastian Leonhardt
03e63da316 YH820: implement LCD sleep
use sleep setting to keep transflective LCD active without backlight

Change-Id: Iccd97e956d5e4a2a22abc90d15e9123782126ecb
2019-02-07 20:04:19 +01:00
Solomon Peachy
d24edc605b Add HAVE_LINEOUT_DETECTION and associated logic
This allows targets to automatically switch audio settings when the
line out is plugged/unplugged.

Only hooked up on the xDuoo X3, but there are other potential users.

Change-Id: Ic46a329bc955cca2e2ad0335ca16295eab24ad59
2019-01-04 23:52:42 +01:00
Solomon Peachy
d4942cc74c Add Xuelin iHIFI 770/770C/800 support
Taken from the xvortex fork (Roman Stolyarov)
Ported, rebased, and cleaned up by myself.

Change-Id: I7b2bca2d29502f2e4544e42f3d122786dd4b7978
2019-01-02 08:10:01 -05:00
Solomon Peachy
7e7ca0c858 Fix Xduoo X3 bootloader build, and silence all warnings.
Also enable USB bootloader mode

Change-Id: I73224c2e694b9941993c89a114b48d2a907e0dfb
2019-01-02 05:01:50 +01:00
Solomon Peachy
9b3f22ac3a FS#7814 - Enable RTC Alarms on H300, X5, and M5
Original patch by Alexander Spyridakis
Modified by Steve Bavin and Igor Poretsky
Keymap fixes by Marianne Arnold

Change-Id: I5a252d97d2b05c533e048931f7354f4261f76499
2018-12-25 08:51:33 -05:00
William Wilgus
a06d9c85f7 Auto-Ranging Time Formatting For Menus (hh:mm:ss:mss)
Unifies time formatting in settings_list.c allows time format to
display as HH:MM:SS.MSS or any consecutive combination thereof
(hh:mm:ss, mm:ss, mm:ss.mss, ss.mss, hh, mm, ss ,mss)
works in INT and TABLE settings with the addition of flag 'F_TIME_SETTING'

Time is auto-ranged dependent on value

Adds talk_time_intervals to allow time values to be spoken similar to
display format:  x Hours, x Minutes, x Seconds, x Milliseconds

Table lookups merged or removed from recording, clip meter and lcd timeout
-String_Choice replaced with TABLE_SETTING or INT_SETTING for these
functions as well, cleaned-up cfg_vals that get saved to cfgfile

RTL Languages ARE supported

Negative values ARE supported

Backlight on/off are now Always and Never to share formatter with LCD
Timeout

Added flag to allow ranged units to be locked to a minimum index

Added flag to allow leading zero to be supressed from the largest unit

merged talk_time_unit() and talk_time_intervals()

optimized time_split()

optimized format_time_auto()

Backlight time-out list same as original

Change-Id: I59027c62d3f2956bd16fdcc1a48b2ac32c084abd
2018-12-22 12:27:21 -06:00
Marcin Bukat
4e8ef17a8b More keymap refinements
Change-Id: If3ae6ece7848b143088d5f9ec8c00ed593d59ed2
2018-12-06 15:15:26 +01:00
Solomon Peachy
74dd276fe1 debug: Wrap rb_backtrace with HAVE_RB_BACKTRACE instead of CPU_ARM
Basically, preparation for a non-ARM backtrace support.

Change-Id: Icfd09fbc65a98f859e2a19f8d1111827a262a969
2018-11-09 02:32:39 +01: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
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
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
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
ff7d2bdee1 Fix lcd-scroll.c truncation warnings
Change-Id: I312ec7ad06fde5b2f9747661cd2d4ffcb4cbf755
2018-07-25 20:53:17 +02:00
Marcin Bukat
5c015ada90 Agptek Rocker: Implement lcd_enable()
In theory this should slightly improve battery life.

Change-Id: Iaf55beb7dbc20e7562017958aeb0386459d49a31
2018-06-14 10:03:07 +02:00
Marcin Bukat
f2075a5709 Add XRGB8888 native format
This got lost somehow during Agptek port merge

Change-Id: Ie84463ba523d2307466b49354867117e7393a440
2018-06-12 13:25:12 +02:00
Marcin Bukat
fbaa97496f Agptek Rocker: Implement RTC support
Add define in config file to enable RTC support in rockbox,
Fix time_menu.c to include radio.h only when tuner is present
Implement time setting function on linux (was empty stub)

Not tested.

Change-Id: I40e6c4a6c1b66ada9cf4e698e502e221d0fc44df
2018-06-12 10:31:15 +02:00
Marcin Bukat
937589ca3a Agptek Rocker: Add bass, treble and balance controls
Change-Id: Ib84620850bbdc81afbdfff1610a0be7eab4f0ac0
2018-06-12 10:31:15 +02:00
Marcin Bukat
7692558674 Agptek Rocker: Implement USB mass storage driver
Agptek uses composite android driver.

Change-Id: Iece188ad640f3dfd24c171946c14da4c3516b6d5
2018-06-12 10:31:15 +02:00
Marcin Bukat
0538ba3d59 Agptek Rocker: Restrict root directory to SD only
Actual / of underlying linux OS should not be available to user.
I am still not sure if implementation is correct. It doesn't
perform any relative path sandboxing for example.

Change-Id: Ic577a10f3947f6e950e2c4d03173f9f207395eb7
2018-06-12 10:31:15 +02:00
Marcin Bukat
d55680993d Agptek Rocker: Initial commit
Change-Id: I26b51106c7b1c36a603fba6d521e917d79b5a95b
2018-06-12 10:31:14 +02:00
Franklin Wei
a855d62025 Port of Duke Nukem 3D
This ports Fabien Sanglard's Chocolate Duke to run on a version of SDL
for Rockbox.

Change-Id: I8f2c4c78af19de10c1633ed7bb7a997b43256dd9
2017-12-23 21:01:26 -05:00
Michael Sevakis
c8564f1ca8 Get voice event out of playback.c
Purpose: A step in removing all voice references from playback code
and prelude to other changes.

Change-Id: Ic3ad7f7a33b979693e18a3456ced37eb1d2281a4
2017-12-12 20:28:56 -05:00
Michael Sevakis
c1a01beded Playback: Move internal track list onto buffer
Does away the statically-allocated track list which frees quite
a fair amount of in-RAM size.

There's no compile-time hard track limit.

Recommended TODO (but not right away): Have data small enough use
the handle structure as its buffer data area. Almost the entire
handle structure is unused for simple allocations without any
associated filesystem path.

Change-Id: I74a4561e5a837e049811ac421722ec00dadc0d50
2017-12-09 17:05:59 -05:00
Michael Sevakis
f4c4221306 Convert i.MX31 and AMS target to use RTC interrupt
Instead of checking ticks, set a sticky dirty flag that indicates
that the RTC needs to be read. This gives a timely update and more
accurate readout without actually reading the RTC until it changes.
The implementation should atomically read the flag and clear it.
Setting the flag would typically happen in an RTC tick ISR.

Change-Id: I6fd325f22845029a485c502c884812d3676026ea
2017-11-21 07:52:02 -05:00
Amaury Pouly
0fe7b8becf nwzlinux: add support for radio
None of the Sony up to A15 seem to support RDS (they use either Si4702 or Si4708),
thus I did not add any code to support RDS.

Change-Id: I64838993b9705b36b94665f8470c7a89c772c961
2017-11-06 21:37:06 +01:00
Michael Sevakis
f728559bf9 Make atomic bit modification functions return previous value.
Change-Id: I19a94cf946735e1d9e51c3207cd82198fd4dfc1a
2017-10-30 21:43:15 -04:00
William Wilgus
e9de9c1452 Add boot from other volumes in bootloader on targets with HAVE_MULTIVOLUME
Adds the ability to load firmware from other drives on MULTIVOLUME targets
Mihail Zenkov <mihail.zenkov@gmail.com> had posted a hard coded patch
to allow this on several Sansa players, I made it more universal

Redirect file rockbox_main.<name> should placed in root of
drive you would like to be main, if this file empty or there a single
slash '/' firmware will be loaded from /.rockbox in root of this drive
If instead a /<*DIRECTORY*> is supplied in rockbox_main.<name> then
firmware will be loaded from /<dir>/.rockbox/

NOTES*

The directory can have multiple levels however..
leading slash MUST be included
trailing slash can be omitted
(eg. /test/.rockbox would be simply '/test' in the redirect file)

Redirect file will not work on internal drive (whatever is default boot drive)

Volume with the highest index containing redirect file will be loaded
first.

Firmware file is checked for boot data region, if missing, firmware
image will not be loaded.

On failure or if no redirect file is found load will fallback to
internal drive

Currently only Sansa Fuze+, Sansa Clip+,
Sansa Clip Zip, Sansa Fuzev2, and Sansa Fuzev1 are implemented.

Players (with HAVE_MULTIVOLUME)
will need #define HAVE_BOOTDATA and #define BOOT_REDIR "rockbox_main.<name>"
added to their config file

boot_data is implemented in crt0.s file (See g#1552)
ARM and IMX233 have aleady been implemented

Once these conditions are met <HAVE_MULTIBOOT> will be defined by config.h

Partitions on the drives are able to have a redirect as
well.

Change-Id: Iada3263919f6bcad7d0d7d8279b4239aafa07ee9
2017-10-29 17:53:04 +01:00
William Wilgus
efb71ed0ce Add boot data to MOST AS3525 Devices
Adds boot data to as3525 devices Sansa C200v2 E200v2 Clip Clipv2 Clip+ ClipZip
fuze, fuzev2 m200v4

Adds boot_data to features.txt

default arm crt0.s now had boot data if HAVE_BOOTDATA is defined

Change-Id: I614a556696540511a69fc12a4520b01c268bf8a9
2017-10-29 17:52:40 +01:00
William Wilgus
41869a6534 Add boot data support to rockbox.
Bootdata is a special location in the Firmware marked by a magic header
The bootloader is able to copy information to the firmware by locating
this struct and passing data to the firmware when it is loaded but
before it is actually executed

Data is verified by a crc of the bootdata


Change-Id: Ib3d78cc0c3a9d47d6fe73be4747a11b7ad6f0a9e
2017-10-29 17:50:59 +01:00
Michael Sevakis
e4a46c8d88 Fix a few missed things in 16454efc (and hopefully clear the red).
Change-Id: I2ce88e4c41e6e08efbfbdf261122318dfb0f8b0f
2017-10-26 16:32:53 -04:00
Michael Sevakis
1654efc313 Unify storage threads into one
* Editing a bunch of drivers' thread routines in order to
implement a new feature is tedious.

* No matter the number of storage drivers, they share one thread.
No extra threads needed for CONFIG_STORAGE_MULTI.

* Each has an event callback called by the storage thread.

* A default callback is provided to fake sleeping in order to
trigger idle callbacks. It could also do other default processing.
Changes to it will be part of driver code without editing each
one.

* Drivers may sleep and wake as they please as long as they give
a low pulse on their storage bit to ask to go into sleep mode.
Idle callback is called on its behalf and driver immediately put
into sleep mode.

* Drivers may indicate they are to continue receiving events in
USB mode, otherwise they receve nothing until disconnect (they
do receive SYS_USB_DISCONNECTED no matter what).

* Rework a few things to keep the callback implementation sane
and maintainable. ata.c was dreadful with all those bools; make
it a state machine and easier to follow. Remove last_user_activity;
it has no purpose that isn't served by keeping the disk active
through last_disk_activity instead.

* Even-out stack sizes partly because of a lack of a decent place
to define them by driver or SoC or whatever; it doesn't seem too
critical to do that anyway. Many are simply too large while at
least one isn't really adequate. They may be individually
overridden if necessary (figure out where). The thread uses the
greatest size demanded. Newer file code is much more frugal with
stack space. I barely see use crack 50% after idle callbacks
(usually mid-40s). Card insert/eject doesn't demand much.

* No forcing of idle callbacks. If it isn't necessary for one or
more non-disk storage types, it really isn't any more necessary for
disk storage. Besides, it makes the whole thing easier to implement.

Change-Id: Id30c284d82a8af66e47f2cfe104c52cbd8aa7215
2017-10-26 14:35:41 -04:00
Amaury Pouly
afbae177a1 sonynwz: add api and debug entries for "acoustic" and "cue/rev" mode
We don't really know what those are supposed to do. They seem to change the
volume curve but it is not very clear what is the intended purpose.

Change-Id: I65f5d18aba139844c23df092277ba17ee8518f96
2017-10-07 22:01:00 +02:00
Amaury Pouly
a82ebac53a sonynwza10/a20: enable pcm frequency selection
Change-Id: I335fcdbb652253e777d0d7406545d0d44d98f4f0
2017-10-01 17:23:43 +02:00
Amaury Pouly
50e93d5687 sonynwzlinux: enable software tone controls
As far as I know, they are not supported by the hardware

Change-Id: I71be60ef5461fc9fea151cc9ae9de385b8e08eda
2017-10-01 16:14:29 +02:00
Michael Sevakis
af8d719bfe Remove STORAGE_NEEDS_ALIGN from config headers
It's no longer required or used in the file code.

Change-Id: I11c1bc166c91b99addca8c8d151c5eaace7a61c3
2017-09-20 09:44:04 -04:00
Amaury Pouly
127e6bbfdd Add support for the NWZ-E350
Strangely it has the SAME encryption key as the E450. Either they didn't bother
changing it or more likely they have exactly the same internals and a slightly
different case.

Change-Id: I39ab88845b3e40db34160c2e61dde421f391df44
2017-09-17 23:47:49 +02:00
Amaury Pouly
91d3c8e459 Add support for the Sony NWZ-S750
Change-Id: I9050129949809b3dbe9f4f9e816f8980c4f3a904
2017-09-17 14:35:58 +02:00
Amaury Pouly
a0fca0c7bf Add simulator support for the A860
This requires a few changes unrelated to the A860 because configure unsets
APPLICATION but the NWZ is an application!

Change-Id: Id91aa23193383ac95886b281653da5286edd9caf
2017-09-17 00:03:45 +02:00
Amaury Pouly
ac57f96838 Add support for the NWZ-A860
Change-Id: Ibf0c5168ac31d4ba2aeaa86cbeca37a1011b75fa
2017-09-17 00:03:02 +02:00
Johannes Rauh
3a5ae7dd3a Add support for Sony NW-A20
Add original author to CREDITS

Change-Id: I7a0159635c7896e2b5521c078ef62618f568d89e
2017-09-06 17:16:55 +02:00
Amaury Pouly
1d121e8c08 Initial commit for the Sony NWZ linux port
SUPPORTED SERIES:
- NWZ-E450
- NWZ-E460
- NWZ-E470
- NWZ-E580
- NWZ-A10

NOTES:
- bootloader makefile convert an extra font to be installed alongside the bootloader
  since sysfont is way too small
- the toolsicon bitmap comes from the Oxygen iconset
- touchscreen driver is untested

TODO:
- implement audio routing driver (pcm is handled by pcm-alsa)
- fix playback: it crashes on illegal instruction in DEBUG builds
- find out why the browser starts at / instead of /contents
- implement radio support
- implement return to OF for usb handling
- calibrate battery curve (NB: of can report a battery level on a 0-5 scale but
  probabl don't want to use that ?)
- implement simulator build (we need a nice image of the player)
- figure out if we can detect jack removal

POTENTIAL TODOS:
- try to build a usb serial gadget and gdbserver

Change-Id: Ic77d71e0651355d47cc4e423a40fb64a60c69a80
2017-09-05 21:42:12 +02:00
Amaury Pouly
5dd443c033 Fix YP-Z5 plugin/codec buffer size
Change-Id: I8d01497c561bc3420b2b87ced2d7ab241b796a97
2017-05-16 12:14:17 +10:00
Amaury Pouly
6e69e3adaa zenxfi3,fuzeplus: disable AB repeat (not enough keys)
zenxki3: disable hotkey (not enough keys)

Change-Id: I294f622e994709dcab27462673792adeb48e7118
2017-05-16 12:10:28 +10:00
Michael Sevakis
eefc7c73e2 Fix some problems with playback crashing
I'm not sure all the situations it affects, to be honest. The fix
aimed to address the strange symptom here:
http://forums.rockbox.org/index.php/topic,50793.0.html

It turns out that ringbuf_add_cross was used when handles were
butted up against one another with the first parameter equal to
the last, which it interprets as being an empty case when it should
be interpreted as full in the context it was used. To fix this,
introduce full/empty variants of ringbuf_add_cross and ringbuf_sub
and use them at the appropriate time.

The other way to address the problem is ensure there's always at
least a space byte between the end of one handle and the start of
another but this make the code a bit trickier to reason about than
using additional function variants.

bufopen() may yield after creating a handle and so do some more
locking so that the buffering thread doesn't mess things up by
moving anything or not seeing the yet-to-be linked-in allocation.

Add alignof() macro to use proper method to get alignment of
struct memory_handle. That should be useful in general anyway.
It's merely defined as __alignof__ but looks nicer.

Change-Id: If21739eaa33a4f6c084a28ee5b3c8fceecfd87ce
2017-04-08 18:32:54 -04:00
Michael Sevakis
6db80020b4 Do some housekeeping with fat.h and SECTOR_SIZE
Many includes of fat.h are pointless. Some includes are just for
SECTOR_SIZE. Add a file 'firmware/include/fs_defines.h' for that
and to define tuneable values that were scattered amongst various
headers.

Remove some local definitions of SECTOR_SIZE since they have to be
in agreement with the rest of the fs code anyway.

(We'll see what's in fact pointless in a moment ;)

Change-Id: I9ba183bf58bd87f5c45eba7bd675c7e2c1c18ed5
2017-03-12 22:05:44 -04:00
Michael Sevakis
fc9695eb47 Improve radio RDS driver and framework
* Remove unused bits like the radio event and simplify basic
radio interface. It can be more self-contained with rds.h only
required by radio and tuner code.

* Add post-processing to text a-la Silicon Labs AN243. The chip's
error correction can only do so much; additional checks are highly
recommended. Simply testing for two identical messages in a row
is extremely effective and I've never seen corrupted text since
doing that, even with mediocre reception.

Groups segments must arrive in order, not randomly; logic change
only accepts them in order, starting at 0.

Time readout was made a bit better but really we'd need to use
verbose mode and ensure that no errors were seen during receiving
of time and more checks would be need to have a stable PI. The
text is the important bit anyway.

* Time out of stale text.

* Text is no longer updated until a complete group has been
received, as is specified in the standard. Perhaps go back to
scrolling text lines in the radio screen?

* Add proper character conversion to UTF-8. Only the default G0
table for the moment. The other two could be added in.

* Add variants "RDS_CFG_PROCESS" and "RDS_CFG_PUSH" to allow
the option for processed RDS data to be pushed to the driver and
still do proper post-processing (only text conversion for now for
the latter).

Change-Id: I4d83f8b2e89a209a5096d15ec266477318c66925
2017-02-11 22:19:32 -05:00
Cástor Muñoz
882921efb6 ipod6g: bootloader v1
- dual boot
- USB mode
- battery trap

Change-Id: I8586cfeb21ee63f45ab965430725225fdfc4212d
2017-02-09 20:47:16 +01:00
Amaury Pouly
1245c5fe61 Implement speaker enable/disable on jack (un)plug
The implementation is not very complicated but there are a few things worth
noting. There was a previous "speaker enable" setting but it was a boolean.
I decided to replace it with a choice setting that has 2 options (on, off)
if headphones cannot be detect on this target, or 3 options (on, off, auto)
if we can detect headphones. This will break the old setting on target that
cannot detect jack but it makes the code more uniform and avoid maintaining
two settings with more #ifdef. The third option (auto) uses the LANG_AUTO
text, which I think is clear enough (disable speaker on jack plug).
In order to avoid code duplication (both in apps and firmware), I decided to
keep the audiohw_enable_speaker function as-is: it takes a boolean and doesn't
care about the speaker policy. I introduced a new audio_enable_speaker that
takes directly the mode (which follows the setting encoding): 0=off, 1=on
and 2=auto. This way one calls audio_enable_speaker and it changes the speaker
once to reflect the request mode. The apps code then uses this function in the
places where it makes sense: on setting load, setting change and jack (un)plug
event.

Change-Id: I027873f698eb4bc365d7c02b515297806355d9e2
2017-02-04 17:22:08 +01:00
Michael Sevakis
2220a4b695 Improve imx31 interrupt code for PMIC and GPIO
Fix stuff that was bugging me about the way I did it at first.

While messing around I found RDS code wasn't masking its GPIO
ISR as it should, which might lead to two different interrupts
messing with the static data.

Change-Id: I54626809ea3039a842af0cc9e3e42853326c4193
2017-01-29 19:07:55 -05:00
Michael Sevakis
783c77531c AMS: Return ascodec to interrupt-based I2C2 driver
1. Slightly revised and regularized internal interface. Callback is used
for read and write to provide completion signal instead of having two
mechanisms.

2. Lower overhead for asynchronous or alterate completion callbacks. We
now only init what is required by the transfer. A couple unneeded
structure members were also nixed.

3. Fixes a bug that would neglect a semaphore wait if pumping the I2C
interrupts in a loop when not in thread state or interrupts are masked.

4. Corrects broken initialization order by defining KDEV_INIT, which
makes kernel_init() call kernel_device_init() to initialize additional
devices _after_ the kernel, threading and synchronization objects are
safe to use.

5. Locking set_cpu_frequency has to be done at the highest level in
system.c to ensure the boost counter and the frequency are both set in
agreement. Reconcile the locking inteface between PP and AMS (the only
two currently using locking there) to keep it clean.

Now works fine with voltages in GIT HEAD on my Fuze v2, type 0.
Previously, everything crashed and died instantly. action.c calling
set_cpu_frequency from a tick was part of it. The rest may have been
related to 3. and 4. Honestly, I'm not certain!

Testing by Mihail Zenkov indicates it solves our problems. This will
get the developer builds running again after the kernel assert code
push.

Change-Id: Ie245994fb3e318dd5ef48e383ce61fdd977224d4
2017-01-25 00:05:13 +01:00
Michael Sevakis
28bf763373 Fix warnings - got to (void) the statement
Change-Id: I85ed5071cbf8e309d06ec14159d6581cf876eb35
2017-01-21 14:55:13 -05:00
Michael Sevakis
3e73866110 Add CPU mode asserts to kernel on blocking functions.
This scourge finds it's way back in far too often.
Right now, only defined for ARM.

Have fun!

Change-Id: Ib21be09ebf71dec10dc652a7a664779251f49644
2017-01-21 14:25:52 -05:00
Michael Sevakis
c6299b268d action.c must desist in calling set_cpu_frequency from a tick
The function is neither reentrant nor ISR callable. Instead of
using a ticked-based timeout, have the button driver provide the
unboost after a delay when waiting for a button.

HAVE_GUI_BOOST gets immediate boost after dequeuing any message,
otherwise the queue has to have at least three messages waiting
for it to trigger a boost-- essentially the behavior that existed
but now combined in one place.

Change-Id: I1d924702840f56a1a65abe41fa92b4e753c4e75a
2017-01-21 12:03:23 -05:00
William Wilgus
dc87e9e9f3 Selective Backlight/Advanced Softlock - Selective actions based on context
Selective backlight allows the user to choose actions that will not
enable the backlight when pressed.

Advanced softlock allows user to choose actions that  will not be
blocked by screenlock on devices without a hold button.

Both only occur in FM and WPS Contexts.

Update:
Back from the dead
-Cleaned up code, removed unnecessary calls, re-arranged last filter action
  timeout conditional to work in case last_filtered_action_tick was never set
-Added entries to the manual
-Fixed back button on some menus not activating backlight
-Made menus more intuitive, no actions selected now changes menu item to off.
-Added talk fuctionality.
-Added option to disable selective backlight while on external power.
-Rewrote backlight and softlock handling code to fix issue with scrollwheels
-Menu changed to have toggle(yes/no) and settings
-Optimized selective actions lookup
-Added option to disable notification of 'buttons locked' while softlocked
-Removed uneeded code, consolidated action lookup to single function
-Fixed incorrect name on selective softlock menu
-Added option to disable touch on touchscreen devices
-Fixed backlight on original screenlock without selective screenlock active
-Added text selection in mask_select for when show_icons is off
-Fixed voice in mask_select to speak if voice is defined instead of spelling
-Added more lang defines (play skip seek)
-Added option to disable unknown keys turning on backlight
-Fixed Conditional argument In wrong place causing players without
	backlight to fail to build
-Fixed Disable Unknown blocking detection of context change
-Fixed canceling menu didn't update new settings
-Added Autolock on backlight off
-Removed backlight_on_force from backlight.c, Now sets ignore next to false
	and uses backlight_on
-Cleaned up autolock code added strings to lang file
-Fixed issue where rapid presses would bypass softlock
-Removed old softlock code, Cleaned selective actions code
-Changed menu to match existing RB menus
-Fixed Backlight_on_Hold blocked by backlight_ignore_next
-Fixed ignore_next for ipod
-Fixed bug allowing context with softlock to bypass selective backlight
-Changed mask_select to no longer prompt for changes to be saved
-Changed menu names
-Added ignore timeout to allow ipod scroll wheel to work properly and other
 players to still work properly, removed some previous code including
 ignore_event
-Increased ignore timeout to prevent sd card accesses from interrupting action
 code and turning on backlight
-Changed Unknown action to unmapped action in menu, changed handling code
-Removed unneeded logic and variables for handling unfiltered actions
-Reverted unmapped action code to previous functionality
-Added manual entries (thanks JohnB)
-Removed elusive unhandled unicode character from manual, changed formatting slightly

Actions:
Volume,Play,Seek,Skip

Extras:
Disable unmapped actions
Disable selective backlight on external power
Disable touch during softlock on touchscreen devices
Disable softlock notifications (power button still notifies)
Autolock on backlight off

Method:
Adds a function to ignore backlight on next call
 If selected action occurs backlight is forced on,
 Filter_first_keypress stays intact.

Selective softlock allows selected actions through, bypasses the normal
 softlock routine.

ToDo:
DONE

previous commit (#1) has attribution for folder_select.c which mask_select
is based from.

Change-Id: I08132ddcfd64c81751ef23b720f3ec6d68695fe4
2017-01-17 23:06:17 +01:00
Michael Sevakis
16a9f84571 Reenable database ramcache and playlist dircache
Playlist dircache references should be back in working order.

Reenabling dircache references in the database ramcache is not
yet done as it requires quite a bit of rework. Otherwise, the
database in RAM is functional again.

Some buffer compatibility changes have been made for database
commit because the dircache buffer can no longer be stolen, only
freed by an API call.

Change-Id: Ib57c3e98cb23e798d4439e9da7ebd73826e733a4
2017-01-17 15:27:47 -05:00
Michael Sevakis
a931c76b3a Do some debug and preparatory work for ramcache and playlist
The file system rework introduced incompatibility between dircache
and the tagcache ramcache and playlist dircache path caching. This
update makes changes to filesystem code to reintegrate all that.

It also fixes a couple bugs that were found when vetting all the
code. The filestream cache was being reset without regard to
the stream even if it was shared in write mode (made work of
.playlist_control). Better handling of unmounting gives files a
better go at force-closing them without risk to disk integrity.

Did some miscellaneous pedantic changes. Improved efficiency of
testing a file's existence (a little) since the path parser will
be shared between file code and parsing for the sake of finding
dircache references, not duplicated as before.

This commit doesn't reenable said items just for the sake of
keeping changes separate and related.

Plan for the next is to enable dircache again for the playlists
(easy peasy) and reenable tagcache ramcache but *without* the
dircache path caching because it's rather substantial to change
in itself. The ramcache will still function without dircache.

Change-Id: I7e2a9910b866251fa8333e1275f72fcfc8425d2d
2017-01-17 14:35:36 -05:00
Michael Sevakis
5c6ccb43b5 Fix track formatting problems in playlist.c
Some changes in behavior were made with filesystem code commit
for the sake of compatibility that changed expected behavior.

* Restore substitution of drive spec in fully-qualified DOS paths
with the playlists's volume spec (or root on univolume targets).
Drive-relative paths of the form "c:foo" (no separator after
':') will be treated as purely relative.

* Restore old behavior of preserving leading whitespace in the
source path and trimming only trailing tabs and spaces.

* Multivolume: Volume substition on fully-qualified UNIX/RB paths
has NOT been reintroduced (and perhaps wasn't intended in the
first place). They will not be modified because there is no
ambiguity to resolve. Doing so would prevent a playlist on
external storage from referencing a file on main storage without
qualifying it with "/<0>...".

* Plain relative paths are and always have been interpreted as
relative to the location of the playlist.

Change-Id: Ic0800cea79c59563b7bac20f8b08abb5051906c7
2017-01-07 19:10:02 -05:00
Amaury Pouly
622088c940 zenxfistyle: enable dualboot stub api
The ZEN X-Fi Style doesn't have an updater like the other stmp targets but at
least the stub enables rebooting to the OF.

Change-Id: I630653a37b94b77210ffdd0d30e1748b13eca96a
2016-12-19 18:32:51 +01:00
Amaury Pouly
89e6189dcb uda1380: document audiohw setting based on uda1380.c
Change-Id: Ia799e47249b4b0008bfe8e633c61548a667b9288
2016-12-12 13:14:22 +01:00
Amaury Pouly
4304d47d3b tlv320: document audiohw setting based on tlv320.c
Change-Id: I7cf354cb948444595ca541a4bf70dfbcf01147f2
2016-12-12 13:13:52 +01:00
Amaury Pouly
4d526df7ac wm8975: document audiohw settings
Change-Id: I0456f85e4ebc821c23e25026fbee3d8cf7526ee7
2016-12-12 13:13:13 +01:00
Amaury Pouly
69ea311398 wm8758: document and fix audiohw settings
It looks like a copy and paste error to me, those were completely wrong.

Change-Id: Id6ae025f4216ffccb1a8b8b790916d8b6c4694bd
2016-12-12 13:12:47 +01:00
Amaury Pouly
90a32ccad6 wm8751: document and fix audiohw settings
Document 3D depth range. Fix mismatch in recording volume: the displayed volume
is completely off the chart

Change-Id: I4c363f369e5d72f332391a6f96457b4e450404f9
2016-12-12 13:12:15 +01:00
Amaury Pouly
cc031d41ab wm8731: document audiohw settings
Change-Id: I78ec26a00a3e14a95c591ac81d96e1b480b9138e
2016-12-12 13:11:25 +01:00
Amaury Pouly
b55adf1ca2 as3514: document hardware setting based on as3514.c
Change-Id: Ifc3c4cf75f7091da0b4c4ce5b0c291b373cf9a3a
2016-12-12 13:10:52 +01:00
Amaury Pouly
af81cc4a93 imx233: slightly rework 3D audio setting
The old code made the setting appear as 0dB, 1.5dB, 3dB and 4.5dB when
in fact it is 0dB, 3dB, 4.5dB and 6dB. This commit clarifies the code and
also fix this at the same time. This imx233 3D enhancement is complete crap anyway
but now you can satisfy yourself with 6 dB of pure crap, clearly an enhancement.

Change-Id: Ia3e088987c1ff0cdde228905ff70f46476a499a2
2016-12-12 12:15:24 +01:00
Amaury Pouly
bfd3b08312 Document AUDIOHW_SETTING
Everytime I use it, I get highly confused because it's complicated and
undocumented. The code is spread all over the place and some targets clearly
use incorrect values. This is the first step of a series to cleanup audio settings
and document it properly.

Change-Id: I20cb7af2bfa33986cb8b0bf8573f17a92227f893
2016-12-12 12:15:07 +01:00
Amaury Pouly
9aeb6f48b8 Make it clear that the NWZ-E370 port also handles NWZ-E380
Change-Id: Icc061f15f4cac3d8bd9f95ea3b583556a9402f0b
2016-12-12 12:06:29 +01:00
Amaury Pouly
a983859291 imx233: add capability to boot OF or updater instead of Rockbox
This commit adds the necessary code in the dualboot stub (bootloader) to
let rockbox control the boot process. In particular, rockbox can now choose
if the next boot will be normal (boot rockbox or OF on magic key), to OF
or to updater.

The intents (to be added in follow-up commits) are:
1) Let the user more easily reboot to the OF. On some targets it is not trivial,
especially in USB mode.
2) Automatically reboot to updater when the user drop firmware.sb at the root
of the drive (currently, the user needs to do that in OF USB mode)
3) Document this OF magic

Change-Id: I86df651dec048c318c6a22de74abb8c6b41aa9ad
2016-12-12 12:03:08 +01:00
Szymon Dziok
68d192e722 SA9200: Remove duplicated and misleading define.
Change-Id: I51f61349de8c32eeb70ca1812e7b34823f482f18
2016-10-02 23:42:13 +02:00
Amaury Pouly
09bdb5132f Fix two typos in comments
Change-Id: I39e42c5e4505e78711e30f8826b6760419434ca0
2016-08-22 23:37:57 +01:00
Cástor Muñoz
6a1644c52a as3525v2: use the new USB DesignWare driver
Targets: sansaclipplus, samsaclipv2, sansaclipzip, sansafuzev2.

Change-Id: I7773528a4e26707dd33fe9cb8948750d49570701
2016-08-15 02:56:23 +02:00
Cástor Muñoz
578525b463 iPod Classic: rework on I2C driver
- Some rewrite with the intent to get ride of these random errors
  appearing on some builds/devices (not much noticeable on RB but
  can ruin bootloader builds).
- Error handling (ACK).
- IIC clock increased to be the same as in OF.

Change-Id: Idf8cfa3c230a0a61ec9c879bf6f0ea8b061a4607
2016-08-12 14:17:46 +02:00
Cástor Muñoz
adbd2969e6 iPod Classic: ADC updates
Add code to read USB D+/D- and accessory ADCs, it is shown in HW
debug menu, might be useful in future for RB and/or the bootloader
to identify external USB chargers.

Change-Id: Ia48ca5e06bb7ddc52bb55abedde6734653ce8dba
2016-08-12 14:17:46 +02:00
Cástor Muñoz
ef572fec52 iPod Nano 2G: use the new USB DesignWare driver
Change-Id: I8d1561bf4e239b55617a8d5075457a668e0c312c
2016-08-02 04:57:50 +02:00
Cástor Muñoz
3c5aa754de iPod Classic: use the new USB DesignWare driver
Change-Id: I36aabb5cb9cfe2d8c4f8fbcea944efec58ef9671
2016-08-02 04:57:50 +02:00
Cástor Muñoz
5e305d35c9 Introduce new USB driver for Synopsys DesignWare USB OTG core.
Based on g#844 and g#949, it is intended as a replacement for the
current s3c6400x USB driver.

The DesignWare USB OTG core is integrated into many SoC's, however
HW core version and capabilities (mainly DMA mode, Tx FIFO mode,
FIFO size and number of available IN/OUT endpoins) may differ:

CPU       targets        HW ver  DMA  NPTX FIFO  FIFO sz  #IN/OUT
--------  -------------  ------  ---  ---------  -------  -------
as3525v2  sansaclipplus  2.60a   Yes  Dedicated  0x535    4/4
          sansaclipv2
          sansaclipzip
          sansafuzev2
s5l8701   ipodnano2g     2.20a   Yes  Shared     0x500    4/5
s5l8702   ipod6g         2.60a   Yes  Dedicated  0x820    7/7
          ipodnano3g
s5l8720   ipodnano4g     ?       ?    ?          ?        ?

Functionality supported by this driver:
- Device mode, compatible with USB 1.1/2.0 hosts.
- Shared FIFO (USB_DW_SHARED_FIFO) or dedicated FIFOs.
- No DMA (USB_DW_ARCH_SLAVE) or internal DMA mode.
- Concurrent transfers: control, bulk (usb_storage, usb_serial) and
  interrupt (usb_hid).

Actually this driver is not used by any CPU, it will be enabled for
each individual CPU/target in next patches.

Change-Id: I74a1e836d18927a31f6977d71115fb442477dd5f
2016-08-02 04:57:49 +02:00
Amaury Pouly
d42a4a4eb4 zenxfi3: rewrite mpr121 driver
The new driver uses an asynchronous architecture for touch status reading.

Change-Id: Ic75a8b91bc47ee16c3af873afde178cd70186376
2016-06-01 23:09:27 +02:00
Amaury Pouly
b2afd931e2 fuze+: rewrite touchpad driver
The old driver was bad in many respect, it had some race conditions, it was
using a thread to serialize transfers because of the legacy i2c interface.
It also had huge latency (typically 50ms but delays up to 300ms can happen),
thus some presses were missed.
The new driver takes advantage of the new i2c driver to do everything
asynchronously. It also does not need a thread anymore because queueing
ensures proper serialization. It provides much better and reliable latency
(typically ~2ms).
Also fix the debug screen which was horribly broken. The new screen also
displays the deadzones.

Change-Id: I69b7f99b75053e6b1d3d56beb4453c004fd2076e
2016-06-01 23:08:17 +02:00
Cástor Muñoz
9e284c11b1 iPod Classic: i2c updates
Change-Id: Ib516f3f52cf619fb44dc1bb6982b635c49f53a8f
2016-05-26 09:06:30 +02:00
Cástor Muñoz
2d850b7c66 iPod Classic: define USB_STATUS_BY_EVENT and USB_DETECT_BY_REQUEST
Change-Id: I333fe779d8977bf58a579561466ef8872aa4e228
2016-05-26 09:06:30 +02:00
Cástor Muñoz
98bd2231ec iPod Classic: introduce PMU interrupts
PMU interrupts are used to detect USB Vbus, wall adaptor, accessories
and holdswitch. A thread is needed to poll the PMU throught I2C, ATM
it does nothing but showing the state of the inputs on the HW debug
menu, funcionallity for each individual input will be added in next
patches.

Change-Id: If93bf2044d1052729237a7fd1431c8493e09f1c7
2016-05-25 12:45:34 +02:00
Cástor Muñoz
3f17745930 iPod Classic: HW initialization for RB
Do not rely on a bootloader initializing the HW, RB initializes
and configures GPIO, I2C, and PMU at startup.

Change-Id: If7f856b1f345f63de584aa4e4fc22d130cd66c80
2016-05-25 12:23:47 +02:00
Cástor Muñoz
1aefd9ea41 iPod Classic: HW preliminary initialization for bootloader
When the bootloader starts, most of HW never has been initialized.
This patch includes all code needed to perform the preliminary
initialization on SYSCON, GPIO, i2c, and MIU.

The code is based on emCORE and OF reverse engineering, ported to
C for readability.

Change-Id: I9ecf2c3e8b1b636241a211dbba8735137accd05c
2016-05-25 10:59:31 +02:00
Cástor Muñoz
00a3658e5a iPod Classic: modify USB storage read/write buffers size
The write buffer size is undefined to use the default 24Kb. size
defined (and recomended) in usb_storage.c, the read buffer size is
also decremented to 24 Kb. USB sequential read and write benchmarks
using diskdump are now 8-9% faster.

Change-Id: Ia7c9f77b57c8ca5b566b508efffbd713d1587acf
2016-05-15 23:43:00 +02:00
Cástor Muñoz
201f57171a iPod Classic: remove ATA_HAVE_BBT
Change-Id: I45e26a413c13e401164a01996b0b4c6788096a7f
2016-05-15 21:47:22 +02:00
Cástor Muñoz
dbcde01835 iPod Classic: remove emCORE HDD endianess warning
Change-Id: I91aa2dca7e748fe043c16014661985c42ab84b1a
2016-05-15 21:38:37 +02:00
Cástor Muñoz
469d645390 iPod Classic: prepare i2c and PMU for bootloader
When the bootloader starts only IRAM is available, the first task is to
ask the PMU to verify if the iPod has previously been hibernated by OF.
Due to memory limitations, the kernel cannot be used on this stage.

This patch modifies I2C and PMU low level functions to not to depend
on kernel (removes mutexes, and uses HW timer instead of current_tick),
actual kernel functions are modified to be 'mutexed' wrappers of the new
functions.

Change-Id: I7cef9e95dedaf176dc0659315f3dc33166d5b116
2016-05-15 21:16:54 +02:00
Cástor Muñoz
44ce4eebd6 iPOd Classic: skip emCORE HDD endianness warning for bootloader
Change-Id: I274511cc1061c396a0642e8496d46a3b9c1228d3
2016-05-15 21:16:54 +02:00
Cástor Muñoz
9a4cd2eaee iPod Nano2G: add IPOD_ACCESSORY_PROTOCOL
Change-Id: I78a19972624504bc802d96b9b8e9cec132164c2c
2016-05-14 19:39:09 +02:00
Cástor Muñoz
d405026ca8 iPod Nano2G: add HAVE_SERIAL
Change-Id: I46dca69c6708d3e6189f66e70badf0a594bac00b
2016-05-13 23:23:35 +02:00
Cástor Muñoz
5017523a6b Add UART suuport for s5l8700 and s5l8701
Add UART support for s5l8700/1 using the UC870X UART controller,
actually the functionallity is disabled and must be enabled for
each individual target. Tested on iPod Nano 2G (s5l8701), not
tested on s5l8700.

Change-Id: Ic0f216bb871502d355a70e4b658e536a2c0976a9
2016-05-13 23:23:01 +02:00
Cástor Muñoz
8fb67f48ab iPod Classic: updates for uc8702 driver
- Small rework on the UC8702 UART controller to make it compatible with
  other s5l870x SOCs. Files moved and renamed, many conditional code
  added to deal with capabilities and 'features' of the different CPUs.

- A couple of optimizacions that should not affect the functionality.

Change-Id: I705169f7e8b18d5d1da642f81ffc31c4089780a6
2016-05-13 23:21:42 +02:00
Michael Giacomelli
18fecd9461 Update runtime estimation after recent power optimizations.
Values taken from Mihail's Clip Zip, should be similar
on all AMSv2 devices.

Change-Id: I9432ecffea94afae224391a86f1d3fa46cd87bc0
2016-04-22 22:42:05 +02:00
Mihail Zenkov
79ca6d4e3c AMS: enable SD card support in bootloader
With this changes rockbox can be loaded from SD card when internal storage
can't be mount (due to hardware or software problem).

Change-Id: I32b20d3f341566364def747a708a54ba6b4a7f8b
2016-04-20 15:53:33 +00:00
Mihail Zenkov
8a0360dd1e AMSv2: enable voltage scaling
Change-Id: I8d64b8578d28884e326f8b43100b3b4691f95acf
2016-04-13 23:10:30 +00:00
Mihail Zenkov
e4e0b18daa AMS: power off while charging enabled
Change-Id: Icddf1ea0a03f0426e0cf9b99f05ea065f532fed5
2016-04-07 02:35:58 +00:00
Mihail Zenkov
c7daef36c5 as3525: reverting I2C2 to non-interrupts version
Interrupts version is cause of freeze on USB extraction.
Also non-interrupts version much simpler and faster.

Change-Id: I30a2993cdcaa85abfba77ca06bfacd5b6b4353e2
2016-04-05 01:55:38 +00:00
Mihail Zenkov
ce90c0481a Fix checking for CONFIG_CHARGING
Change-Id: I53b9a129679fd7b322770025106ef92033226d2a
2016-04-04 11:19:51 +02:00
Mihail Zenkov
e599810ffa Don't add new message to logf when we dump it to file
Fix log file corruption if we have new messages at dumping log to file. Comment
removed as it incorrect. We store all messages in direct order (last message at
end of file).

Change-Id: I4acfa8a0935cc41a889e08f6bc42974fefd1ade2
2016-04-04 11:07:44 +02:00
Michael Giacomelli
7ba50cfdc1 Disable voltage scaling.
Crashes immediately.  Something was wrong with the last commit.

Change-Id: Ie8a05095369a6312dc151e0a393e97d3a3fc7a09
2016-03-27 23:56:19 +02:00
Michael Giacomelli
7be692e806 Enable voltage scaling on AMSv2.
Voltage is reduced when the CPU is unboosted, resulting in a large
reduction in power consumption. In analogy with the AMSv1 voltage
scaling code (currently disabled due to problems with SD cards),
I have defined a config file option to enable/disable it.

Change-Id: Ia89c31ec06dd012354b4d53435e7b5b36243b206
2016-03-27 23:14:51 +02:00
Mihail Zenkov
fe9a3ceb0e GUI boost for any button
It improve responsiveness for all targets with frequency scaling.

Change-Id: I72c94daf58cee10c1772decbd0443856c111cc47
2016-03-18 21:39:37 +01:00
Mihail Zenkov
a24abd2a47 Fix NUM_ADC_CHANNELS for AS3525v2
Change-Id: If523d9fe24711ffe571623aae54f141f00b0ee41
2016-03-18 20:24:40 +01:00
Szymon Dziok
e0a4dc5113 HDD63X0: add a note about poweroff while charging to the config file.
Change-Id: I1e523dd3ddc5ddf198302cdb69cc90ad79df0563
2016-03-13 20:51:39 +01:00
Szymon Dziok
164f50b60c HDD16X0: disable poweroff while charging, add a note to the config file why.
Change-Id: I90511b019f45d06e3154c986e1abf87a91d79570
2016-03-13 20:48:14 +01:00
Cástor Muñoz
e9497dbf6d iPod Classic: ATA SMART updates
- Add description for attributes supported by Samsung HS081HA (80Gb)
  and HS161JQ (CEATA 160Gb).
- Show error code when ata_read_smart() fails.

Change-Id: I618cc4f37d139fc90f596e2cf3a751346b27deb6
2016-02-14 15:17:42 +01:00
Cástor Muñoz
31d9084a8c iPod Classic: fix USB_DEVBSS_ATTR alignment
After previous commit 0b6647f2e9
this alignment should not be needed, but not sure at all, so it
is aligned to cache line length for safety.

Change-Id: I5b2b9a30c913d2a609acc1bdf30bdec6811a2551
2016-02-14 15:10:55 +01:00
Amaury Pouly
6f54a86360 as3514: fix bug in volume management on AS3543 targets which are not AS3525v2
Some old code made the assumption that CONFIG_CPU == AS3525v2 if and only if
HAVE_AS3543, which is not true on targets like the Samsung YP-R0. This fixes
several issues on such targets like a huge volume gap between -39dB and -40dB
and a volume artificially capped at -72dB instead of -82dB.

Change-Id: Ib1c883ac593c0c3ce5e2bf4eb408924ce5f5ad93
2016-02-12 23:04:33 +00:00
Sebastian Leonhardt
e6cd53ad53 Replace SAMSUNG_YH920_PAD with YH92X
seems more logical to me, and is more consistent, since
"SAMSUNG_YH92X_PAD" is already used in the tex files.

Change-Id: Ie9a9d850ea86155a7dcf86c88a22a420a10a3837
2016-01-25 09:23:09 +01:00
Mihail Zenkov
3f54101858 Enable frequency scaling on AMSv2 devices.
Voltage scaling is not yet enabled, but will follow once we are sure
these changes are stable.  Preliminary testing suggests a large
increase in battery life, which will be further improved by voltage
scaling.  Patch by Mihail Zenkov with help from myself and others on
the forums.

Change-Id: I171d20bbee19a48c13cd14efb0d023883cc8c687
2016-01-21 19:26:00 +01:00
Cástor Muñoz
00bda90a21 iPod Classic: add non-cached memory region
Configures uncached memory region and adds some defines for misc HW,
for compability with the bootloader and other future use, current
functionality should not be affected.

Change-Id: I390e79bea1aef5b10dfbc72ad327d7fe438ec6f5
2015-12-17 10:52:49 +01:00
Cástor Muñoz
5c67ebbc33 iPod Classic: prepare LCD driver for the bootloader
Optimizes encoding of LCD command sequences.

Change-Id: I9d1eb735e5a972c1a176177ed570a3fe991d7b9f
2015-12-17 09:14:58 +01:00
Cástor Muñoz
f753b8ead1 iPod Classic: s5l8702 clocking rewrite+documentation
This is a rewrite of the clocking section, the resulting system
frequencies are the same as the current git version.

This pàtch uses fixed FClk and just one register is written to switch
all system frequencies, it needs less steps than the current git
version to reach the desired frequency, so it is faster and safer.
Includes functions to step-up/down over a table of predefined set of
frequencies.

The major difference is that Vcore is decreased from 1050 to 1000 mV.

See clocking-s5l8702.h for more information.

Change-Id: I58ac6634e1996adbe1c0c0918a7ce94ad1917d8e
2015-12-17 07:05:53 +01:00
Cástor Muñoz
d57e65109a iPod Classic: enable AB repeat
Change-Id: I58f3b0a3e4d8a1649d5549c312e6a259bce697a4
2015-10-17 03:33:31 +02:00
Cástor Muñoz
d20185ac96 iPod Classic: reads HDD S.M.A.R.T. data
Adds ata_read_smart() function to storage ATA driver, current
SMART data can be displayed and optionally written to hard
disk using System->Debug menu.

Change-Id: Ie8817bb311d5d956df2f0fbfaf554e2d53e89a93
2015-10-07 06:15:04 +02:00
Cástor Muñoz
be5fc0ff7f iAP: lingo 1 (microphone)
Change-Id: I65da2064951972368a2880d271280e5b5ae878fe
2015-10-07 06:15:04 +02:00
Cástor Muñoz
efd047a08b iPod Classic: implement IPOD_ACCESSORY_PROTOCOL
Change-Id: I0f0950c42ae5bf5c5b4c2c2f097f8c68a92ba4dd
2015-10-07 06:15:03 +02:00
Cástor Muñoz
38ae0d53e8 iPod Classic: implement HAVE_SERIAL
Change-Id: I24a861cd45095d858d1a7db39969f6eda17cc563
2015-10-07 06:15:03 +02:00
Cástor Muñoz
291b2338c9 ipod Classic: implement HAVE_RECORDING
This patch has been tested on iPod 80 and 160slim, actually
it works but some updates must be done to the final version:

 - unlimitted input buffer
 - decrease CHUNK_SIZE
 - use non-cached addresses instead of discard d-cache ???

Capture hardware versions:

 Ver  iPod models   capture support
 ---  -----------   ---------------
 0    80/160fat     dock line-in
 1    120/160slim   dock line-in + jack mic

 HW version 1 includes an amplifier for the jack plug mic.

 Capture HW detection only tested on iPod 80 and 160slim.

CODEC power:

 AFAIK, OF powers CS42L55 at VA=2.4V for capture (1.8V for
 playback) and turns on the ADC charge pump. CODEC datasheet
 recommmends to disable the charge pump for VA>2.1V.

 CS42L55 DS, s4.13 (Required Initialization Settings): for
 VA>2.1V, some adjustments "must" be done using undocummented
 "control port compensation" registers. OF does not modifies
 these registers when VA=2.4V.

 This patch configures capture HW in the same way as OF does.

TODO:
 - ADC full scale voltage depends on VA, perform tests to find
   clipping levels for VA=1.8V and VA=2.4V

Change-Id: I7e20fd3ecaa83b1c58d5c746f5153fe5c3891d75
2015-10-07 06:15:03 +02:00
Cástor Muñoz
42abc6a496 iPod Classic: capture support for CS42L55 codec
There are a couple of power saving options that can be selected using
defines, they configure the CODEC in a different way than OF does:

 MONO_MIC: jack microphone is connected to left channel, disabling
 right channel saves ~1 mW, there is no reason to not to do it.

 BYPASS_PGA: this option only applies to the line-in, OF does not
 bypass the PGA and configures it to 0 dB gain. At the beginning,
 this patch was written based on CODEC datasheet, bypassing PGA
 because it saves power and incrementes dinamic range ~1dB, i have
 used this setup for a while without problems. Finally this option
 was disabled at the last minute, i decided to do it after reviewing
 the OF and realizing that CS42L55 datasheet recommends to bypass the
 PGA only if the HW includes a couple of capacitors (see Typical
 Connection Diagram, Note 4), at this moment i don't know if Classic
 includes these capacitors (probably not). Anyway, i am not able to
 tell the difference listening to voice recodings.

TODO:
- Use variable PGA gain for jack microphone (it is fixed to +12 dB.
  as OF does).
- I am not a fan of having lots of unused #define options, these could
  be useful for a generic driver but actually this driver is Classic
  oriented, i am not sure if it could be considered disirable to
  eliminate them in the final version.

Change-Id: I3dadf2341f44d5e13f3847e6c9de4a76cd6f0918
2015-10-07 06:15:03 +02:00
Cástor Muñoz
67b4e7f958 iPod Classic: use new PL080 DMA driver
This patch uses the new pl080 DMA driver for I2S playback and LCD
update. I have tried to be as fiel as possible to the current
behaviour, algorithms and configurations are the same, but using
the new driver. Other modifications:

Playback:

 - CHUNK_SIZE is decreased from 42988 to 8188 bytes, it does not
   affect normal playback (block size 1024), was tested using
   metronome (block size 46080). This change is needed because the
   new code commits d-cache range instead of commiting the whole
   d-cache, maximum time spent commiting the range should be
   limited, CHUNK_SIZE can be decreased even more if necessary.

 - pcm_play_dma_start() calls pcm_play_dma_stop() to stop the
   channel when it is running (metronome replays the tick sound
   without stopping the channel).

 - pcm_play_dma_get_peak_buffer(): same as actual SVN function but
   returns samples count instead of bytes count.
   TODO: AFAIK, actually this function is not used in RB. Not tested,
   but probably this function will fail because it returns pointers
   to the internal double buffer.

LCD update:

 - suppresses lcd_wakeup semaphore and uses yield()

Change-Id: I79b8aa47a941e0dd91847150618f3f7f676c26ef
2015-10-07 06:15:03 +02:00
Cástor Muñoz
d6ee2c9eaf iPod Classic: introduce PL080 DMA controller driver
Motivation:

 This driver began as a set of functions to help to test and
 experiment with different DMA configurations. It is cumbersome,
 time consuming, and leads to mistakes to handle LLIs and DMA
 registers dispersed along the code.

 Later, i decided to adapt an old DMA queue driver written in the
 past for a similar (scatter-gather) controller, all task/queue
 code is based on the old driver.

 Finally, some cleaning and dmac_ch_get_info() function was added
 to complete RB needs.

Description:

 - Generic, can be used by other targets including the same
   controller. Not difficult to adapt for other similar
   controllers if necesary.

 - Easy to experiment and compare results using different
   setups and/or queue algorithms:

   Multi-controller and fully configurable from an unique place.

   All task and LLI management is done by the driver, user only
   has to (statically) allocate them.

 - Two queue modes:

   QUEUE_NORMAL: each task in the queue is launched using a new
   DMA transfer once previous task is finished.

   QUEUE_LINK: when a task is queued, it is linked with the last
   queued task, creating a single continuous DMA transfer. New
   tasks must be queued while the channel is running, otherwise
   the continuous DMA transfer will be broken.

   On Classic, QUEUE_LINK mode is needed for I2S continuous
   transfers, QUEUE_NORMAL is used for LCD and could be useful
   in the future for I2C or UART (non-blocking serial debug) if
   necessary.

 - Robust DMA transfer progress info (peak meter), needs final
   testing, see below.

Technical details about DMA progress:

 There are comments in the code related to the method actually
 used (sequence method), it reads progress without halting the
 DMA transfer. Althought the datasheet does not recommend to do
 that, the sequence method seems to be robust, I ran tests calling
 dmac_ch_get_info() millions of times and the results were always
 as expected (tests done at 2:1 CPU/AHB clock ratio, no other
 ratios were tried but probably sequence method will work for any
 typical ratio).

 This controller allows to halt the transfer and drain the DMAC
 FIFO, DMA requests are ignored when the DMA channel is halted.
 This method is not suitable for playback because FIFO is never
 drained to I2S peripheral (who raises the DMA requests). This
 method probably works for capture, the FIFO is drained to memory
 before halting.

 Another way is to disable (stop) the playback channel. When the
 channel is disabled, all FIFO data is lost. It is unknown how much
 the FIFO was filled when it was cleared, SRCADDR counter includes
 the lost data, therefore the only useful information is LINK and
 COUNT, that is the same information disponible when using the
 sequence method. At this point we must procced in the same way as
 in sequence method, in addition the playback channel should be
 relaunched (configure + start) after calculating real SRCADDR.

 The stop+relaunch method should work, it is a bit complicated,
 and not valid for all peripheral FIFO configurations (depending
 on stream rate). Moreover, due to the way the COUNT register is
 implemented in HW, I suspect that this method will fail when
 source and destination bus widths doesn't match. And more
 important, it is not easy to garantize that no sample is lost
 here or there, using the sequence method we can always be sure
 that playback is ok.

Change-Id: Ib12a1e2992e2b6da4fc68431128c793a21b4b540
2015-10-07 06:15:03 +02:00
Cástor Muñoz
609cde9468 iPod Classic: s5l8702 GPIO interrupt controller.
This patch implements a simple API to use the external interrupt
hardware present on s5l8702 (GPIO interrupt controller). This
GPIOIC has been fully tested using emcore apps.

Code is based on openiBoot project, there are a few modifications
to optimize space considering we will only use two or three external
interrupts. The API compiles and works, but has been never used,
therefore probably will need some changes to the final version.

External interrupts are necessary for jack remote+mic controller
(see iAP Interface Specifiction: Headphone Remote and Mic System),
this controller is located at I2C bus address 0x72, there is a IRQ
line for remote button press/release events routed to GPIO E6. At
this moment, the functionallity of this controller has been
extensively tested using emcore, getting a lot of information about
how it works. Microphone is already working on RB, jack accessory
detection and button events are work in progress.

PMU IRQ line is also routed to GPIO F3, it signals many events:
holdswitch, usb plug, wall adapter, low battery... The use of PMU
interrupts is the orthodox way of doing things, at this moment
there is no work done in this direction, there are a lot of PMU
events and i think it is a matter of discursion what to do and how.

Change-Id: Icc2e48965e664ca56c9518d84a81c9d9fdd31736
2015-10-07 06:15:03 +02:00
Udo Schläpfer
dbabd0d9c3 iBasso DX50/DX90: Major code cleanup and reorganization.
Reorganization

- Separated iBasso devices from PLATFORM_ANDROID. These are now standlone
  hosted targets. Most device specific code is in the
  firmware/target/hosted/ibasso directory.
- No dependency on Android SDK, only the Android NDK is needed.
  32 bit Android NDK and Android API Level 16.
- Separate implementation for each device where feasible.

Code cleanup

- Rewrite of existing code, from simple reformat to complete reimplementation.
- New backlight interface, seperating backlight from touchscreen.
- Rewrite of device button handler, removing unneeded code and fixing memory
  leaks.
- New Debug messages interface logging to Android adb logcat (DEBUGF, panicf,
  logf).
- Rewrite of lcd device handler, removing unneeded code and fixing memory leaks.
- Rewrite of audiohw device handler/pcm interface, removing unneeded code and
  fixing memory leaks, enabling 44.1/48kHz pthreaded playback.
- Rewrite of power and powermng, proper shutdown, using batterylog results
  (see http://gerrit.rockbox.org/r/#/c/1047/).
- Rewrite of configure (Android NDK) and device specific config.
- Rewrite of the Android NDK specific Makefile.

Misc

- All plugins/games/demos activated.
- Update tinyalsa to latest from https://github.com/tinyalsa/tinyalsa.

Includes

- http://gerrit.rockbox.org/r/#/c/993/
- http://gerrit.rockbox.org/r/#/c/1010/
- http://gerrit.rockbox.org/r/#/c/1035/

Does not include http://gerrit.rockbox.org/r/#/c/1007/ due to new backlight
interface and new option for hold switch, touchscreen, physical button
interaction.

Rockbox needs the iBasso DX50/DX90 loader for startup, see
http://gerrit.rockbox.org/r/#/c/1099/

The loader expects Rockbox to be installed in /mnt/sdcard/.rockbox/. If
/mnt/sdcard/ is accessed as USB mass storage device, Rockbox will exit
gracefully and the loader will restart Rockbox on USB disconnect.

Tested on iBasso DX50.
Compiled (not tested) for iBasso DX90.
Compiled (not tested) for PLATFORM_ANDROID.

Change-Id: I5f5e22e68f5b4cf29c28e2b40b2c265f2beb7ab7
2015-02-02 21:57:55 +01:00
Lorenzo Miori
6879dec6ec yp-r0: improve the charging code
Some people reported strange charging times and
strange battery life.
Charging by OF: 25 hours; RB: 18 hours
It has been found that there are at least two issues here:

1) the way of getting battery charging status wasn't
really accurate. This attempts to fix that issue.
This patch also simplifies some code (opening a
device is no more needed, for example).

To technically explain, battery charging implies first a constant
current mode (where the voltage increases) and then a constant
voltage mode (where, obviously, the voltage reads more or less
the same). The old way the End Of Charge was detected was based solely
on the voltage, while now it is based on chip's EOC interrupt,
which should be more accurate.

2) OF explicitly sets a constant current 350 mA, while we usually had
55 mA (by as3543 default).
This wasn't discovered before since there is a caching problem
("an accurate guess") in the Samsung power mgmt Linux module,
thus its debugging dumper wasn't really working, reporting a 55 mA current.
Strangely this option should have been set by the bootloader
but apparently it does not.

Some testing is still needed, but I confirm that with this patch
I could run a benchmark for 25 hours (vs. 18 hours), by charging
within Rockbox of course.

Change-Id: I3bd921e86b9018d1cc3c720d15cc46896e8490b3
2015-01-29 20:28:07 +01:00
Marcin Bukat
89ba7e818c Get rid of stupid _backlight_* function names
_remote_backlight_* and _buttonlight_* are cleaned as well

Change-Id: I73653752831bbe170c26ba95d3bc04c2e3a5cf30
2015-01-12 11:09:27 +01:00
Amaury Pouly
761e7987c8 usb: finally get rid of USE_ROCKBOX_USB in Sansa bootloader, use bootloader usb
For some reason, the bootloader and config files didn't define
HAVE_BOOTLOADER_USB_MODE, also remove the special cases in usb.c which they
implied.

Change-Id: I68c29be7d03627e64cac4ff7678e0c211e087a8c
2015-01-08 22:30:22 +01:00
Amaury Pouly
3aebdfa642 usb: make usb_release_exclusive_storage private
Change-Id: I0383760b7d8e67cc99bbe4e4979bca92ef436c8d
Reviewed-on: http://gerrit.rockbox.org/1098
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2015-01-08 16:45:41 +01:00
Amaury Pouly
dc127f213c Clarify usb_powered() and fix some code.
Either by mistake or because its meaning changed, usb_powered() doesn't mean
what the name suggest, so clarify its meaning by renaming it to usb_powered_only.
So use of usb_powered() are replaced by usb_inserted() when it makes more sense.

Change-Id: I112887e2d8560e84587bee5f55c826dde8c806d8
Reviewed-on: http://gerrit.rockbox.org/1097
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2015-01-08 16:45:32 +01:00
Amaury Pouly
1ab91550e6 usb: document usb states, powering and detection
Change-Id: Ia3b7d6c6294bfb9272355c3f28a994dd0e83cbce
Reviewed-on: http://gerrit.rockbox.org/1096
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2015-01-08 16:45:22 +01:00
Amaury Pouly
ae37d1944f usb: document usb_status_event and #ifdef it with USB_STATUS_BY_EVENT
Change-Id: I62cdb8ad71a598279fe99cc91d87eafda26cbbc7
Reviewed-on: http://gerrit.rockbox.org/1095
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2015-01-08 16:45:11 +01:00
Amaury Pouly
268114ee66 usb: move usb charging function prototype from usb_core.h to usb.h
Change-Id: Id29c60d3aa26f8badca6c38c1cbb2e5a39c554dc
Reviewed-on: http://gerrit.rockbox.org/1094
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2015-01-08 16:44:55 +01:00
Amaury Pouly
66690ca987 Get rid of USE_ROCKBOX_USB
Except for unfinished or experimental ports, it isthe case that
USE_ROCKBOX_USB and HAVE_USBSTACK are both defined or both undefined.
Furthermore, it is a leftover of some early developments on the USB stack and
doesn't make sense anymore.

Change-Id: Ic87a865b6bb4c7c9a8d45d1f0bb0f2fb536b8cad
Reviewed-on: http://gerrit.rockbox.org/1091
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2015-01-08 16:07:12 +01:00
Andrew Ryabinin
d1fcfe950a Add IS_ALIGNED(x, a) macro helper
Change-Id: Ic5799e4bc03cabddece80cbc129b16f3a19ff9c5
2014-11-29 20:59:18 +03:00
Cástor Muñoz
57969698ce iPod Classic: update timer API using 32-bit timers.
Change-Id: I49dab8ae955a339ad0a27402fa21caa411c4ecf6
Reviewed-on: http://gerrit.rockbox.org/1032
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-11-16 14:18:32 +01:00
Cástor Muñoz
edb0c6c92f iPod Classic: fix s5l8702 cache line length.
Use 32 bytes for cache line length (arm926ej-s), this prevents
misalignments of ATA storage buffer which in some builds could
cause weird faults.

Change-Id: I88dc595d251315620ec49b0251ddc039ff47181e
Reviewed-on: http://gerrit.rockbox.org/1031
Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
2014-11-13 23:00:33 +01:00
Szymon Dziok
bcca111438 HDD1630/HDD6330/SA9200: Integration of the clicker with the "Keyclick" menu.
Change-Id: Ieb26f2252c1f2613cc9bd83c8349f49113f46d87
2014-11-10 21:40:47 +01:00
Udo Schläfer
fe519c7e4d Enable battery charging detection for iBasso DX50/DX90.
This changes iBasso DX50/DX90 config from CHARGING_SIMPLE (Simple, hardware
controlled charging (CPU cannot read charger state but may read when power is
plugged-in) to CHARGING_MONITOR (Hardware controlled charging with monitoring
(CPU is able to read HW charging state and when power is plugged-in)).

Not really usefull at the moment, since USB connection (charging) is not (yet)
gracefully handled for iBasso devices.

Change-Id: I55da81b10637d4de88d713ea5eba08eb59bc629f
Reviewed-on: http://gerrit.rockbox.org/1010
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
2014-10-18 05:31:34 +02:00
Szymon Dziok
aa8ba60fea YH820/YH92X: Properly enable morse input.
Change-Id: I6a35d64d0859b7ef429919c260a69974d6fdfafb
2014-10-08 16:31:39 +02:00
Szymon Dziok
193ea0909d Samsung yh820/yh92x: add HID keymaps.
Change-Id: I575e0e858aef0090d6864837d40a7b51e996ab43
2014-10-03 00:20:09 +02:00
Szymon Dziok
174523ab58 YH920: fix the battery capacity.
Change-Id: I6c7a771d8f1f1284fc13f1b0d16744fa03741c43
2014-10-02 20:58:20 +02:00
Simon Rothen
0b5ad60c26 Introducing Targets iBasso DX50 & iBasso DX90
The port to for this two targets has been entirely developped by Ilia Sergachev (alias Il or xzcc). His source
can be found at https://bitbucket.org/isergachev/rockbox . The few necesary modifications for the DX90 port
was done by headwhacker form head-fi.org. Unfortunately i could not try out the final state of the DX90 port.
The port is hosted on android (without java) as standalone app. The official Firmware is required to run this port.
Ilia did modify the source files for the "android" target in the rockbox source to make the DX port work. The work I did
was to separate the code for DX50 (&DX90) from the android target.
On this Target Ilia used source from tinyalsa from AOSP. I did not touch that part of the code because I do not understand it.
What else I changed from Ilias sources besides the separation from the target "android":
* removed a dirty hack to keep backlight off
* changed value battery meter to voltage battery meter
* made all plugins compile (named target as "standalone") and added keymaps
* i added the graphics for the manual but did not do anything else for the manual yet
* minor optimizations

known bugs:
* timers are slowed donw when playback is active (tinyalsa related?)
* some minor bugs

Things to do:
* The main prolem will be how to install the app correctly. A guy called DOC2008 added a CWM (by androtab.info) to the
  official firmware and Ilia made a CWM installation script and a dualboot selector (rbutils/ibassoboot, build with
  ndk-build). We will have to find a way to install rockbox in a proper way without breaking any copyrights.
  Maybe ADB is an option but it is not enable with OF by default. Patching the OF is probably the way to go.
* All the wiki and manual

to build:
needed: android ndk installed, android sdk installed with additional build-tools 19.1.0 installed

./tools/configure
select iBasso DX50 or iBasso DX90
make -j apk

the content of rockbox.zip/.rockbox needs to be copied to /system/rockbox/app_rockbox/rockbox/ (rockbox app not needed)
the content of libs/armeabi to /system/rockbox/lib/ (rockbox app needed)

The boot selector is needed as /system/bin/MangoPlayer and the iBasso app as /system/bin/MangoPlayer_original. There
is also the "vold" file. The one from OF does not work with DX50 rockbox (DX90 works!?), the one from Ilia is necessary.

Until we have found a proper way to install it, it can only be installed following the instructions of Ilia on his
bitbucket page, using the CWM-OF and his installation script package.

Change-Id: Ic4faaf84824c162aabcc08e492cee6e0068719d0
Reviewed-on: http://gerrit.rockbox.org/941
Tested: Chiwen Chang <rock1104.tw@yahoo.com.tw>
Reviewed-by: Michael Giacomelli <giac2000@hotmail.com>
2014-09-18 18:19:01 +02:00
Amaury Pouly
8146b40e73 Fuze+: add a configurable deadzone area for touchpad buttons
To stop erroneous button presses, allow users to add a deadzone between
the button via the Settings > General > System menu > Touch Dead Zone.

The configuration was chosen this way: the touchpad has the same DPI
in both direction so the setting applies the same on both the X and Y
axis. The setting ranges from 0 to 100 and is internally multiplied by 2
giving a maximum deadzone of 2*100 = 200 around each button, which
account for 400 total (once around each button), effectively reducing
each virtual button from 1000x600 to 600x200 when using the maximum value.

Change-Id: I8683c63d2950200eb32d1dda0a00bbd92d83d5be
Reviewed-on: http://gerrit.rockbox.org/677
Reviewed-by: Benjamin Brown <foolshperson@gmail.com>
Tested: Benjamin Brown <foolshperson@gmail.com>
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-09-08 11:21:54 +02:00
Michael Sevakis
5b08f1a5b9 Remove I/O priority. It is harmful when used with the new file code.
HAVE_IO_PRIORITY was defined for native targets with dircache.

It is already effectively disabled for the most part since dircache no
longer lowers its thread's I/O priority. It existed primarily for the
aforementioned configuration.

Change-Id: Ia04935305397ba14df34647c8ea29c2acaea92aa
2014-08-30 14:01:21 -04:00
Michael Sevakis
f3d60aea34 Hopefully fix most of the errors and warnings from the last push
Change-Id: I1a466b2d55f120796910039a0296ca324c58e891
2014-08-29 23:36:11 -04:00
Michael Sevakis
7d1a47cf13 Rewrite filesystem code (WIP)
This patch redoes the filesystem code from the FAT driver up to the
clipboard code in onplay.c.

Not every aspect of this is finished therefore it is still "WIP". I
don't wish to do too much at once (haha!). What is left to do is get
dircache back in the sim and find an implementation for the dircache
indicies in the tagcache and playlist code or do something else that
has the same benefit. Leaving these out for now does not make anything
unusable. All the basics are done.

Phone app code should probably get vetted (and app path handling
just plain rewritten as environment expansions); the SDL app and
Android run well.

Main things addressed:
1) Thread safety: There is none right now in the trunk code. Most of
what currently works is luck when multiple threads are involved or
multiple descriptors to the same file are open.

2) POSIX compliance: Many of the functions behave nothing like their
counterparts on a host system. This leads to inconsistent code or very
different behavior from native to hosted. One huge offender was
rename(). Going point by point would fill a book.

3) Actual running RAM usage: Many targets will use less RAM and less
stack space (some more RAM because I upped the number of cache buffers
for large memory). There's very little memory lying fallow in rarely-used
areas (see 'Key core changes' below). Also, all targets may open the same
number of directory streams whereas before those with less than 8MB RAM
were limited to 8, not 12 implying those targets will save slightly
less.

4) Performance: The test_disk plugin shows markedly improved performance,
particularly in the area of (uncached) directory scanning, due partly to
more optimal directory reading and to a better sector cache algorithm.
Uncached times tend to be better while there is a bit of a slowdown in
dircache due to it being a bit heavier of an implementation. It's not
noticeable by a human as far as I can say.

Key core changes:
1) Files and directories share core code and data structures.

2) The filesystem code knows which descriptors refer to same file.
This ensures that changes from one stream are appropriately reflected
in every open descriptor for that file (fileobj_mgr.c).

3) File and directory cache buffers are borrowed from the main sector
cache. This means that when they are not in use by a file, they are not
wasted, but used for the cache. Most of the time, only a few of them
are needed. It also means that adding more file and directory handles
is less expensive. All one must do in ensure a large enough cache to
borrow from.

4) Relative path components are supported and the namespace is unified.
It does not support full relative paths to an implied current directory;
what is does support is use of "." and "..". Adding the former would
not be very difficult. The namespace is unified in the sense that
volumes may be specified several times along with relative parts, e.g.:
"/<0>/foo/../../<1>/bar" :<=> "/<1>/bar".

5) Stack usage is down due to sharing of data, static allocation and
less duplication of strings on the stack. This requires more
serialization than I would like but since the number of threads is
limited to a low number, the tradoff in favor of the stack seems
reasonable.

6) Separates and heirarchicalizes (sic) the SIM and APP filesystem
code. SIM path and volume handling is just like the target. Some
aspects of the APP file code get more straightforward (e.g. no path
hashing is needed).

Dircache:
Deserves its own section. Dircache is new but pays homage to the old.
The old one was not compatible and so it, since it got redone, does
all the stuff it always should have done such as:

1) It may be update and used at any time during the build process.
No longer has one to wait for it to finish building to do basic file
management (create, remove, rename, etc.).

2) It does not need to be either fully scanned or completely disabled;
it can be incomplete (i.e. overfilled, missing paths), still be
of benefit and be correct.

3) Handles mounting and dismounting of individual volumes which means
a full rebuild is not needed just because you pop a new SD card in the
slot. Now, because it reuses its freed entry data, may rebuild only
that volume.

4) Much more fundamental to the file code. When it is built, it is
the keeper of the master file list whether enabled or not ("disabled"
is just a state of the cache). Its must always to ready to be started
and bind all streams opened prior to being enabled.

5) Maintains any short filenames in OEM format which means that it does
not need to be rebuilt when changing the default codepage.

Miscellaneous Compatibility:
1) Update any other code that would otherwise not work such as the
hotswap mounting code in various card drivers.

2) File management: Clipboard needed updating because of the behavioral
changes. Still needs a little more work on some finer points.

3) Remove now-obsolete functionality such as the mutex's "no preempt"
flag (which was only for the prior FAT driver).

4) struct dirinfo uses time_t rather than raw FAT directory entry
time fields. I plan to follow up on genericizing everything there
(i.e. no FAT attributes).

5) unicode.c needed some redoing so that the file code does not try
try to load codepages during a scan, which is actually a problem with
the current code. The default codepage, if any is required, is now
kept in RAM separarately (bufalloced) from codepages specified to
iso_decode() (which must not be bufalloced because the conversion
may be done by playback threads).

Brings with it some additional reusable core code:
1) Revised file functions: Reusable code that does things such as
safe path concatenation and parsing without buffer limitations or
data duplication. Variants that copy or alter the input path may be
based off these.

To do:
1) Put dircache functionality back in the sim. Treating it internally
as a different kind of file system seems the best approach at this
time.

2) Restore use of dircache indexes in the playlist and database or
something effectively the same. Since the cache doesn't have to be
complete in order to be used, not getting a hit on the cache doesn't
unambiguously say if the path exists or not.

Change-Id: Ia30f3082a136253e3a0eae0784e3091d138915c8
Reviewed-on: http://gerrit.rockbox.org/566
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2014-08-30 03:48:23 +02:00
Michael Sevakis
2cb274ca77 panicf doesn't return so why not tell GCC and $AVE :
Change-Id: I6096576f539bfb02b340b82fabc5019f6756b722
2014-08-25 13:55:16 -04:00
Michael Sevakis
6ffb8ffeee Do a better endian.h setup that isn't as fragile
We redefine the top-level macros to our own in order to maintain
compatibility with compound initializers by wrapping the mid or low
level definitions from the OS header.

This allows, hopefully optimized, macros from the host OS's headers to
be used when building any hosted target obviating the need for
NEED_GENERIC_BYTESWAPS unless the target simply doesn't define its
own optimized versions (MIPS!).

Throw in some 64-bit swaps for completeness' sake; they generate no code
if not yet used anyway.

Change-Id: I21b384b55fea46833d01ea3cad1ad8952ea01a11
2014-08-25 12:16:56 -04:00
Avi Eisenberg
d3cf366868 Fuze+: fixed brightness settings: previously there were 81 settings for only 26 possible brightnesses, now there are 33 for 33
Change-Id: Idc6e3a635850f3ee54ec23246795af88af960ab0
Reviewed-on: http://gerrit.rockbox.org/916
Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
2014-08-25 09:44:32 +02:00
Michael Sevakis
6ed00870ab Base scheduler queues off linked lists and do cleanup/consolidation
Abstracts threading from itself a bit, changes the way its queues are
handled and does type hiding for that as well.

Do alot here due to already required major brain surgery.

Threads may now be on a run queue and a wait queue simultaneously so
that the expired timer only has to wake the thread but not remove it
from the wait queue which simplifies the implicit wake handling.

List formats change for wait queues-- doubly-linked, not circular.
Timeout queue is now singly-linked. The run queue is still circular
as before.

Adds a better thread slot allocator that may keep the slot marked as
used regardless of the thread state. Assists in dumping special tasks
that switch_thread was tasked to perform (blocking tasks).

Deletes alot of code yet surprisingly, gets larger than expected.
Well, I'm not not minding that for the time being-- omlettes and break
a few eggs and all that.

Change-Id: I0834d7bb16b2aecb2f63b58886eeda6ae4f29d59
2014-08-16 05:15:37 -04:00
Michael Sevakis
29f5385263 Fix up some more red
find_first_set_bit() becomes a small inline on ARMv5+ and checkwps now gets
made with -std=gnu99 (it eats all the GCCOPTS) like the rest of things.

Change-Id: Ie6039b17fec057a3dcb0f453d8fd5efac984df89
2014-08-05 21:32:13 -04:00
Sebastian Leonhardt
7e778c5f49 Samsung YH-820: enable battery monitoring
The "percent_to_volt_charge" values are quite arbitrary
and may need some more tweaking.

Change-Id: I9f177d46681030d615fe2c2e78cf9bd2dde026af
Reviewed-on: http://gerrit.rockbox.org/824
Reviewed-by: Szymon Dziok <b0hoon@o2.pl>
Tested: Szymon Dziok <b0hoon@o2.pl>
2014-07-27 12:09:36 +02:00
Amaury Pouly
e08331eef4 zen/zenxfi/zenxfistyle/zenmozaic: implement plugin keymaps and enable plugins
Plugins on the ZEN/ZEN X-Fi require to increase the plugin buffer size.

Change-Id: If4651c87b402060faa24530985c6e871379c8ea1
2014-07-17 10:40:17 +02:00
Amaury Pouly
d9d209256b zen/zenxfi: fix config file comments
Change-Id: I7c9c73f749622ffc552638e84e5907a187087381
2014-06-25 09:22:19 +02:00
Amaury Pouly
d5591a2b28 zen/zenxfi: switch lcd driver to 24-bit mode
Change-Id: I2c42f0e422130bcdaf1aaf92c7b56776752f4f64
2014-06-24 18:07:55 +02:00
Thomas Martitz
cd4fb9ee79 fix sdlapp and ypr0 builds
Change-Id: I3953350c04607691b427fc2a3b00e8ae08bcea45
2014-06-23 23:47:25 +02:00
Thomas Martitz
dbb76896ec lcd-24bit: fix up previous commit a1842c0
* e200v2 shouldn't use 24bit (was just for testing)
* samsung ypr0/ypr1 should enable it but the correct number must be passed to bmp2rb

Change-Id: Ia91b0ff80a54265d4c3111d9dcb8e7b9dd12b5d4
2014-06-21 00:20:24 +02:00
Thomas Martitz
a1842c04f9 lcd-24bit: Introduce a 24-bit mid-level LCD driver
With LCD driver all calculation will be performed on RGB888 and the hardware/OS
can display from our 24bit framebuffer.

It is not yet as performance optimized as the existing drivers but should be
good enough.The vast number of small changes is due to the fact that
fb_data can be a struct type now, while most of the code expected a scalar type.

lcd-as-memframe ASM code does not work with 24bit currently so the with 24bit
it enforces the generic C code.

All plugins are ported over. Except for rockpaint. It uses so much memory that
it wouldnt fit into the 512k plugin buffer anymore (patches welcome).

Change-Id: Ibb1964545028ce0d8ff9833ccc3ab66be3ee0754
2014-06-21 00:15:53 +02:00
Szymon Dziok
eacd76cb80 Radio and radio recording for Samsung YH-920.
There is no simple method to detect radio through the 3-wire interface, so it's
not implemented for the YH-925 for now. YH-920 always has a radio.

Change-Id: Iea484d752915fcd40dbbbd7dbbf13e81aaf548db
2014-06-18 18:06:17 +00:00
Szymon Dziok
6363294591 YH92x: Implement ATA power off.
Change-Id: If1f48df42ea7a150365c4ddbd3f9f7a85ae4b7dc
2014-06-18 18:06:17 +00:00
Szymon Dziok
81db2f5eb0 YH92x: Use the led near the lcd as the ATA led, instead of shine all the time.
Change-Id: I139d0a8dc00e4d5fd964c3667e598aec923cc1cd
2014-06-18 18:06:17 +00:00
Szymon Dziok
701eaa647b Samsung YH-820: implement an inverting of colours on the lcd.
Change-Id: Ibddf444b35402f8d2a9ad8b6af9d897a6618da18
2014-06-09 01:15:17 +00:00
Szymon Dziok
8326f173f9 Samsung YH-920: properly implement and enable lcd flipping.
Change-Id: I0a8609c9b4849332a97a125d186f339a61e4d584
2014-06-09 01:15:17 +00:00
Szymon Dziok
f3edbd142a Samsung YH-920: enable lcd contrast setting, fix default lcd contrast.
Change-Id: I58303feed59754143f57889ab19a21a628d5ed3d
2014-06-09 01:15:17 +00:00
Szymon Dziok
6aef81a0f6 Samsung YH-920: enable inverting of colours on the lcd.
Change-Id: Iaf70e9e854a52c6ddd12bc81e59580dbc3938888
2014-06-09 01:15:17 +00:00
Sebastian Leonhardt
53efa59e12 recording on Samsung YH-820/YH-92x
Change-Id: I6eac4cf6c16a322910ad17bfbf3105e330cd0e36
Reviewed-on: http://gerrit.rockbox.org/815
Reviewed-by: Szymon Dziok <b0hoon@o2.pl>
Tested: Szymon Dziok <b0hoon@o2.pl>
2014-06-01 23:25:12 +02:00
Sebastian Leonhardt
7f7aee3f24 Separate keymaps for YH-820 and YH-920/925
Although both players basically have the same keys, the
differences in the layout is rather big, so I think both
deserve their own keymaps.

(On the yh820 the FFWD/PLAY/REW buttons are located above the
direction keys, on the yh920 at the side of the player.
Furthermore the yh920/925 has a REC switch, whereas
yh820 has a push button.)

Change-Id: I0e62a1b101c387646c0bdb07ea142d9d2430ca15
Reviewed-on: http://gerrit.rockbox.org/814
Reviewed-by: Szymon Dziok <b0hoon@o2.pl>
2014-05-24 00:50:11 +02:00
Amaury Pouly
85390865b5 sansaview: fix lcd code
The lcd driver now works but is awfully slow. The trick is to put it in system
mode instead of RGB and setup 16bpp. The GRAM data can then be sent directly
with the SPI but since it's bit-banged and the CPU running at slow speed,
full screen refresh takes over a second, even with a slightly optmised version.
The OF uses a DMA mechanism with a proper LCD controller but the setup is much
more complicated and doesn't work at the moment.

Change-Id: I6c95d91de31bff97d0a5848b8e2078c21deb5895
2014-05-11 19:56:43 +02:00
Amaury Pouly
c1628ba366 sansaview: clean config file
Change-Id: I2dc4bd724272f4c044815370dd2df95f131426a0
2014-05-11 19:56:28 +02:00
Szymon Dziok
62ac0c78c3 Sansa View: adjust two things (define fake codec, missing header file) in order
to compile the bootloader (now it should).

Change-Id: Iba6aa2f118670d66e10451eaf43dd4d83176b06a
2014-03-27 22:35:04 +00:00
Szymon Dziok
ee1a1ce27c define more GPIO ports for the NVIDIA GoForce SoC (PP6100).
Change-Id: Ib02c44b9174fd968ed17640fc515b9c01c4a248d
2014-03-27 21:23:38 +00:00
Szymon Dziok
828f880d40 HDD6330: enable AB repeat.
Change-Id: Ia8bb739cd60b1b2d8a8cd7ad2c536e22553083c6
2014-03-27 19:50:47 +00:00
Szymon Dziok
65ef2c9b1d HDD6330: enable backlight fading.
Change-Id: I60265237485e5892da2d45af0c44eb0aef40d22a
2014-03-27 19:50:47 +00:00
Szymon Dziok
ce28b180b3 SA9200: enable headphones detection.
Change-Id: Ieeeb59f9899a7de61cfc3604b127f1c4377774bf
2014-03-27 19:50:47 +00:00
Szymon Dziok
be6b65162c HDD1630: enable AB repeat.
Change-Id: I474e3cd300e2282de44f9d6e7bdc616e96e3496a
2014-03-27 19:50:47 +00:00
Szymon Dziok
71ee4b44ec HDD1630: enable backlight fading.
Change-Id: I767cab4ab51c17a262519d56d0a3071d3c7bbe16
2014-03-27 19:50:47 +00:00
Thomas Martitz
9cb9f763a9 Fix ALIGN_DOWN() macro on 64bit.
When the align parameter was a 32bit value (like all default integer literals),
and the to-be-aligned value is a pointer the upper 32bit got corrupted because
the value was casted down to 32bit.

Note: This hasnt been a problem because apparently the sim always gets 32bit
addresses (I found this when compiling Rockbox as a library).

Change-Id: I0d2d3fd8bfa210326b27162bb22c059da97d207a
2014-03-24 09:35:27 +01:00
Thomas Martitz
470989bd70 events: Rework event subsystem (add_event, send_event) to be more versatile.
add_event_ex is added that takes an extra user_data pointer. This pointer is
passed to the callback (add_event and add_event_ex have slightly different
callbacks types). All callbacks also get the event id passed. Events added
with add_event_ex must be removed with remove_event_ex because the user_data
pointer must match in addition to the callback pointer.

On the other add_event is simplified to omit the oneshort parameter which
was almost always false (still there with add_event_ex).

As a side effect the ata_idle_notify callbacks are changed as well, they
do not take a data parameter anymore which was always NULL anyway.

This commit also adds some documentation to events.h

Change-Id: I13e29a0f88ef908f175b376d83550f9e0231f772
2014-03-14 23:36:30 +01:00
Michael Sevakis
31b7122867 Implement time-based resume and playback start.
This complements offset-based resume and playback start funcionality.
The implementation is global on both HWCODEC and SWCODEC.

Basically, if either the specified elapsed or offset are non-zero,
it indicates a mid-track resume.

To resume by time only, set elapsed to nonzero and offset to zero.
To resume by offset only, set offset to nonzero and elapsed to zero.

Which one the codec uses and which has priority is up to the codec;
however, using an elapsed time covers more cases:

* Codecs not able to use an offset such as VGM or other atomic
formats

* Starting playback at a nonzero elapsed time from a source that
contains no offset, such as a cuesheet

The change re-versions pretty much everything from tagcache to nvram.

Change-Id: Ic7aebb24e99a03ae99585c5e236eba960d163f38
Reviewed-on: http://gerrit.rockbox.org/516
Reviewed-by: Michael Sevakis <jethead71@rockbox.org>
Tested: Michael Sevakis <jethead71@rockbox.org>
2014-03-10 04:12:30 +01:00
Amaury Pouly
2a71c08533 zenxfi: enable speaker
Change-Id: I603112d2a348abf92d5c8975ea76d3a57fda7cfc
2014-03-09 01:25:51 +01:00
Amaury Pouly
88799b38cf zen(xfi): enable frequency scaling
With the lcd underflow code at work, it results in small flicker when
switching frequency but it should be fine because it doesn't happen very
often and I don't think there is a way to avoid it without disabling EMI
frequency scaling.

Change-Id: I458732d52bbf27cda2510c3836539db1fb24ea15
2014-03-08 18:51:54 +01:00