Skip to content

SCSND: iOS sound played by the Scion app - #34

Merged
dylanneve1 merged 1 commit into
mainfrom
scsnd/kernel
Oct 28, 2026
Merged

dylanneve1 merged 1 commit into
mainfrom
scsnd/kernel

Conversation

@dylanneve1

Copy link
Copy Markdown
Collaborator

What

iOS sound is now played by the Scion app, not AVF's virtio-snd. On the Pixel 10, crosvm's vhost-user sound device failed to start 2 times in 3 and took the VM down with it.

  • sys/hakios.scsnd.h: a 128-byte header and a ring of 48 kHz stereo s16 in a 1 MiB region the app lends. The region is passed as scsnd.addr/scsnd.size, the same way as SCFB/SCCAM/SCGPU.
  • bsd/dev/hakios.scsnd.c: a /dev/hakios-audio sink. It copies what the audio server writes into the ring without ever blocking (what doesn't fit is counted in dropped), and passes iOS's volume and mute through the header.
  • Patch 1401 adds the file to bsd/conf/files and calls hakios_scsnd_init() from hakios_audio_init.
  • avfboot carves the region out of the kernel's memory, like SCGPU's.

The app side is Scion-Project/scion scsnd/app.

Testing

CI is green (run 40551164050). On the phone, the boot gets to hakios-audio: sound goes to the Scion app (SCSND) and the app reports the ring. Sound has not been listened to yet.

🤖 Generated with Claude Code

AVF's own sound device (crosvm's vhost-user virtio-snd, audio=1) failed to start two
times in three on the Pixel 10 and took the VM with it, so iOS had no sound under AVF.

Now the app lends one more region of RAM (scsnd.addr= scsnd.size=), as it lends the
framebuffer's, the camera's and the GPU's: a header and a ring of samples in
/dev/hakios-audio's format (sys/hakios.scsnd.h). The new sink (bsd/dev/hakios.scsnd.c,
registered from hakios_audio_init by patch 1401) copies what the audio server writes
into the ring and never waits; what does not fit is counted and lost. iOS's speaker
volume is passed on in the header for the app to apply. avfboot keeps the region out
of the kernel's memory.

The app side: Scion-Project/scion scsnd/app (scsnd.c plays the ring with AAudio).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 93884ed9886e187aa409914a6045bc7f3949f749)
@dylanneve1
dylanneve1 merged commit 6d37372 into main Oct 28, 2026
1 check passed
@dylanneve1
dylanneve1 deleted the scsnd/kernel branch October 28, 2026 10:46
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