Commit graph

35300 commits

Author SHA1 Message Date
William Wilgus
557ff6a981 lua print_button script
also allow splash_scroller to be used as static text display

Change-Id: Idc8c9e60ada920e2d1abd5301b59bd235e21a1c2
2021-04-24 00:00:44 -04:00
William Wilgus
14c6bb798d Sync opus codec to upstream git
Change-Id: I0cfcc0005c4ad7bfbb1aaf454188ce70fb043dc1
2021-04-23 14:23:04 +00:00
Solomon Peachy
75d9393796 rockboy: Properly fix the GCC11 code style warnings.
Change-Id: I69c77717604051052288a2d0f3aab068516d18ef
2021-04-23 09:25:47 -04:00
Solomon Peachy
aab72f969f ata: Rework power management behavior a bit
After continued reports of corruption using iFlash adapters, I went
digging for more clues, and this combination of changes seemed to
solve data corruption with the iFlash adapters on the ipod video:

 1) Instead of SLEEP, use STANDBY_IMMEDIATE when we detect drive
    as an SSD or CFA-compliant device.  The latter is technically higher
    power than the former, but what this means in practice is unclear.
 2) Don't check ATA powermanagement flag prior to issuing powermgmt
    commands. This reverts the previous "workaround" for the FC1307A --
    and PM is a mandatory part of the ATA spec for any CFA device.
 3) Prior to issuing SLEEP/STANDBY_IMMEDIATE, issue FLUSH CACHE.  The
    ATA spec says this is redundant for the latter, but says nothing
    about the former.  Either way it is always safe to call first.
 4) Delete all other FC1307A_WORKAROUND code related to powermgmt flags.

Change-Id: I492d06664c097d9bbd5cccfb9f5b516da165b1ee
2021-04-23 13:07:45 +00:00
Solomon Peachy
0271c0ed36 rockboy: Upstream code style trips GCC11 warnings.
Code in cpu.h is correct, so just disable -Wmisleading-indentation for
the specific sections that matter.

Change-Id: I378f3a6fef117ac73edb0d8ce998ef3a818be22e
2021-04-23 08:45:33 -04:00
Solomon Peachy
ebb9090004 xzbox: Fix misleading indentation that triggered GCC11 warnings
Change-Id: Ice462ef188dba3bc8ffc46c32142fc29d70e1a68
2021-04-23 08:42:10 -04:00
Solomon Peachy
03695429cf blackjack: Fix warning triggered by GCC 11
Change-Id: Ifcba0caf059bfa9f833893a1dbf0dc7a1c9b3e61
2021-04-23 08:40:57 -04:00
Solomon Peachy
39939a164b Promote FiiO M3K (native) to "unstable"
Now nightly and voice builds will show up.

Change-Id: Ibeddb08535ecc5ce913de2cb4d42ae458e88964d
2021-04-23 08:01:31 -04:00
James Buren
f968d6032a ipodpatcher: fix warning for apple stop sign constant
Convert both instances of the apple stop sign constant
to char array instances. This ensures sizeof will work
as expected when applied to the constant.

Change-Id: I8599f7b0a00031e944e654b12a0bc59309926807
2021-04-23 01:01:31 +00:00
Aidan MacDonald
79d1b68fe2 FiiO M3K: disable USB DMA
Although data transfer is reliable with DMA, it seems to cause hangs
and lockups during the early stages of connection and it's not clear
what the cause might be.

Change-Id: I9a83089c31d28309f0534dcdedf3c8c8348e6e3d
2021-04-23 00:30:52 +01:00
Aidan MacDonald
a544c8467d FiiO M3K: increase bootloader font size
The default font was very small and hard to read.

Change-Id: Id6d8ec49a700dcad65903b92c09ec42840c1f6e5
2021-04-21 18:32:10 +00:00
Aidan MacDonald
75cb8ba8a4 FiiO M3K/X1000: add USB support
This only required a minor patch to the usb-designware driver due
to DMA requiring physical addresses -- on the X1000, these differ
from virtual addresses so we have to do the usual conversion.

Both the mass storage and HID drivers work, but there are a few
issues so this can't be considered 100% stable yet.

- Mass storage might not be detected properly on insertion,
  and USB has to be replugged before it shows up
- HID driver may occasionally panic or hang the machine

Change-Id: Ia3ce7591d5928ec7cbca7953abfef01bdbd873ef
2021-04-21 18:31:55 +00:00
Aidan MacDonald
088ebb5fac Minor enhancements to axp173 driver
- Added register names to reduce usage of magic numbers
- Added function to control max charging current, needed for USB
- Corrected comment about axp173, since FiiO M3K has an axp192

Change-Id: I6604ce8d44e5a2ee84061cf042d17ccc4734ac57
2021-04-21 18:31:55 +00:00
Aidan MacDonald
f6d3680cb8 Make sure battery menu is shown if it contains settings
The #if statement didn't reflect all menu items in the battery
menu, so if the USB charging enable setting was the only one
present, the entire menu would be hidden.

Change-Id: I17a4ed626debf1f61ca140d67d477bdbd52ca180
2021-04-21 18:28:09 +00:00
Aidan MacDonald
9313274302 FiiO M3K: fix LCD weirdness when booting via RoLo
Change-Id: I2234a0d1b3095adbcca0bbd060fd5a7e13a895c1
2021-04-21 19:10:34 +01:00
Solomon Peachy
27b44bca73 configure: Get rid of the unused NOISEFLOOR option in voicefile generation
Change-Id: Id3b281e62487858120aae97cd5ee0ef888cf89a0
2021-04-20 08:50:06 -04:00
William Wilgus
acda37edd1 lua print table put_line a do_menu alternative
add stylized lines to lua

the exported do_menu has a severe limitation of 64 items
it also requires double the memory

put_line is the way rockbox builds menus

update printtable

user config from core -- done
code cleanup
fixed for 1-bit screens
changed button behavior
fixed for 2-bit screens

Change-Id: I4de55e42685aa1d2f53a33bc8e980827864e810b
2021-04-20 03:30:41 +00:00
Aidan MacDonald
c71a47f649 Move usb-designware out of ARM target tree
Change-Id: Ic981737976655596ea622b7b4d15a2d841bd993d
2021-04-18 18:45:28 +01:00
Aidan MacDonald
92140752d7 FiiO M3K: disable CPU frequency switching
After conducting some simplistic tests, I found that the power usage
did not appear to be affected by the CPU frequency.

I tested by playing back a 44.1 KHz FLAC file on single track repeat,
and measured current with the AXP173's battery discharge current ADC.
The button and LCD backlights were set to always on. Headphones were
unplugged and the volume was muted to eliminate any influence from
the headphone amp.

On average the current usage was between 78-81 mA at 1008 MHz, 252 MHz,
and 112 MHz. If anything, 1008 MHz drew _less_ current than the lower
frequencies, by about 1-3 mA.

A possible explanation for this, assuming it's not just a bias of the
test, is that the CPU idle state saves so much power that it's better
to maximize the real time that the CPU spends idling. More systematic
testing is needed to confirm this.

Change-Id: I527473e8c4c12bc1e94f8d4e849fecc108022abe
2021-04-17 20:24:36 +00:00
Aidan MacDonald
fceffb7d4a x1000: disable CPU idle stats by default
There's no point including this in normal builds: the stats are not
used for anything, they are not really of interest to anyone except
developers, and add a small overhead to the kernel tick.

Change-Id: I1b4f67cc62d11d634a8cec279dca513dd10eea96
2021-04-17 20:24:21 +00:00
Aidan MacDonald
01d1eb4258 FiiO M3K/X1000: Do system clock initialization in the SPL
Initializing the clocks in the SPL brings Rockbox in line with
how the FiiO M3K's original SPL works. It's likely other X1000
devices do this too.

There was a logic error in the previous setup: the code falsely
assumed that DDR memory would always be running from MPLL, but
it would be switched to APLL by the bootloader. Rockbox would
then try to re-init APLL, albeit with the same parameters. Maybe
this was the cause of the boot hang on some units.

Change-Id: I64064585e491bbdf1e95fe9428c91a9314f2a917
2021-04-17 20:24:07 +00:00
Aidan MacDonald
e123c5d2f2 x1000: don't reset all GPIOs at boot
What we really want is to avoid any interrupts being generated
before the drivers which handle them are properly initialized.
Intead of trashing all GPIOs, search for the problem pins and
fix them, leaving the others alone.

This fixes the M3K's button light flickering on boot and should
stop the M3K from entering a potentially confusing "dead" state
where all the lights are off but the CPU is still on.

Change-Id: I13a6da0f0950190396bff5d6e8c343c668e8fea1
2021-04-17 20:23:47 +00:00
Aidan MacDonald
b41d53792c jztool: New utility for installing a bootloader on FiiO M3K
At present, this is just a command line tool for Linux only.

Integrating this with the Rockbox utility and porting to other
platforms should be straightforward; the README contains more
information.

Change-Id: Ie66fc837a02ab13c878925360cabc9805597548a
2021-04-17 20:23:19 +00:00
Aidan MacDonald
1b8542490d x1000: Redesign SPL, and allow it to flash the bootloader
SPL is now designed so core X1000 code is in control of the boot,
under the reasonable assumption that the device boots from flash.
It should not be too hard to adapt to other X1000 ports.

The biggest functional change is that the SPL can now read/write
the flash, under the control of a host computer. The SPL relies
on the boot ROM for USB communication, so the host has to execute
the SPL multiple times following a protocol.

Change-Id: I3ffaa00e4bf191e043c9df0e2e64d15193ff42c9
2021-04-17 20:22:49 +00:00
William Wilgus
85fbbd9c7f 16 bit lcd_mono_bitmap
'Bugfix' mono_bitmap_part reads ahead in the buffer,
if the height is <= char bit pixels other memory gets read

Change-Id: I6e0d7a9017e1f9c371ffbd56af149ac20cb82341
2021-04-17 15:33:58 +00:00
Aidan MacDonald
afe80742a5 Fix Pictureflow bugs
It turns out that aa_cache.buf, used to store decoded album art during
background scanning, was not correctly allocated and overlapped with
memory allocated for buflib. This was what caused all the segfaults.

Also fixed a logic error in read_pfraw(), which returns a buflib handle
on success, but also returned 0 on failure -- since 0 is a valid buflib
handle, it should return -1 on failure instead.

Change-Id: Ifaa1c02ec19b0859e43c40c0462ed7738d07fec3
2021-04-17 13:06:29 +00:00
Dana Conrad
4dc602dd7f erosq: Tweak volume scale to be approximately correct
Tested on eros q, everything measured from line out,
open circuit.

- volume steps were approximately double the dB they
  were labelled as, so "-2 dB" would result in a change
  of about -4 dB from maximum (0, +6.2dBV)
- maximum volume defining the line out volume only
  changed every 10 values, and then was not close
  to correct- "-10 dB" resulted in -2.5 dB from maximum

This gets the volume dB approximately correct, and
maximum volume correctly sets the line out volume.
I was unable to get odd values in the max volume
to work, so set the step size to 2 instead of one.

For "consumer level" (-10dBV), set to -16.
For "Pro level" (+4dBu -> ~1.8dBV), set to -4.

Change-Id: I898b85d768153579a893b23551019af88f865d21
2021-04-17 12:09:19 +00:00
William Wilgus
a9d3e9a13d The Matrix plugin -- Bugfix
Off by one errorS in the matrix plugin

might even say its the matrix plugin re-loaded

Change-Id: I2bc7487615a9e28fcd1d170961fb0b5ee6da6af7
2021-04-16 10:10:15 -04:00
Solomon Peachy
42dba708e3 hosted: Don't open alsa control device directly
It was just being used as a proxy "yeah, we called hw_init()" so
just use a flag for that directly.

affects rocker, erosq, xduoo x3ii/x20, and fiiom3klinux

Change-Id: I14bd9f8d91f1d6cc8de0982a7426e2a103c6bfce
2021-04-14 01:39:57 +00:00
Solomon Peachy
ec4b5c794e ibasso: Found a reliable way to determine if SD card is present at startup
Change-Id: If02788a50e141cc2e5b1a6cde2df2a5ef5713e30
2021-04-13 14:28:30 +00:00
Solomon Peachy
c0a49d9bdf ibasso: Default to assuming the external SD card is inserted
Detection at startup is proving to be unreliable.  Even if card is not
present at startup, upon insertion it will sort itself out properly.

Change-Id: I9ee90b724c90c530a39264f698c200a48aa72b1d
2021-04-12 21:54:59 +00:00
Solomon Peachy
b6fce99046 ibasso: Implement proper PIVOT_ROOT filesystem access
Including direct use of the external SD card mount

Known issue:  If SD card is inserted at startup, it must be
              ejected and reinserted to be registered.

Change-Id: I5f420160bda32135cbb088c1e8b04b6e3a73018e
2021-04-12 18:19:06 +00:00
Solomon Peachy
e4345f2db8 build: Make the lang.h and genlang.h depend on the genlang tool
(So if genlang is updated, regenerate the language headers)

Change-Id: I1de94eff609b27788db4f08e2d99992b8f360849
2021-04-10 22:59:28 -04:00
Solomon Peachy
6ae2b7140c Fix red in bc416ff590
Most of it was due to checkwps breaking, the rest was m68k with radios.

Change-Id: I8a00e094e4006a132932f05e6c4ff7db63dfbfc8
2021-04-10 21:06:41 -04:00
Solomon Peachy
bc416ff590 misc: Only include rbpaths.h and string-extra.h in places that need it
(Don't include rbpaths.h in settings.h, or string-extra.h in rbpaths.h)

Build-tested on rocker, erosq, mini2g, nano2g,
                xduoox3, clipzip, dx50, and uisim

Change-Id: If32e9c9910f5c8247a655cb64522b84d6d7ccbb5
2021-04-10 12:08:12 -04:00
Solomon Peachy
1303be3437 ibasso: Get rid of #include "settings.h" in the button code
(It mucks with paths causing the input device open to fail)

Change-Id: I1e8a63d09c229ed9bacbd599a7869e875df21fd2
2021-04-10 10:25:20 -04:00
James Buren
448f98d9c0 pp: fix adc mistake where base 10 was used instead of base 16
Change-Id: I8562af8a11a22cd9edec149b2519ac0205d2b2dc
2021-04-10 01:13:09 +00:00
Solomon Peachy
13dbcab6c0 erosq: When mucking with the clickwheel, ensure we keep the screen awake!
Change-Id: I49d39f301f4b44c2477a657e2af964b97d73cf6b
2021-04-09 19:21:02 -04:00
Solomon Peachy
cd64aa2b10 xduoox3: Global volume_limit now applies to the line output as well
The X3's line out is a bit hot, at ~4.3Vpp, so allow it to be backed off.

(On my X3, backing it off to -6dB brings Vpp down to ~3.4V)

Change-Id: Iea38ef1c6a1b183d0f8fb4eaf2bf9ed6b350a532
2021-04-09 15:54:04 -04:00
Aidan MacDonald
10facef17b Skin engine: respect volume decimalization
This is basically the same problem as FS#13272, except it happens
on certain themes, eg. rayboradio. The issue only affects targets
with decimal volume levels.

Tested the fix using the rayboradio theme on the FiiO M3K and the
Fuze+ simulator. Volume was displayed correctly on both.

Change-Id: I9e035f7a3c04c85c9b3b01243c7f0a5f8f0ccf9f
2021-04-09 10:53:44 +00:00
Aidan MacDonald
9847f9c85e x1000: don't add pointless '1' after SPL signature
I added this because it is present on the FiiO M3K's SPL, but nothing
in Ingenic docs suggest this means anything.

Just get rid of it; the M3K boots fine without it.

Change-Id: I2e480b8c0ada386b0e772db49c0a7ebd32ffc7ea
2021-04-09 10:53:36 +00:00
Aidan MacDonald
c0a823e2ab x1000: Trim unused cache functions from the SPL build
Change-Id: Ib645d8ff10cfc672de8ac2debaa17d7dd50dfafb
2021-04-09 10:53:36 +00:00
Aidan MacDonald
54b8e9131c Revert "sound: add sound_numdecimals() to round out the sound setting query API"
There is already a sound_numdecimals() function, according to Git
it's been around since 2005. No need to add another one :).

This reverts commit 92a0ab8789.

Change-Id: I533ebf1763dd7a27346842982493d4550f05ad7c
2021-04-09 10:52:02 +00:00
Solomon Peachy
1e2a9a651c erosq: Switch to 32-bit PCM output, and do volume scaling in driver
Should improve audio output quality, especially at lower volumes.

Change-Id: I31c38f05fe4b554b092511f0fe7aaad9f346f6c5
2021-04-08 23:58:49 -04:00
Solomon Peachy
e86d90905b alsa: Fix an #ifdef typo in 54fcb907c1
HAE_ALSA_32BIT -> HAVE_ALSA_32BIT

Change-Id: Icf375d42f6b20e8393b6ffe6d23b3ac96abb571b
2021-04-08 23:10:41 -04:00
Solomon Peachy
54fcb907c1 alsa: instead of per-target tests, use HAVE_ALSA_32BIT
Affects all Sony NWZ (linux) and the fiio m3k linux targets.

Change-Id: I2fcf121bd026103d2b72332a5a52cc2b5e93949f
2021-04-08 23:02:15 -04:00
Solomon Peachy
e17337c9aa ErosQ: fix panic on startup caused by ad55da5f
It turns out #include "settings.h" pulls in rbpaths.h which ends up
remapping open() to the path-mangling rockbox open().

By defining RB_FILESYSTEM_OS we prevent the remap.  My mistake for not
testing this before committing!

Change-Id: I2978eb7b413693c4cb887b7ac7b2457780db7d25
2021-04-08 21:58:08 -04:00
Dana Conrad
ad55da5f87 ErosQ: Set Line Level Output volume
With a full-scale 440Hz tone, the line out voltage
measured approx. 5.8Vpp at the 0 setting. WAY too hot!
(9 dBV, in fact)

For 0.894Vpp (-10 dBV - consumer devices), -18 appears to be
about right for line level signals, but for "pro" equipment
a different level may be desired.

Therefore, the user to cap the line out level by re-using the global
volume limit setting.

Change-Id: I0d1d6482ea95537e9a2d00884eaee2713771c614
2021-04-08 14:37:14 -04:00
William Wilgus
c77cd7027f lua print_table add ability to draw a line separator
allows you to draw a line between items

Change-Id: I7e6e2f56738e12ff06d06a24f0f9d0769932a7b1
2021-04-08 04:15:40 +00:00
Solomon Peachy
f8ce18c286 Update the english-us "translation"
Change-Id: I306fe06628ceee4efb6913cf0d4744a7fc8e814f
2021-04-07 21:50:28 -04:00