Commit graph

10868 commits

Author SHA1 Message Date
Solomon Peachy
26bebd77ab Fix more red.
Change-Id: Id1a45b420f8eb70a25010b058822b78f80db33d8
2020-10-13 19:45:03 -04:00
Solomon Peachy
09785a8499 fix more yellow
Change-Id: I74bad58707d05ea167169d4315c05eb0cd1c8b7b
2020-10-13 17:23:56 -04:00
Solomon Peachy
b94db707fb Fix more warnings.
Change-Id: Ib3a9fc622a46b1fc72e94dcbc6d29d2e430cd81b
2020-10-13 15:48:31 -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
f8bd54d575 iaudiox5: Fix red, due to slightly bogus asm
Change-Id: I6ebcda3452d4244b5e2d1a9bbeb9fff9a9456388
2020-10-13 14:18:35 -04:00
Solomon Peachy
4a3d046545 Fix a pile of yellow in the bootloader
Change-Id: Ia89a33bbb13683566e421ac2a002baa20cdb07de
2020-10-13 13:37:21 -04:00
Solomon Peachy
e91f89a410 xduoox3ii: Update battery curve.
Change-Id: I2cc04d696631ba887fa8943d94360f902bf12e85
2020-10-13 16:01:55 +00:00
Solomon Peachy
688575368c rocker: Fix red introduced in 01dc81c
Change-Id: I08169395702b74f8ea6cd939520c69745ae8b876
2020-10-12 11:48:07 -04:00
Solomon Peachy
17244177ee hosted: Fix a corner case in umuting the x3ii and erosq
Change-Id: I3ffc3b82c6137bab3f27cd87ccc57c2f03a1d401
2020-10-12 11:46:05 -04: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
01dc81cd94 rolo: hosted: Make display output non-glitchy
Change-Id: I63d6a28d67fa56d3541aaa121356c8ff2ce10bbe
2020-10-12 11:16:15 -04: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
135b3f6416 Fix inverted test that made SDL_APP unhappy
Change-Id: I18a51ddd0fa7fd0afda938c732fadce4cd87c262
2020-10-11 18:35:55 -04: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
Amaury Pouly
76fbb33adf nwztools: fix MW-WM1/A30 KAS, fix KAS length
Split WM1A/WM1Z because they don't have the same KAS. On newer devices, the KAS
is actually 64 bytes, not 60. The strange thing is that "get_dnk_nvp kas" returns
60 bytes whereas "get_dnk_prop kas" returns 64, not sure why.

Change-Id: I944d3d838209ba58388439af0cdf5d7c74f1f7fc
2020-10-11 13:08:03 +02:00
Solomon Peachy
5cfd3ae4e6 hosted: Use O_CLOEXEC for all open() and "e" for fopen() calls
This way we'll automatically close the files upon exec()

Change-Id: Ic0daca8fb56432830de4a2f4a86a77337121ecc7
2020-10-11 01:47:03 -04:00
Solomon Peachy
4b10aacbc2 xduoox3ii/x20: headphones take precedence over line out
so if both are plugged in, assume headphones (and respect volume)

Change-Id: Ia77ae6d484ac61f6a2b4cd51a991f59de239cfa6
2020-10-09 20:52:43 -04:00
Solomon Peachy
6c6642e8d5 m3k: Fix red bootloader build
Change-Id: I3a6e9e6222e6219484c6903325c985bff8af39ef
2020-10-09 19:54:49 -04: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
88b2a45b5f xduoox3ii/x20: Define a sane BUTTON_LEFT/RIGHT alias
Change-Id: If11dfa50aeb8cb8b80de730c494d81a9e87880c4
2020-10-09 12:15:43 +00:00
Solomon Peachy
7a1bf01541 Undo the hacks that allowed targets without LEFT/RIGHT (UP/DN) to build.
Replaced them with warnings until they are fixed *PROPERLY*

Change-Id: I4425200e60f8b5224262a54f105b974cec471d22
2020-10-08 20:30:08 -04:00
Solomon Peachy
dc81f96fd1 Don't compile audio codecs into native bootloader builds.
Change-Id: I0b2cc143572bf88423bdf7647cee0af567aee684
2020-10-08 19:20:50 -04:00
Moshe Piekarski
2e2e899869
more DEBUG build fixes
Change-Id: I4ae2b79f53ce59c37ccc9ef06f5ebd145e988763
2020-10-07 00:01:07 -05: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
f3ae48f552 hosted: control buttonlights along with the display backlight.
Change-Id: I03385db46e94ca1bb6a4e35c89f630145c9d40e5
2020-10-03 20:12:31 -04:00
Solomon Peachy
7642184fd9 alsa: Refactor pcm_dma_apply_settings_nolock()
Change-Id: I32190e6987afca99b24197ca7ae2853053062d30
2020-10-03 20:12:31 -04: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
c1d4bf290c coldfire: Fix iAudio M5 build
Change-Id: Iecbcfa16918be3abfaab0936a0dae9c9ed48933e
2020-10-03 16:56:19 -04:00
Solomon Peachy
d5167b1221 coldfire: Allow building when 88KHz audio is disabled
Change-Id: Ieeacf591ad4233428dca99c347043e61abae1d1f
2020-10-03 15:57:38 -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
2e708c48c5 pcm: Dynamically-size the mixer buffer at higher audio bitrates.
Basically, existing sizes apply for <= 48KHz audio. Up to 96K,
we double the mix buffer.  up to 192K, we double it again.

Will help reduce the interrupt load and overall latency, keeping it
roughtly constant as a function of time, regardless of bitrate.

(It is acutally a fixed-size buffer, statically-allocated to handle the
 worst-case bitrate the player supports. However, at runtime if we are
 using a lower bitrate we will only use a portion of it in order to keep
 latancies down)

Change-Id: I61ca23180a86502732b0903fe9691c1a8c2aeaea
2020-10-03 14:19:17 -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
d18157608d xduoo codec cleanups
Change-Id: I6c3437bde2d9f781a02ffc6b3a83148b9a7af872
2020-10-03 14:41:21 +00:00
Solomon Peachy
1824f8b103 xduoox3ii/x20: Rework the mute control to actually function properly.
(By switching the output away from the audio jacks)

Change-Id: Ib8511c9d45029bba038dc4d1d187174d56cb3043
2020-10-03 04:13:13 +00:00
Solomon Peachy
90c30bc7ef alsa: Explicitly mute the output when we stop playing, and unmute after playback starts
Allows us to avoid hearing the codec powering on and off.

Change-Id: Idaaff437932009952ed248be97eedf54cb4cf28e
2020-10-03 04:12:51 +00:00
Solomon Peachy
c7eceea183 alsa: Handle underruns when starting a new stream
Unsure why this is happening, but now we detect and recover errors at
startup.

Also clean up the mismash of printf(), DEBUGF(), etc in favor of panicf() for the really serious stuff and logf() for everything else.

Change-Id: I9aaa620d55d556645c9a6d108541b987983b32a8
2020-10-03 01:04:53 +00:00
Solomon Peachy
b0e1b245b4 alsa: Use larger playback buffers for higher bitrates
(existing ones apply up to 48KHz, scale up linearly to 192KHz)

Change-Id: Iac32d49b8073b63a5d40fd21f41437e6051cb8de
2020-10-02 09:50:38 -04:00
Solomon Peachy
90af40e90c imx233: Hardware codec supports up to 192KHz. Make it so!
Change-Id: If08a1d244f28092a5d5332d666fb9afdc78f35a9
2020-10-02 09:50:38 -04:00
Solomon Peachy
9892e468d5 hosted: Don't use O_SYNC for the framebuffer handle.
Change-Id: Iff4b1947fe053313d677b894c78250760aaef967
2020-10-02 09:48:59 -04: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
9ee618e889 hosted: Fix overzealous spamming of backlight and lcd enable
This caused random delays in LCD activity, and also caused key inputs to go nuts

Change-Id: Ie483c86f7461455308f8c5f8999df313521c6b55
2020-10-02 02:24:42 +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
db22dae2f9 fix more red.
Change-Id: If5fee31d633e5f75272ba85f5293ad01b1ce573a
2020-10-01 16:39:37 -04:00
Solomon Peachy
a96eb1a7f7 Fix warnings and errors introduced in b030bf5
Change-Id: I23966b6a79c0d2cbab2e01c649c1b991f460d8ad
2020-10-01 16:08:20 -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