Skip to content

Make the microphone work: SDL audio when it's on - #4

Closed
lightyoruichi wants to merge 1 commit into
harkhowalia-1:mainfrom
lightyoruichi:feat/mic-via-sdl-audio
Closed

lightyoruichi wants to merge 1 commit into
harkhowalia-1:mainfrom
lightyoruichi:feat/mic-via-sdl-audio

Conversation

@lightyoruichi

Copy link
Copy Markdown
Contributor

QEMU's Core Audio backend can't record (max_voices_in = 0), so with the microphone on, hda-duplex logged "Can not open adc' (no host audio driver)" and Android heard nothing. Build QEMU 11.1.2 from source with SDL (Homebrew's has none) and use -audiodev sdl` with hda-duplex when the microphone is on; Core Audio with hda-output stays the default.

Bundle SDL3 beside sdl2-compat, which dlopens it; without it QEMU hangs on an error dialog at start.

Tested on a LineageOS 24 VM with the app's QEMU arguments: a 700 Hz input reaches Android's mic cleanly (0.40 of 0.5), a 1.5 kHz file played in Android reaches SDL's output at 0.60 of 0.6, and the live MacBook mic picks up a tone played on the Mac.

QEMU's Core Audio backend can't record (max_voices_in = 0), so with the
microphone on, hda-duplex logged "Can not open `adc' (no host audio
driver)" and Android heard nothing. Build QEMU 11.1.2 from source with SDL
(Homebrew's has none) and use `-audiodev sdl` with hda-duplex when the
microphone is on; Core Audio with hda-output stays the default.

Bundle SDL3 beside sdl2-compat, which dlopens it; without it QEMU hangs on
an error dialog at start.

Tested on a LineageOS 24 VM with the app's QEMU arguments: a 700 Hz input
reaches Android's mic cleanly (0.40 of 0.5), a 1.5 kHz file played in
Android reaches SDL's output at 0.60 of 0.6, and the live MacBook mic
picks up a tone played on the Mac.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lightyoruichi
lightyoruichi marked this pull request as draft October 20, 2026 06:21
harkhowalia-1 added a commit that referenced this pull request Oct 21, 2026
QEMU's Core Audio backend can't record (max_voices_in = 0), so with the
microphone on, hda-duplex logged "Can not open `adc' (no host audio driver)"
and Android's audio could break (#1). Build QEMU 11.1.2 from source with SDL
(Homebrew's has none) and use `-audiodev sdl` with hda-duplex when the
microphone is on; Core Audio with hda-output stays the default. SDL3 is
bundled beside sdl2-compat, which dlopens it.

The QEMU tarball's SHA-256 is pinned, CI caches the QEMU build, and the app
only asks for SDL when its QEMU has it, so development builds on Homebrew's
QEMU fall back to playback only instead of failing to start.

From #4.

Co-authored-by: Harinder Singh <[email protected]>
@harkhowalia-1 harkhowalia-1 mentioned this pull request Oct 21, 2026
@harkhowalia-1

Copy link
Copy Markdown
Owner

Thank you, this is merged into v0.3.4 with you credited as co-author. Two small additions:

  • The QEMU source tarball's SHA-256 is pinned in bundle-qemu.sh.
  • CI caches the QEMU build.
  • The app only uses -audiodev sdl when the bundled QEMU actually has SDL, so development builds using Homebrew's QEMU keep working.

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.

2 participants