Commit Graph
100 Commits
Author SHA1 Message Date
jacqueline a6f8468ad5 Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fw 2024-04-09 11:46:12 +10:00
jacqueline e5c6ffdb8b Unmount storage when there's a bad error 2024-04-09 11:44:20 +10:00
jacqueline f93e3c1c69 fix some struct defaults in low-level drivers 2024-04-09 11:19:41 +10:00
jacqueline 6e73f1a22e Upgrade fatfs component version 2024-04-09 11:04:42 +10:00
jacqueline 96b62321c3 fix some issues with settings screen styling 2024-04-08 15:29:57 +10:00
jacqueline 5f1a6507d8 Warn and block MSC disable if the sd card is busy 2024-04-08 13:50:35 +10:00
jacqueline 251c0ba96d Fix null poiner dereference when turning off i2s output twice 2024-04-04 15:15:42 +11:00
jacqueline 673b6a33ef version bump 2024-04-02 21:20:37 +11:00
jacqueline 63bc8cf896 Ensure we always clean up after ourselves when invoking bindings
this fixes a very nasty lua stack leak
2024-04-02 21:19:54 +11:00
jacqueline c24479d4d8 Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fw 2024-04-02 20:42:19 +11:00
jacqueline 654fde5f68 Support disabling automatic database updates 2024-04-02 20:41:36 +11:00
jacqueline 1e278d55c4 tweak db performance
- leveldb cache pinned to spiram
 - actually use it during indexing lol
 - all up, saves about 10ms per file (amortised) for an incremental reindex
2024-04-02 19:36:35 +11:00
jacqueline 313c021c3b version bump 2024-03-28 16:37:18 +11:00
jacqueline 35a822fe60 Use 48kHz SBC instead of 44.1 2024-03-28 14:46:09 +11:00
jacqueline d6355ea7c9 Use dual-channel SBC encoding instead of joint-stereo 2024-03-28 14:34:45 +11:00
jacqueline ee29c25b29 Fork ESP-IDF's bluetooth component
i want better sbc encoding, and no cla will stop me
2024-03-28 14:32:49 +11:00
jacqueline 239e6d8950 bump esp-idf to 5.2.1 2024-03-28 14:20:50 +11:00
jacqueline dd3346d381 HACK: auto-accept CFM pairing, and increase the connection timeout
This gets Tangara connecting to most non-trivial devices, including car
headunits and my laptop. We can add a real UI / better timeout handling
for this later (likely via a new BluetoothState?)
2024-03-28 12:51:24 +11:00
jacqueline 4cec85af2d implement handling of stream/playback ending 2024-03-26 16:45:20 +11:00
jacqueline 078b77d0f7 pass stream start/update/end events through the whole pipeline 2024-03-26 12:12:42 +11:00
jacqueline 175bfc4e3e WIP rewrie audio pipeline+fsm guts for more reliability 2024-03-25 17:34:41 +11:00
jacqueline 5c985afd25 Version bump 2024-03-22 17:08:51 +11:00
jacqueline d11eea7e0b use charge status for staying on, not usb status
usb status doesnt seem to be updating properly yet
2024-03-21 13:32:45 +11:00
jacqueline cddfc2fbf7 Dont allow quitting the msc screen when msc is enabled 2024-03-21 13:02:00 +11:00
jacqueline 3dc0989c7f fix db key prefix format, and use per-file modification times 2024-03-21 12:57:11 +11:00
jacqueline dadac304dd Add very basic usb msc ui 2024-03-21 11:51:48 +11:00
jacqueline 7305820aa9 Add doc for canPop 2024-03-21 10:52:23 +11:00
jacqueline 684ff50ef4 Add support for screens declaring that they can't be popped
Needed as prep for usb msc support; you really shouldn't leave the MSC
settings screen until you've disabled usb msc.
2024-03-21 10:50:23 +11:00
jacqueline 21ae6a9626 comment out dev unit hack
the nano code bug has received the hack, so now we don't need it
applying by default anymore
2024-03-21 09:15:44 +11:00
jacqueline 654dcb34d6 Support pinning decoded images to RAM 2024-03-20 18:23:33 +11:00
jacqueline a05d93a1e2 Start using the lock switch polarity bit in nvs 2024-03-20 11:43:33 +11:00
jacqueline 46e6743771 version bump, plus prep for lock switch hack 2024-03-20 11:15:33 +11:00
jacqueline 4cd3c187f9 Add exact display size to nvs, since it can vary 2024-03-20 11:08:35 +11:00
jacqueline 1ea25ab9d3 Use a simpler method of determining charge status
idk why the smarter way of doing it doesn't work reliably, but im sick
of it
2024-03-14 14:40:36 +11:00
jacqueline c5c6506ebc Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fw 2024-03-13 19:47:18 +11:00
jacqueline 2eb3fd53d7 Update the battery status when plugging/unplugging 2024-03-13 17:07:03 +11:00
jacqueline 686ada3d46 Bring a modified luavgl stub file into our stubs 2024-03-08 14:01:27 +11:00
jacqueline 36a19182be Use luals-stubs as the source of truth for docs, instead of maintaining
separate docs stubs

Includes introducing a cool new script to turn lua-language-server's
json output into markdown documentation.
2024-03-07 17:22:06 +11:00
jacqueline beb1f65495 Merge branch 'main' of git.sr.ht:~jacqueline/tangara-fw 2024-03-07 11:23:31 +11:00
jacqueline eba5adeb8c Show the now playing screen after being locked for a while 2024-03-07 11:16:56 +11:00
jacqueline ef72b25660 use prototype inheritance for lua screens, rather than functions
this gives us a way to give each screen nice little hooks, like
'onShown' and 'onHidden'. later we can use these hooks to disable
bindings for screens that aren't in-use.
2024-03-07 10:59:03 +11:00
jacqueline 1455288190 Restore the previous track position when booting 2024-03-06 13:59:33 +11:00
jacqueline 53c4ea7805 version bump 2024-02-29 16:30:48 +11:00
jacqueline b2f0e6d3a4 Clear the drain buffer also when seeking 2024-02-29 16:30:17 +11:00
jacqueline 173b09b015 Clear the drain buffer when skipping between tracks 2024-02-29 15:47:21 +11:00
jacqueline e7e6c70fb3 Remove unused 'SeekTo' method on codecs 2024-02-29 12:23:49 +11:00
jacqueline 7d3ddac0ea Merge branch 'main' into seek-support 2024-02-29 12:10:44 +11:00
jacqueline d41f9f7033 Use drflac instead of miniflac
This one is fast as hell! Does seeking really good too. Thank u Doctor
Flac.
2024-02-29 12:08:12 +11:00
jacqueline 77145e56f4 basic working flac and mp3 seeking
flac impl is fairly slow as it doesn't use the seek tables; for some
reason miniflac seems to get *really* upset if you seek the stream.
2024-02-28 21:21:23 +11:00
jacqueline 26fc53b18b fix bad copypaste in docs 2024-02-27 13:25:49 +11:00
jacqueline f9aec8b690 split the lua thread registry into its own files 2024-02-22 14:16:33 +11:00
jacqueline 4b2003c78a Make property bindings shared amongst all lua threads 2024-02-22 12:37:01 +11:00
jacqueline 2a25085503 version bump 2024-02-21 14:17:25 +11:00
jacqueline 28651fa7e1 Wait for the sink buffer to drain before stopping playback 2024-02-21 14:13:19 +11:00
jacqueline 29a246a733 Make the drain buffer very large, and move it into PSRAM
the i2s handler and streambuffer metadata are both still in iram for
good performance. otherwise, this seems to be enough to make gapless
playback work.
2024-02-21 14:12:23 +11:00
jacqueline 79be8a8e6e Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fw 2024-02-20 11:56:24 +11:00
jacqueline 403bd4672c Update to latest libtags
Mostly for wav fixes
2024-02-20 09:29:58 +11:00
jacqueline 3f6256f9e6 Merge branch 'main' of git.sr.ht:~jacqueline/tangara-fw 2024-02-19 09:41:47 +11:00
jacqueline c035ed2b4d Don't mark the current track as changed when falling off the end of the queue 2024-02-19 09:35:19 +11:00
jacqueline 5866513c53 Move the list of unexplored files into spiram 2024-02-16 15:13:58 +11:00
jacqueline 4509ab8d6e version bump 2024-02-15 09:38:02 +11:00
jacqueline c5917658e6 Cram one of the flac samples buffers into internal ram
Can't quite fit the second... yet. Just one is a pretty reasonable
speedup, though! Probably bc we're not hammering the spiram cache so
hard.
2024-02-14 17:48:13 +11:00
jacqueline 10770e0f54 Use -Ofast for all codecs that don't break with it 2024-02-14 17:47:46 +11:00
jacqueline 4bc77f901b Tweak opus build flags and allocs
This gets us to ~40% of one core cpu usage during playback. Good enough
for a while I reckon!

Paid for the internal ram usage by reclaiming some stack size headroom.
2024-02-14 16:56:49 +11:00
jacqueline f772ab9f20 put the big opus alloc back into spiram
it's not clear to me that it helps *that* much, since the ogg allocs are
in internal ram anyway, and the memory pressure is just a bit much
2024-02-14 13:28:05 +11:00
jacqueline 66f68aac0d version bump 2024-02-14 12:23:26 +11:00
jacqueline 7ec0ff2589 Switch to the lowmem tremor branch
in addition to using slightly less memory, this branch also doesn't seem
to have the same issues with `-O2` builds that the main branch has.
2024-02-14 12:21:33 +11:00
jacqueline b31bc07555 fix (improve?) libtremor strangeness
something fucky
2024-02-13 16:39:56 +11:00
jacqueline 3bb002b6b8 Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fw 2024-02-13 12:06:14 +11:00
jacqueline 786546653a include repeat, replay, and shuffle in persisted queue info 2024-02-13 12:05:12 +11:00
jacqueline cb379f4bc3 Cache pending nvs writes in memory
Includes refactoring nvs settings to be a bit less duplicated
2024-02-13 10:12:04 +11:00
jacqueline 79879fbfa0 version bump 2024-02-12 17:17:41 +11:00
jacqueline c5cef16c95 Remove some logging whoopsies 2024-02-12 17:16:38 +11:00
jacqueline 36f4c77fb2 Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fw 2024-02-12 17:10:03 +11:00
jacqueline 03c0968168 Let's try avoiding allocs in the bt stacks 2024-02-12 17:09:17 +11:00
jacqueline a37b517356 Improve handing of tracks with missing titles 2024-02-12 17:08:19 +11:00
jacqueline cb0c42060b more i2s/bt drain buffer size tweaks 2024-02-12 17:08:00 +11:00
jacqueline 26df5c4a7f Remember per-device bluetooth volume 2024-02-12 17:07:39 +11:00
jacqueline a7ac34eaa9 hack around deadlock during bt disable 2024-02-07 21:38:05 +11:00
jacqueline c1b03c151e put opus' allocations into internal ram
it's a pretty chonky codec, but this seems like the best way to tame its
performance.
2024-02-07 21:38:05 +11:00
jacqueline 18345a1c2c Silence chatty touchwheel log 2024-02-07 15:47:23 +11:00
jacqueline 02b897d536 smol version bump 2024-02-07 12:42:09 +11:00
jacqueline c0be3f863f Deliver AVRC events on a background thread
We don't currently do anything with them, so need to wait for the lock
on the bt thread
2024-02-07 11:17:20 +11:00
jacqueline a67cd1dec6 Ensure the resampler is allocated in internal ram
It's quite small!
2024-02-07 10:25:09 +11:00
jacqueline 1b7821a474 improve the locking strategy of the bluetooth fsm 2024-02-06 21:47:28 +11:00
jacqueline d23435fab7 Retry bt device connections
i hate this janky-ass protocol
2024-02-06 21:27:43 +11:00
jacqueline aff28342d9 let the bluetooth stack handle its own discovery state 2024-02-06 17:56:17 +11:00
jacqueline a75adfc124 version bump 2024-02-06 13:48:16 +11:00
jacqueline 0bb12912bc Implement basic volume control for bt outputs 2024-02-06 13:37:20 +11:00
jacqueline 99c56641e9 fix various of bluetooth issues
connecting and disconnecting is a bit more consistent now!
2024-02-06 13:37:20 +11:00
jacqueline ab314b82e1 fix bt settings button initial state 2024-02-06 13:37:20 +11:00
jacqueline 7fbb2162ee Start keeping lock switch polarity in nvs
i will use this to do a sneaky trick; in-place upgrading brendan,
hailey, and erin's devices
2024-02-06 13:37:20 +11:00
jacqueline 2184b6c5f7 send a time=0 progress update after opening each file
this helps populate things like the now playing screen when a file is
opened without unpausing (e.g. when restoring a saved queue after boot)
2024-02-06 08:50:51 +11:00
jacqueline 177277334f focus the play/pause toggle when entering the now playing screen 2024-02-06 08:36:11 +11:00
jacqueline 5f6af82e8a luavgl: add a method to focus an object 2024-02-06 08:36:11 +11:00
jacqueline f2df12836f tweak pipeline buffers rather than i2s dma buffer
this maintains the bluetooth changes to buffer sizes, but keeps the most
important i2s buffer the same size
2024-02-05 20:30:20 +11:00
jacqueline f4d8b2b04a hey i found 40KiB SRAM behind the couch! 2024-02-05 14:58:53 +11:00
jacqueline e073309907 Properly persist bluetooth mode changes 2024-02-05 14:58:40 +11:00
jacqueline 0f03efe868 Make db updates more robust again the sd card disappearing
Accidentally found a bug while live on youtube :)
2024-02-05 11:27:09 +11:00
jacqueline 299f3cc48f Preserve the queue when going into standby 2024-02-05 11:03:52 +11:00