Commit graph

11184 commits

Author SHA1 Message Date
Aidan MacDonald
fd568d90a4 m3k: don't use mixer controls for volume control
According to a forum user, there's an audible click when changing
the volume between -32 and -32.5 dB with some headphones. Fix this
by not (ab)using the DAC digital mixer for volume control.

The mixer only provides an extra -6 dB of hardware volume range,
so the only side effect is that software volume will now kick in
at -32 dB instead of -38 dB.

Change-Id: If24d9bc0058eff3c1a29aefb155a2e378522623c
2021-10-05 12:46:00 +01:00
William Wilgus
7c67a48332 Sansa E200v1 Bootloader attempt at enabling USB in boot loader
there is a 1MB free region that is used to load the firmware but we
shouldn't need that till after a USB connection

so here is my 2nd try

Change-Id: I2552db3a7fba019d7e7188984432f758ddafe548
2021-10-04 10:56:33 -04:00
Aidan MacDonald
75524a7eec Shanling Q1: default to USB force charging
Force charging must be set or the Q1 will not draw 500 mA from
an AC adapter (see 0ca0940f01).

Change-Id: I4ec6dc7728a5aa4d7f07580556efb960948c24a8
2021-10-02 16:14:17 +01:00
William Wilgus
a62fdf4751 scroll engine, allow clipped text in viewport
loosen the requirements on the scroll viewport allow clipped text

Change-Id: I7099d423ccfbd7bae12e6ba43b8a6b4b864175b7
2021-10-02 10:31:04 -04:00
Aidan MacDonald
3a89fdee96 x1000: fix hang that may occur in USB mode
Upon getting a USB reset, the USB core will update charging
current by calling usb_charging_maxcurrent_change(). On all
current X1000 targets this may cause a hang, since changing
the charge current involves a blocking I2C transaction.

Eg. if the host issues a reset when we're already configured
as part of error recovery, the change from 500 mA -> 100 mA
will cause a hang.

Change-Id: I5b45272c01fa16b179ae3d16bbc50c7fab9a416b
2021-10-02 15:09:46 +01:00
William Wilgus
95b10ac74e Add ability to dump cpu boost log to disk, include thread names
0.) B 0 /rockbox/apps/main.c:405
1.) B 1 /rockbox/firmware/kernel/thread.c thread[dircache]:1508
2.) B 2 /rockbox/apps/tagcache.c:4772
3.) U 3 /rockbox/apps/tagcache.c:4793

add logic to show count after log rolls over
clean-up

Change-Id: Ibda0a56e5d8d89aa8b7649f4f9fa64eb1ff0e08f
2021-09-30 21:13:22 -04:00
William Wilgus
b662ff945a Bugfix AS3525 usb driver unboosted the cpu without first boosting it
Change-Id: Id2d45870a9128b19ace0e8d5c16d3b3fa4b923dd
2021-09-29 01:17:45 -04:00
Dana Conrad
6d98c9e6b2 ErosQ Native: Adjust battery % scale
Adjust the battery scale to be a little better. I've set
the 100% (discharge) point to be where the battery sags to
when it is done charging but still plugged in.

Not quite sure how best to set the charge scale, it's just
equal to the discharge scale for now.

Change-Id: I9a2730c0b2051300af9eeddb4f67164f38a29002
2021-09-26 18:27:53 -04:00
Solomon Peachy
38b2648f48 win32: Add a stub for os_modtime() to make sim builds happy
Change-Id: Iea90776df2a92777c8e07c5a6b6635b6734d6690
2021-09-26 09:31:58 -04:00
Aidan MacDonald
672bbe434b usb: rename usb_drv_recv() to usb_recv_recv_nonblocking()
IMHO the current name is somewhat misleading:

- usb_drv_send() is blocking and we have usb_drv_send_nonblocking()
  for the non-blocking case. This inconsistent naming can only
  promote confusion. (And what would we call a blocking receive?)

- Other hardware abstraction APIs in Rockbox are usually blocking:
  storage, LCD, backlight, audio... in other words, blocking is the
  default expected behavior, with non-blocking calls being a rarity.

Change-Id: I05b41088d09eab582697674f4f06fdca0c8950af
2021-09-20 22:41:29 +01:00
Aidan MacDonald
99f333c64f usb_hid: fix accidental fallthrough
Successful SET REPORT requests would spuriously fail because of the
fall through to GET REPORT.

Change-Id: I8e7d1a1120afc6975d07d47b11c12c9e9ca51dd2
2021-09-20 17:38:56 -04:00
Dana Conrad
0ca0940f01 Make USB Charging default value configurable per device
A reasonable default assumption for a user
would be that they can plug their device into
a USB AC adapter and it will charge with as much
current as it reasonably can. With the previous
default, an AC adapter will only do 100mA, basically
a trickle charge.

Make this configurable default per-device, so as not
to break old devices without testing.

Define TARGET_USB_CHARGING_DEFAULT to USB_CHARGING_FORCE
to use the new default.

Tested on both erosQ Native and M3K.

Change-Id: I77265d356a41d67357ebc6e9f7e0c25a37b74931
2021-09-19 21:13:09 -04:00
James D. Smith
760277e096 Dir cache: Fix resume of relative path playlists.
Slightly modified from original patch by Fabrice Bellard.

Change-Id: I9ae04fa460f0f1b9c616e6f99505d4c5d4358f68
2021-09-19 21:05:58 -04:00
Christian Soffke
67c4231e34 iPod mini backlight initialization
Fixes backlight not turning on after booting (tested on an iPod Mini 2G).

backlight_hw_init() copied from iPod 4G.

Change-Id: I9c32ca5ecd3dc74ea997e6cb843da79d303b0615
2021-09-12 13:35:35 -04:00
Dana Conrad
17263a813b ErosQ (both): avoid clipping due to DC offset bandaid
Set the maximum volume on both hosted and native ports
to -2 dB.

Verified behavior here on native and by borkitall on irc
for hosted.

Change-Id: I3aebc2bb4b9294a4137a33694c83139c0d76099a
2021-09-05 15:50:21 +00:00
William Wilgus
cab8cea0f0 lcd_putsxyofs 16 bit lcd_mono_bitmap_part [AS] part duex
'Bugfix' mono_bitmap_part reads ahead in the buffer,
if the height is <= char bit pixels other memory gets read
found with [Address Sanitizer]

also g#3332 since this is clearly a problem across the code
instead place the check for height < 8 in the lcd_mono_bitmap_part function

second try places the check above the negative y offset
this was causing glitches on the Q1 and likely other TS targets
since a negative y was added to height it made it < CHAR_BIT setting
stride = 0 even though the bitmap was >= CHAR_BIT high

Change-Id: I13bb8ab472c2ae61302a6de5d9e2c78243354460
2021-08-26 20:19:26 +00:00
Solomon Peachy
b2386405b9 xduoox3: Disable bootloader USB mode entirely
It's not yet working and because all storage is removable (and the OF
works fine) it's of limited utility aynway.

Change-Id: I8a6a59ac16503d0f4574c3934f473cac54e86858
2021-08-26 11:59:01 -04:00
William Wilgus
dbd051394e Revert "lcd_putsxyofs 16 bit lcd_mono_bitmap_part [AS]"
This reverts commit 49edfc237b.

Reason for revert: font rendering bug, https://gist.github.com/amachronic/5fa75da280432127de4b44ee2d760281

Change-Id: I13b5f0eedb2926bce67051c8f0bb2ae5dea9f299
2021-08-25 13:05:02 +00:00
Aidan MacDonald
4cbb5b4201 x1000: trigger the virtual LED on disk activity
Change-Id: Ic129e79e0b192cb0c39e5f05ad602e0ea7a9213f
2021-08-18 23:17:07 +01:00
Aidan MacDonald
5a4cc8da3f Drop HAVE_RTC_RAM
Only Archos players ever used this feature and it isn't implemented
on any current targets.

Change-Id: I39c8455480a3fe33cd25b667e8d4d6ff3a092d3e
2021-08-15 20:41:58 +01:00
Solomon Peachy
cc6b036ef5 logf: Fix an incorrect fix in 835d0c737a
Change-Id: I060033d9a7cd54bab75e4f82e3de002bdb027af2
2021-08-15 09:03:16 -04:00
Solomon Peachy
25cebf2f85 Fix red from 04fe77a4
Change-Id: I13a7b067e60eabe27be1fe983a7cced3ae8b18e3
2021-08-14 17:56:15 -04:00
Solomon Peachy
04fe77a465 Remove the (very) incomplete port for the Tatung TPJ-1102
It was barely even a stub, and hasn't seen any development since 2009

Change-Id: I0aa15d9a7b90ae8c771924d9f401380d4cc0fab9
2021-08-14 16:29:39 -04:00
Aidan MacDonald
786d06742a Remove Samsung YP-Z5 port
It has only a couple GB of onboard flash storage with no storage
driver in Rockbox. It hasn't seen any meaningful development since
its initial commit, it's not on the build farm, and the bootloader
build is broken by other refactoring.

Change-Id: Idd9e3c46fac9b96f416ce444182f97a50770e747
2021-08-14 14:13:54 +01:00
William Wilgus
2df306923a file_internal.c guard file_cache_reset() from null pointer
I feel this is probably unlikely to be called with a NULL pointer
for cachep but being that we are already doing the check why not
guard file_cache_reset as well

Change-Id: I1a13767ef28a4129ae3513f7aa999fb6c1d6fad8
2021-08-13 06:32:44 -04:00
Dana Conrad
6de6e1459d Eros Q Hosted: Apply DC Bias to PCM Data
Similar to the native port, the hosted port benefits from
adding a -1 dc bias to the PCM data. This prevents almost
all clicking artifacts.

Change-Id: Ic6378716774b6d88df23c476e2ef54d49f33dc72
2021-08-12 10:07:49 +00:00
Dana Conrad
77a98ada12 Eros Q Native: Make Mute logic channel-independent
An oversight on my part meant that setting channel balance to
100% L or 100% R would mute both channels - this logic will
prevent that.

Change-Id: I912c2745784fbbbd7a773e1234179801f2ca4680
2021-08-10 18:15:53 -05:00
James Buren
e4c5b082e8 inflate: fix public function pointers
Change-Id: I7f1273b832a04a7d7c1b386c08c17438e3d93fc2
2021-08-09 16:25:43 +00:00
William Wilgus
275c762bb2 As3525 wavpack_enc document some intentional switch fall through
Change-Id: I56bf439df2c05653d65f49238e886e4ef2291176
2021-08-08 09:27:27 -04:00
Solomon Peachy
39fff5cb53 move PCM_NATIVE_BITDEPTH definiton into global config code
Change-Id: I391bcffca670916c2c88426e2ba2603351326cee
2021-08-07 11:18:19 -04:00
Dana Conrad
a2bbd1a549 Fix warnings from 56b0dde545
Need a default bit depth in pcm-x1000.c

Change-Id: I2c6af227975d2f47609b51090638012d8406ec1e
2021-08-07 09:43:17 -05:00
Dana Conrad
56b0dde545 Higher bitdepth software volume scaling
Operates between 0 and -74 dB (mute) without issue

Change-Id: I497e002bd8db43833a09ebbc29212fbb6cc8ebfd
2021-08-07 14:21:47 +00:00
Dana Conrad
16b0098256 ErosQ Native: Add DC Offset to PCM data
A small negative offset seems to silence all
play/pause clicking on the PCM5102A.

Also adding PCM soft muting, and muting the headphone amp
when the headphones are detected as removed. This has been
tested to not cause any unintended side effects on the
line out.

Also confirmed the numerical dB values are (approx.) correct.

Change-Id: I689d68887c86add9cc5e0ccb0c7de01aaa69b4d9
2021-08-07 14:21:47 +00:00
James Buren
60933d98c6 inflate: import initial module for deflate decompression
This will eventually be used by the ZIP module and other things
that support DEFLATE based streams.

Change-Id: I4acc9561eb56c9c368d1defab9c14e0454d105e1
2021-08-07 03:03:27 +00:00
Aidan MacDonald
1a9a5fc279 Fix wrong printf format in system-hosted.c
Change-Id: I73722f0711a295152a98ab784cd6cf76379ef52e
2021-08-06 18:23:17 +00:00
Aidan MacDonald
b8b195a296 Fix hosted glibc backtrace
According to backtrace(3) man page, the string returned from
backtrace_symbols() contains the return address so we shouldn't
need to print it ourselves.

Change-Id: Ia779207285c9ea0052b9aee3d84ee8380bf46d82
2021-08-06 18:54:34 +01:00
Aidan MacDonald
34fcea0b20 Fix path buffer overflow in screendump
Overflow is due to a hidden assumption in create_datetime_filename()
and create_numbered_filename() where buffer must be >= MAX_PATH bytes.

Change-Id: I9d36517d861b6925352380d551afc5439edbb340
2021-08-06 15:46:53 +00:00
Solomon Peachy
835d0c737a logf: Fix two issues with logf_panic_dump()
* It had a (read) buffer overflow when dumping the stuff on the back half of the buffer
 * a highly questionable code construct was nuked

Change-Id: I7f6f119524fc2095f788fc9b3d356459955d3ace
2021-08-06 10:08:00 -04:00
Solomon Peachy
f3010c6a8e hosted: Fix rtc_write_datetime() error handling
(if mktime() fails, don't attempt to write its result to the RTC)

Change-Id: Ib09b8dccafdef032119db76f10af74dfc220cc21
2021-08-05 13:44:11 +00:00
William Wilgus
cb6b0d2c0e disk.c ensure a valid volume is returned from get_free_volume()
volume is used for element math and indexing into buffers
-1  volume is bad

Change-Id: I1ec75ef3a848c154ea80905224ea9a3a14bf8151
2021-08-05 11:01:29 +00:00
Aidan MacDonald
005c414e5f Document intentional fallthroughs + fix harmless unintended ones
Change-Id: I1ca5b1027ec30cbf61093bab35b980196ed14e6b
2021-08-04 18:59:46 +00:00
Solomon Peachy
37bfcab23f powermgmt: Clean up some convoluted #ifdefs
Makes it more explicit what code is used under which circumstances.

Change-Id: I0a482dd48e1eb4b119ca6d8dca2b8aa450445fd1
2021-08-04 09:39:37 -04:00
Dana Conrad
a2fd00cf38 Software Volume: Remove sample rounding
Change-Id: I630139333d64b4c8cae86939ecfc52c44a34ffea
2021-08-01 02:20:00 +00:00
James Buren
fad4c75163 crc32/adler32: add full copyright notice to source files
Change-Id: Ifa04be9a6e419772c18b21e81fe1f246f4248af7
2021-07-31 01:30:39 +00:00
James Buren
f32fc84ef6 adler32: import adapted implementation from tinf/zlib
This adds an adapted version of the adler32 algorithm from tinf/zlib
which will be necessary to support ZLIB deflate streams in the future.

Change-Id: Ie60e15acb288acf56a2d44e3d3e912e1b3eb2216
2021-07-30 23:11:49 +00:00
Solomon Peachy
7318d393ea libc: atoi() is supposed to return 0 if handed a NULL pointer
Change-Id: I2d77532536ca83e5c9c2d7622a0e672082969f75
2021-07-30 01:41:13 +00:00
Aidan MacDonald
05d4d6a4f2 Fix remaining yellow from e532714d1f
Change-Id: If0bdd1fb3c8ee3324562638bc4c4181357a8fd53
2021-07-25 14:36:47 +00:00
Aidan MacDonald
148fac6f34 Fix yellow from e532714d1f
Change-Id: I4f49e93fc1efa78874fb76de6a436ad1fc894cc5
2021-07-25 15:22:33 +01:00
Aidan MacDonald
e532714d1f pcm: Remove unused function pcm_play_dma_get_peak_buffer()
Change-Id: Ifd20fb14a22489cdb99154c01f69809a1e70d0c5
2021-07-25 14:07:41 +00:00
Solomon Peachy
cb92280eca usb_storage: Fix a memset in SCSI_INQUIRY that overflowed its buffer
The funny thing is that the memset() for the field in question was
redundant, as the overall inquiry structure was memset(0) already.

Change-Id: I8bec0c93c9317823ff39cf7133535e3bf58fb987
2021-07-23 00:26:35 +00:00