Skip to content

Fix warnings, port deprecated GTK/libadwaita APIs, rework benchmark, update april-asr - #125

Closed
Techlm77 wants to merge 4 commits into
abb128:mainfrom
Techlm77:streaming-and-gtk-updates
Closed

Techlm77 wants to merge 4 commits into
abb128:mainfrom
Techlm77:streaming-and-gtk-updates

Conversation

@Techlm77

@Techlm77 Techlm77 commented Oct 9, 2026

Copy link
Copy Markdown

This fixes compiler warnings, ports away from deprecated GTK and libadwaita APIs, reworks the setup benchmark, and updates april-asr with streaming and accuracy fixes. Each commit builds on its own.

Depends on abb128/april-asr#23. The submodule currently points at Techlm77/april-asr so this branch builds. Once #23 is merged I'll switch .gitmodules back to abb128/april-asr and bump the commit, or feel free to do that when merging.

Commits

  1. Fix compiler warnings: unused parameters, an unused audio thread function, size_t-correct comparisons and format specifiers, and handling APRIL_RESULT_UNKNOWN.
  2. Port away from deprecated GTK and libadwaita APIs:
    • Preferences use AdwPreferencesDialog, presented without a parent so they still open in their own window rather than inside the small captions window.
    • About uses AdwAboutDialog, alerts use AdwAlertDialog, and file choosers use GtkFileDialog.
    • URLs open with GtkUriLauncher and GtkFileLauncher. CSS loads with load_from_string through a display provider.
    • G_APPLICATION_DEFAULT_FLAGS replaces G_APPLICATION_FLAGS_NONE.
    • The gdk_x11_* keep-above accessors have no replacement, so their warnings are silenced around that one function only.
    • Requires GTK 4.12 and libadwaita 1.5.
  3. Rework the setup benchmark: this builds on e69209d.
    • Timing uses the monotonic clock, with an untimed warm-up and a final flush.
    • Audio goes in 100 ms chunks, so the progress bar is smooth and ends full.
    • It stops early once a pass is impossible.
    • Results reach the main thread by value instead of through volatile fields.
    • Closing the window mid-benchmark previously could crash. The thread is now stopped and joined.
  4. Update april-asr:
    • The engine fixes are in Fix streaming correctness and feature extraction april-asr#23. Captions finalize after 1.2 s of silence instead of 2.2 s.
    • The session switches to APRIL_CONFIG_FLAG_ASYNC_NO_RT_BIT, so audio is no longer time-compressed when the CPU falls behind, which hurt accuracy. The trade-off is that a machine too slow for real time gets CANT_KEEP_UP errors instead of degraded text. Happy to drop this if you prefer the old behaviour.
    • C++ is enabled in Meson because april-asr's CMake project now builds its C++17 examples.

Testing

  • Build: a fresh clone builds with no compiler warnings in the app or the engine.
  • Accuracy: on 80 LibriSpeech clips (1,601 words) with the bundled English model, word errors went from 215 to 201 (13.4% → 12.6%). Details are in Fix streaming correctness and feature extraction april-asr#23.
  • Run on Arch Linux (KDE): the app has been launched and run with these changes.
  • Not yet hand-tested in the new dialogs: keep-on-top for Preferences on X11, the model load error dialog, and history export and erase.

🤖 Generated with Claude Code

Techlm77 and others added 4 commits October 9, 2026 08:33
Silence unused parameters, drop an unused audio thread function, use
size_t-correct comparisons and format specifiers, avoid casting pointers
to GQuark directly, and handle APRIL_RESULT_UNKNOWN in the result switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- AdwPreferencesWindow -> AdwPreferencesDialog, presented without a
  parent so it still opens as its own window rather than inside the
  small captions window. AdwAboutWindow -> AdwAboutDialog.
- GtkMessageDialog and AdwMessageDialog -> AdwAlertDialog.
- GtkFileChooserNative -> GtkFileDialog for loading models and exporting
  history.
- gtk_show_uri -> GtkUriLauncher / GtkFileLauncher.
- gtk_css_provider_load_from_data -> load_from_string, and add the
  window's provider for the display instead of via GtkStyleContext.
- G_APPLICATION_FLAGS_NONE -> G_APPLICATION_DEFAULT_FLAGS.

GTK deprecated its X11 backend without replacements for the
gdk_x11_* accessors used to keep the window above others, so those
warnings are silenced around that one function only.

Requires GTK 4.12 and libadwaita 1.5.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Time with the monotonic clock and stop early once the result can no
  longer reach MINIMUM_BENCHMARK_RESULT, instead of after a fixed 55 s.
- Run one untimed warm-up second so one-off initialization does not
  count against the result, and flush at the end so buffered audio is
  included.
- Feed 100 ms chunks so the progress bar moves smoothly, and fill it on
  completion.
- Pass progress and the result to the main thread by value instead of
  through volatile fields shared between threads.
- Keep the window alive while the benchmark thread runs, and stop and
  join the thread when the window goes away; closing the window
  mid-benchmark could previously crash.
- Report a failing result instead of asserting when no model is loaded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Point the submodule at april-asr with fixes for worker wakeups, flush
handling, feature extraction and model validation (see the april-asr
commit for details). Captions now finalize after 1.2 s of silence
instead of 2.2 s.

Switch the session to APRIL_CONFIG_FLAG_ASYNC_NO_RT_BIT so audio is no
longer time-compressed when the CPU falls behind, which degraded
accuracy.

Enable C++ in the Meson project because april-asr's CMake project now
builds its C++ examples with C++17.

On 80 LibriSpeech test-clean/test-other clips (1,601 words) with the
English model, word errors went from 215 to 201.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Techlm77 Techlm77 closed this Oct 10, 2026
@Techlm77
Techlm77 deleted the streaming-and-gtk-updates branch October 10, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant