Commit Graph

3359 Commits

Author SHA1 Message Date
Solomon Peachy fe2d52cc7d pcm: Get rid of pcm_play_pause() and associated APIs
Nothing in the core has used it for some time.  It's exported to the
plugin API but the last plugins to use it were switched to the mixer API
back in 2011.

This allows us to get rid of pcm_play_dma_pause() from all audio drivers

Change-Id: Ic3fa02592316f84963e41d792d1cabb436d1ff6b
2020-10-31 01:18:27 +00:00
William Wilgus 40e98a2e49 Whitespace cleanup on fb_viewport Rewrite
Change-Id: I24aac41c8abecf7b78a44d7f59e842b791be4563
2020-10-26 12:38:22 -04:00
William Wilgus 3237ae4a4f LCD core move buf ptr and address look up function viewport struct
I'm currently running up against the limitations of the lcd_draw functions
I want these functions to be able to be used on any size buffer not
just buffers with a stride matching the underlying device

[DONE] allow the framebuffer to be decoupled from the device framebuffer
[DONE need examples] allow for some simple blit like transformations
[DONE] remove the device framebuffer from the plugin api
[DONE}ditto remote framebuffer
[DONE] remove _viewport_get_framebuffer you can call struct *vp = lcd_set_viewport(NULL) and vp->buffer->fb_ptr

while remote lcds may compile (and work in the sim) its not been tested on targets

[FIXED] backdrops need work to be screen agnostic

[FIXED] screen statusbar is not being combined into the main viewport correctly yet

[FIXED] screen elements are displayed incorrectly  after switch to void*

[FIXED] core didn't restore proper viewport on splash etc.

[NEEDS TESTING] remote lcd garbled data

[FIXED] osd lib garbled screen on bmp_part

[FIXED] grey_set_vp needs to return old viewport like lcd_set_viewport

[FIXED] Viewport update now handles viewports with differing buffers/strides by copying to the main buffer

[FIXED] splash on top of WPS leaves old framebuffer data (doesn't redraw)
[UPDATE] refined this a bit more to have clear_viewport set the clean bit and have skin_render do its own screen clear
scrolling viewports no longer trigger wps refresh
also fixed a bug where guisyncyesno was displaying and then disappearing

[ADDED!] New LCD macros that allow you to create properly size frame buffers in you desired size without wasting bytes
(LCD_ and LCD_REMOTE_)
LCD_STRIDE(w, h) same as STRIDE_MAIN
LCD_FBSTRIDE(w, h) returns target specific stride for a buffer W x H
LCD_NBELEMS(w, h) returns the number of fb_data sized elemenst needed for a buffer W x H
LCD_NATIVE_STRIDE(s) conversion between rockbox native vertical and lcd native stride (2bitH)
test_viewports.c has an example of usage

[FIXED!!] 2bit targets don't respect non-native strides
[FIXED] Few define snags

Change-Id: I0d04c3834e464eca84a5a715743a297a0cefd0af
2020-10-26 12:28:48 -04:00
Moshe Piekarski 12f3ed1699 make the plugin API frambuffer agnostic
Change-Id: I5abdc231093054c517ff53b9a456997e440e3f6e
2020-10-26 12:28:48 -04:00
Solomon Peachy 845e5a4f03 sonynwz: A10 and A20 series support high bitrates
Change-Id: I6b33368ed5d7800b79dafbb736e6ed079accbd25
2020-10-26 07:42:48 -04:00
James Buren c5d7cd5f9f h300: add support for ROM image generation
Change-Id: I6e0985de370609bae98ba6eab487bf43eb4191b6
2020-10-26 01:37:42 +00:00
Solomon Peachy 28b9c8bfeb rocker: Disable mute-on-pause, due to a platform kernel bug.
In short, the display fading back in after a pause resuming interferes
with the audio codec, causing BadThings(tm) that cannot be recovered from

This really is just avoiding a known trigger; there's no guarantee this
condition won't occur under random circumstances during normal use,
and there's no good way to work around this from within rockbox.

I suspect the underlying problem is that both the display control and
codec control share an i2c bus, but the kernel drivers implementing them
isn't using proper linux bus access/locking.

Change-Id: Id4f56f9cb269ed74aac2f041146b3630cef09030
2020-10-26 01:07:59 +00:00
James Buren bde72efa30 coldfire: make the RAM and ROM image locations configurable by macros
Change-Id: Ie27e39c34947b0391be621dafb8711c44e863a1c
2020-10-26 01:07:14 +00:00
James Buren 129001909d h300: enable support for iriver_flash
This also modifies the configuration file to include macros
defined in the H100 / H120 implementation.

Change-Id: Iae845889c98661ec548c04fc57e733dcc346c0f1
2020-10-26 01:07:14 +00:00
Solomon Peachy 39a0d8bf86 x3ii/x20/rocker: Fix volume scaling.
Change-Id: Ie70d709b4c18f16cdd67aa05d9183b4ace2e66b4
2020-10-26 00:12:54 +00:00
Solomon Peachy a8aa8403ad samsungyp: Enable recording feature. No idea if it works. :D
Change-Id: I48952f0551aaf1023f084e0be18354970d2492ed
2020-10-23 17:49:07 -04:00
Solomon Peachy 6834d1a02f xduoox20: Start unmuted, as the least-worst option
Change-Id: Ie85d9df0f861315dfc9d767218d86115420aa9d7
2020-10-20 17:07:48 -04:00
Solomon Peachy 6a94f1e995 sonynwz: Properly support multidrive, with hotswap of the SD card
Change-Id: I7eb8efb0986a395d5ffbcc06a54bb680e0b59e9d
2020-10-18 10:19:42 -04:00
Solomon Peachy 5f75c493e3 xduoox20: Remove a duplicate config option
Change-Id: Ieeacc8b42d2a4d1c647cfa3b0d00f90fe98af0ed
2020-10-17 22:52:48 -04:00
Solomon Peachy b1e21bbd7a hosted: Consolidate common config of hiby-based units into a common header
* Enabled MULTIDRIVE and ROOTFS_HOTPLUG for full hotswap!
   (Requires updated bootloader/integration!)

Change-Id: I7dad1f8d375e087c36fce37bec3e9184602ede50
2020-10-17 20:45:41 -04:00
Solomon Peachy d8d37ffdb8 Define a USB storage type, and hook it up for hosted targets
Change-Id: I56363c989139c7edf0b2c67b0aac9ef1adfacba2
2020-10-17 18:38:49 -04:00
Solomon Peachy 012908e064 hosted: Fix HAVE_MULTIDRIVE to work properly with PIVOT_ROOT
Change-Id: Ibc97de5c345e88c19ad8ba8c05fefebbada08790
2020-10-17 17:10:52 -04:00
Solomon Peachy a68fc3b6c2 xduoox3ii/erosq: Fix CPU frequency declared in header
(108 MHz -> 1008 MHz)

Change-Id: I2baf416689e2afb68948609e226df8c5feeecc4a
2020-10-17 17:10:52 -04:00
Solomon Peachy 2e07223690 m3k: Fixes for the M3K.
* Cannot turn off the LCD directly (have to rely on backlight)
 * Only insmod/rmmod the usb gadget modules if state changes

Change-Id: I9ea90177d496cd035ada93e04a93a7c6f2e84706
2020-10-15 14:11:41 -04:00
Solomon Peachy d544ce46a7 hosted: Unify the USB code for the hiby-based players.
* Specify exported USB VID/PID in target config header
 * Don't fail if the sd filesystem has already been remounted
   (ie due to platform hotplug)

Change-Id: Ifd2dae0c4f15086bf2bf89eb093018b3c4d2b75d
2020-10-15 10:18:16 -04:00
Solomon Peachy 1b449abf39 erosq: Add battery discharge curve and initial runtime estimation.
(playing mp3 with headphones inserted lasted just over 13 hours)

Change-Id: Id610f911811eafd914db20000ae860c75e0d8a93
2020-10-14 08:37:00 -04:00
Solomon Peachy 431caa4311 imx31: Work around an apparently not-quite-kosher abuse of CPP
(we were trying to foward-declare functions from within static
 initializer context.  GCC no longer accepts this)

Change-Id: I58f316ecc84c8ab45fffc054955727a55714b0a3
2020-10-13 15:48:31 -04:00
Solomon Peachy e91f89a410 xduoox3ii: Update battery curve.
Change-Id: I2cc04d696631ba887fa8943d94360f902bf12e85
2020-10-13 16:01:55 +00:00
Solomon Peachy 078c34e951 hosted: More PCM muting work
* Track mute state, only call hw if actual change is needed
 * Don't unmute in audiohw_postinit()
 * sample rate tracking fixes
 * erosq:  Don't start up muted

Change-Id: I004f787a4b7ea73c16b6ec9818ec29a12c89f46b
2020-10-12 15:33:32 +00:00
Solomon Peachy 141e91ef1f Hosted PCM: Rework auto-muting code a bit
* If AUDIOHW_MUTE_ON_PAUSE, no meaningful change
     * Unconditionally unmute on playback start
     * xduoox3ii:  Mute on sample rate change
     * rocker/xduoo:  Stay muted after startup

    This avoids the nasty "pop" on startup, without doing
    the full mute-on-pause stuff that causes unacceptable
    dropouts on the X3ii.

Change-Id: I2e3ee0bb8094e288f37a0acada86a80016ce5cac
2020-10-12 13:40:37 +00:00
Solomon Peachy e1bc36ca31 Turn on ROLO for M3K too
Change-Id: I7e1b2168a70605c5a138d83fd69e847fd02af4a4
2020-10-11 18:34:04 -04:00
Solomon Peachy db6f21e295 hosted: sanitize handling of HOME_DIR
* HOME_DIR is now either "/" or special "<HOME>"
   * target-specific "home dir path" is defined solely by PIVOT_ROOT
 * PIVOT_ROOT path is now defined in toplevel config files
 * Make Samsung YP-R0/R1 and SONY_NWZ use PIVOT_ROOT too
 * Do not prepend PIVOT_ROOT path if the path already has it!
 * Do not play these games for __PCTOOL__ builds

Change-Id: I3d51ad902a5f9cafe45ba15ba654f30f1ec6113a
2020-10-11 17:47:34 -04:00
Solomon Peachy 2a471e288c New port: AIGO EROS Q / EROS K
The Q and K have a slightly different case, but the hardware under the
shell is completely identical.

These models are rebadged versions:

 * Hifiwalker H2   (== Q)
 * AGPTek H3       (== K)
 * Surfans F20     (== K)

Other notes:

  * Significant improvements in the shared Hiby-platform launcher/loader
    * SD card can theoretically be hot-swapped now
    * Support external USB mass storage!
  * Some consolidation of Hiby-platform targets
  * Some consolidation of plugin keymaps

Todo/known issues:

 * Keymaps need to be gone over properly
 * Convert to HAVE_SCROLLWHEEL?

Change-Id: I5a8a4f22c38a5b69392ca7c0a8ad8c4e07d9523c
2020-10-11 16:37:17 -04:00
Solomon Peachy 6533d983ca hosted: Add ROLO support for hosted targets
Change-Id: I2d46a63ee8225a9d9d77dd80a06c418af78c260c
2020-10-11 14:18:42 +00:00
Solomon Peachy aabc8aca47 New port: FiiO M3K
Most credit goes to:  Roman Skylarov
Additional integration and refactoring by myself.

 *** COMPLETELY UNTESTED ***

Change-Id: Ia64c36d92e0214c6b15f7a868df286f8113ea27b
2020-10-09 12:41:18 -04:00
Solomon Peachy 4231c2c83f codecs: Add support for the 'VTX' ZX Spectrum chiptunes format.
This codec requires floating point.

Original author:  Peter Sovietov
Ported to Rockbox:  Roman Skylarov
Further integration and bugfixes:  Solomon Peachy

Change-Id: I781ecd3592dfcdbbc694063334350342534f1d6c
2020-10-09 11:39:25 -04:00
Solomon Peachy 914114fd21 FS13241: Get rid of the hacky hold switch emulation on the X3ii & X20
It doesn't work properly and interferes with the power button in the keymap.

Rework WPS keymap a bit to make single-tap power emulate lock.

Change-Id: I9d9b9b4adcea3764e6e427f484e051c9bab9d13b
2020-10-05 22:55:08 +00:00
Solomon Peachy 1916aca7f3 imx233: Enable 96/192K playback for all imx233 targets that have room
Change-Id: Ief00cc9243af3168f0c088520936137b64f3b581
2020-10-03 16:56:19 -04:00
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