summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2025-04-24Utilise more than one bit of the entropy returned by komihash before ↵ayumi
requesting more
2025-04-23Avoid branching up to two times per sample in the WavPack decoder.ayumi
In my limited tests this improves decoding speed by around 3%.
2025-04-23Make WavPack seeking fasterayumi
It turns out that “seeking to a first sample in a not–first block” is actually very common, because Tangara only seeks to exact seconds and the reference encoder tends to size blocks in a way that makes the first sample in a block likely be the sample that the firmware wants to seek to.
2025-04-14move audio Decoder buffer to external RAMBe
to save internal RAM space
2025-04-14move some task stacks to external RAMBe
To free up some internal RAM space
2025-04-14move SampleProcessor buffers to external RAMBe
This increases CPU usage by ~2% for the audio_conv task, which I think is an acceptable tradeoff. The Speex resampler still makes its own allocations in internal RAM.
2025-04-14Merge pull request 'fix premature pause at end of last track of queue' ↵ailurux
(#317) from Be.ing/tangara-fw:premature_pause into main Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/317
2025-04-14Allow the WavPack’s output buffer to be optionally allocated in IRAMayumi
The decoder does use `memset` on the buffer, but according to Espressif that should be fine. See-Also: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/mem_alloc.html#bit-accessible-memory See-Also: https://esp32.com/viewtopic.php?t=1730#p8056
2025-04-11fix premature pause at end of last track of queueBe
The SetTrack event is sent when *decoding* finishes, not when *playback* finishes so the decoder can start buffering the next track in advance of its playback to ensure gapless playback. Clearing StreamCues causes Playback::react(const internal::StreamHeartbeat& ev) to transit the Playback FSM to Standby, which sets the IAudioOutput to stop reading from the output buffer. Thus, clearing StreamCues in response to the SetTrack event paused playback with the end of the track stuck waiting in the output buffer. When a new queue was loaded and started playing, the end of the previous track would be played before the new track was played. Fixes https://codeberg.org/cool-tech-zone/tangara-fw/issues/313
2025-04-01Quick fix unmount requests getting dropped when there's no sd cardjacqueline
2025-03-24app console: add largest free block size to `heaps`Be
This is the maximum amount that malloc can currently allocate in a single allocation.
2025-03-20Bump the max BT TX power up to +9dBmjacqueline
2025-03-19ailurux/button-media-controls (#264)ailurux
Splits the control scheme into separate schemes for the side buttons and touchwheel, allowing them to be configured independently of each other. At least one input must be used for navigation, and there are guards to prevent locking oneself out of any input. If the input scheme is invalid, a pop up will show alerting the user. Different behaviours can be bound to the side buttons for when the device is locked or unlocked. This PR also adds a mode for these buttons that controls media playback (prev/next on up/down, pressing both buttons toggles play/pause). There are some changes to the way inputs handle locking. Rather than the input devices tracking the current locked mode, different input devices are created on lock depending on the mode that is configured. Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/264 Co-authored-by: ailurux <ailurux@noreply.codeberg.org> Co-committed-by: ailurux <ailurux@noreply.codeberg.org>
2025-03-19Merge pull request 'WavPack and APEv2 tags support' (#218) from ↵cooljqln
ayumi/tangara-fw:wavpack into main Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/218
2025-03-19Merge pull request 'Support padding the left side of the display with black ↵cooljqln
columns' (#302) from display_padding into main Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/302
2025-03-13Add WavPack supportayumi
2025-03-05Allow manually unmounting the SD cardayumi
2025-03-05Merge pull request 'Trim whitespace from end of bluetooth device names' ↵cooljqln
(#288) from tahnok/tangara-fw:trim-bt-name-whitespace into main Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/288 Reviewed-by: cooljqln <cooljqln@noreply.codeberg.org>
2025-03-05Emit a 'known devices changed' event when we forget a known devicejacqueline
Makes the Lua UI update immediately after running the bt_forget command added in PR #289
2025-03-05Merge pull request 'add bt_forget console command' (#289) from ↵cooljqln
tahnok/tangara-fw:bt_forget into main Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/289
2025-02-28add bt_forget console commandWesley Ellis
2025-02-28Trim whitespace from end of bluetooth device namesWesley Ellis
I have a speaker at home with a name of "Pebble V3\r\n" that renders poorly without this change.
2025-02-27Change UI thread interval from 0ms minimum to 16ms (reduces UI CPU).Tursiae
Prior to this change, the UI thread was consuming approx. 10-14% CPU in the idle state, and appeared to be running in an endless loop. After this change, the UI thread is measured at about 0.1% CPU. I'm not sure what the current consumption impact is, but it's gotta be a power saving, even if slim? Following manual testing with the device after flashing this change, the UI responsiveness and music playback does not appear to be negatively affected. The UI actions that were tested were: - Scrolling through items on the root menu - Scrolling through settings - Scrolling through All Tracks with long-press on the bottom of the scroll wheel (Page Down) on a device with ~20k songs - Repeatedly hitting 'next track' - Forcing a DB update, and scrolling through All Tracks while updating the database. The device was configured with the following settings when tested: - TTS enabled - Wired headphones - Bluetooth enabled but not connected - No DB auto-update - Playing music Prior to this change, the UI thread was consuming approx. 10-14% CPU in the idle state, and appeared to be running in an endless loop. On a stock (v1.2.2) build, `tasks` reported: ``` → tasks name core free stack run time IDLE1 1 1.0 KiB 99.6% IDLE0 0 1.1 KiB 86.5% ui any 10.1 KiB 13.7% console_repl 1 5.6 KiB 0.5% Tmr Svc any 1.4 KiB 0.0% audio_dec any 19.4 KiB 0.0% main 0 2.0 KiB 0.0% lvglDraw any 2.9 KiB 0.0% btController 0 2.1 KiB 0.0% esp_timer 0 3.4 KiB 0.0% BTC_TASK 1 2.6 KiB 0.0% worker_1 any 30.1 KiB 0.0% worker_3 any 5.7 KiB 0.0% worker_2 any 29.5 KiB 0.0% worker_0 any 25.7 KiB 0.0% BTU_TASK 1 3.2 KiB 0.0% hciT 1 1.5 KiB 0.0% ipc0 0 1.0 KiB 0.0% ipc1 1 1.0 KiB 0.0% audio_conv any 3.4 KiB 0.0% ``` Following this change, the UI thread decreased from 13% in idle to 0.1% usage, as reported by `tasks`: ``` → tasks name core free stack run time IDLE1 1 1.0 KiB 99.8% IDLE0 0 1.1 KiB 99.4% console_repl any 6.4 KiB 0.5% ui any 10.1 KiB 0.1% btController 0 2.1 KiB 0.0% Tmr Svc any 1.4 KiB 0.0% esp_timer 0 3.4 KiB 0.0% audio_dec any 19.4 KiB 0.0% ipc1 1 1.0 KiB 0.0% ipc0 0 1.0 KiB 0.0% hciT 1 1.5 KiB 0.0% BTU_TASK 1 3.2 KiB 0.0% worker_3 any 20.7 KiB 0.0% worker_2 any 29.4 KiB 0.0% BTC_TASK 1 2.5 KiB 0.0% worker_1 any 30.1 KiB 0.0% worker_0 any 5.7 KiB 0.0% lvglDraw any 2.9 KiB 0.0% main 0 2.0 KiB 0.0% audio_conv any 3.4 KiB 0.0% ```
2025-02-25Fix bug with filesystem iterator prev off by one sometimesailurux
2025-02-20Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fwailurux
2025-02-20Fix file iterator prev to work with hidden files presentailurux
2025-02-20Wire up the nvs pad to the display padjacqueline
2025-02-20Support a left padding value in display init datajacqueline
2025-02-20Add nvs key for left paddingailurux
2025-02-18Gate playback on the existence of /.tangara-tts/.Tursiae
Also, clang-format previous changes in provider.hpp.
2025-02-18Hotfix: Update filesystem iterator to work with changes to infinite listailurux
2025-02-13Bump storage unmount timer to 2 minutes to match idle timerRiley Inman
2025-02-14Merge pull request 'Change output mode when bluetooth connects/disconnects' ↵cooljqln
(#261) from ailurux/output-mode-fix into main Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/261
2025-02-11Only change output mode if the new output mode is differentailurux
2025-02-11TTS: Implement and wire up a TTS toggle in Display Settings (#251)Tursiae
This change introduces the ability to enable or disable the spoken interface/TTS from the on-device settings, either via the UI or the Lua console. This closes out the implementation of issue #245. The TTS setting is only visible in Display settings if voice samples are present in `/.tangara-tts/` on the SD card. Playback of new TTS voice samples is inhibited when TTS is disabled. By default, the setting is enabled, as the device will only play back TTS voices if samples are present on disk. If you need samples to test TTS on your device, feel free to grab the voice samples I have at https://codeberg.org/tursiae/tangara-tts-samples. There's about 80-85% coverage of the UI, with the remainder to be added soonish. Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/251 Co-authored-by: Tursiae <git@tursiae.org> Co-committed-by: Tursiae <git@tursiae.org>
2025-02-11Merge branch 'main' of codeberg.org:cool-tech-zone/tangara-fwailurux
2025-02-11Fix bug in infinite list causing items to be removed (#253)ailurux
2025-02-10TTS: Better document the ownership and task/control flow.Tursiae
2025-02-10TTS: Avoid exhausting the WorkerPool with concurrent TTS playback.Tursiae
Reported in issue #258. As of v1.2.0, if /.tangara-tts/ samples are present on the SD card, and >= 4 menu items with matching TTS samples are highlighted in the UI, and no audio output (headphones or BT sink) is connected, the `tts::Player`'s invocation of lambdas on the WorkerPool will result in worker task exhaustion. This is because we get stuck in state where the `drivers::PcmBuffer` is not accepting any new samples, and the inner loop in `Player::decodeToSink` that pushes to the output isn't checking to see whether playback was cancelled. So the loop never terminates, and we consume that worker slot. Repeat with another 3 menu items, and, hey, all four worker threads are consumed with TTS that will not terminate until headphones/BT are connected.
2025-02-10Merge pull request 'Console: Update doco to point to `sdkconfig`, and handle ↵ailurux
no-stats cases.' (#257) from tursiae/tangara-fw:tasksconfig into main Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/257
2025-02-10s/sdkconfig.local/sdkconfig/gTursiae
2025-02-10Change output mode when bluetooth connects/disconnectsailurux
2025-02-10Also document the `idf.py menuconfig` approach.Tursiae
2025-02-09Console: Update doco to point to `sdkconfig.local`, and handle no-stats cases.Tursiae
When `CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS` is not set, the FreeRTOS scheduler will not keep track of task runtime statistics, and the `tasks` command on the console will show `nan%` for the usage. This adds a recommendation for the user to enable the `...STATS` config in their build, and also updates the guidance for `configUSE_TRACE_FACILITY` to point at the supported `sdkconfig.local` configuration pathway, instead of pointing at the `#define` that's deeper in the configuration stack. Also, the sampling period is dropped from 2.5s to 10ms when the runtime stats are not enabled; given that we're not measuring any usage, it's not worth sleeping any longer than that. We might even be able to drop to zero?
2025-02-09Console: Stop `tasks` from hanging in `std::sort`.Tursiae
`std::sort` expects a comparator that returns `a < b`. Flipping this to `a >= b` would normally be fine to reverse the order, but floats behave weirdly with NaN. Instead of flipping the comparator, this uses the reverse-iterators to reverse the sort order of the tasks, and returns to an `a < b` comparator.
2025-02-07Add centre button haptic feedback on touch, and setting to disable/lessen ↵ailurux
haptics (#246) This adds a way for feedback devices to respond to events from outside of LVGL's event system, being passed from input device to feedback device through a vector. This was done so that touch events and long-press triggers can now give feedback through haptics. This PR also adds haptic modes, saved in nvs similarly to input and locked input modes, to disable or change the haptic effect behaviour based on which mode is selected. Finally, this also fixes a bug in which some click events would not trigger haptics, at the expense of re-introducing the (undesired?) behaviour of clicking a button that transitions to a new screen causing a double click. Relevant issues this should close: #195, #233, and (partially?) #120 Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/246 Co-authored-by: ailurux <ailuruxx@gmail.com> Co-committed-by: ailurux <ailuruxx@gmail.com>
2025-02-06Update the docs to eliminate the mention of the Spoken Interface setting ↵Tursiae
until re-added.
2025-02-06Make the TTS playback work by assuming the file is a .wav.Tursiae
The extension is needed to trigger format detection in the tag reader.
2025-02-06Briefly document the TTS module.Tursiae
2025-02-05Fix issue with last touch wheel time not being initialisedailurux