<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tangara-fw/src/tangara/ui/lvgl_task.cpp, branch main</title>
<subtitle>Tangara firmware</subtitle>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/'/>
<entry>
<title>Change UI thread interval from 0ms minimum to 16ms (reduces UI CPU).</title>
<updated>2025-02-27T05:31:59+00:00</updated>
<author>
<name>Tursiae</name>
<email>git@tursiae.org</email>
</author>
<published>2025-02-27T05:31:59+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/commit/?id=91c487b656533efe36ea154e357dc1e2b99a3025'/>
<id>91c487b656533efe36ea154e357dc1e2b99a3025</id>
<content type='text'>
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%
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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%
```
</pre>
</div>
</content>
</entry>
<entry>
<title>Move the UI task main loop info iram</title>
<updated>2024-08-27T23:45:19+00:00</updated>
<author>
<name>jacqueline</name>
<email>me@jacqueline.id.au</email>
</author>
<published>2024-08-27T11:17:36+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/commit/?id=ef227f8c518f2b6cfd5e55ca052a12e70515f2ef'/>
<id>ef227f8c518f2b6cfd5e55ca052a12e70515f2ef</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix some issues with the splash screen</title>
<updated>2024-06-28T05:34:11+00:00</updated>
<author>
<name>jacqueline</name>
<email>me@jacqueline.id.au</email>
</author>
<published>2024-06-28T05:34:11+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/commit/?id=984b874d7e53980f96fb1581f32d771f78cb91ab'/>
<id>984b874d7e53980f96fb1581f32d771f78cb91ab</id>
<content type='text'>
 - fix a use-after-free involving the alerts container that was
   happening when showing the first screen
 - fix some issues where the splash screen wouldn't come up as early as
   it needs to when another bootup task was making heavy use of the spi
   bus
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
 - fix a use-after-free involving the alerts container that was
   happening when showing the first screen
 - fix some issues where the splash screen wouldn't come up as early as
   it needs to when another bootup task was making heavy use of the spi
   bus
</pre>
</div>
</content>
</entry>
<entry>
<title>show a message if the sd card is unmounted</title>
<updated>2024-06-28T03:50:40+00:00</updated>
<author>
<name>jacqueline</name>
<email>me@jacqueline.id.au</email>
</author>
<published>2024-06-28T03:50:40+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/commit/?id=9204b585aedd35f85d3c9118299459d3586cf499'/>
<id>9204b585aedd35f85d3c9118299459d3586cf499</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>WIP fix issues introduced by lvgl version bump</title>
<updated>2024-06-12T08:46:07+00:00</updated>
<author>
<name>jacqueline</name>
<email>me@jacqueline.id.au</email>
</author>
<published>2024-06-12T08:46:07+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/commit/?id=e58dcf6dc5332c60a346509436f9934d9e3bbfbb'/>
<id>e58dcf6dc5332c60a346509436f9934d9e3bbfbb</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Start on TTS support by logging the data that will become TTS lines</title>
<updated>2024-05-29T04:45:49+00:00</updated>
<author>
<name>jacqueline</name>
<email>me@jacqueline.id.au</email>
</author>
<published>2024-05-29T04:45:49+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/commit/?id=2ff8eac022f397bb1aed28aca376fbe422fc8b3c'/>
<id>2ff8eac022f397bb1aed28aca376fbe422fc8b3c</id>
<content type='text'>
Includes some misc cleanup of haptic double-triggering (or
non-triggering), since those cases all end up being TTS event
double-reporting, which to me crosses the threshold from "annoying" to
"usability issue"
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Includes some misc cleanup of haptic double-triggering (or
non-triggering), since those cases all end up being TTS event
double-reporting, which to me crosses the threshold from "annoying" to
"usability issue"
</pre>
</div>
</content>
</entry>
<entry>
<title>move driver includes into a subdir as well</title>
<updated>2024-05-02T11:52:59+00:00</updated>
<author>
<name>jacqueline</name>
<email>me@jacqueline.id.au</email>
</author>
<published>2024-05-02T11:52:59+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/commit/?id=26eb580043ad176bdc58d996f30d470e1073ef00'/>
<id>26eb580043ad176bdc58d996f30d470e1073ef00</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>start moving include files into subdirs</title>
<updated>2024-05-02T11:41:56+00:00</updated>
<author>
<name>jacqueline</name>
<email>me@jacqueline.id.au</email>
</author>
<published>2024-05-02T11:41:56+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/commit/?id=7d7f7755d17e1e0a2348d75d797097f166b70471'/>
<id>7d7f7755d17e1e0a2348d75d797097f166b70471</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>WIP merge cyclically dependent components into one big component</title>
<updated>2024-05-02T09:12:26+00:00</updated>
<author>
<name>jacqueline</name>
<email>me@jacqueline.id.au</email>
</author>
<published>2024-05-02T09:12:26+00:00</published>
<link rel='alternate' type='text/html' href='https://grim.freemyip.com/cgit/tangara-fw/commit/?id=1573a8c4cde1cd9528b422b2dcc598e37ffe94a7'/>
<id>1573a8c4cde1cd9528b422b2dcc598e37ffe94a7</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
