process_io() would unwrap() the result of b.write()/b.read(), panicking if the stream was in any state other than Start or Prepare. This could happen when the guest queued Tx buffers and then sent PcmStop before they were all consumed — a normal race between the control and I/O queues. Replace the unwrap() calls with a logged warning. Queued requests in stream.requests are harmless and will be cleared on PcmRelease. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| CHANGELOG.md | ||
| LICENSE-APACHE | ||
| LICENSE-BSD-3-Clause | ||
| README.md | ||
vhost-device-sound
Synopsis
vhost-device-sound --socket <SOCKET> --backend <BACKEND>
Description
A virtio-sound device using the vhost-user protocol.
Options
--socket <SOCKET>
vhost-user Unix domain socket path
--socket-fd <FD>
listening vhost-user Unix domain socket file descriptor
(e.g. from a service manager)
--backend <BACKEND>
audio backend to be used [possible values: null, pipewire, alsa, gstreamer]
--streams <STREAMS>
comma-separated list of stream directions to enable [possible values: output, input]
(default: output,input)
-h, --help
Print help
-V, --version
Print version
Examples
Launch the backend on the host machine:
host# vhost-device-sound --socket /tmp/snd.sock --backend null
With QEMU, you can add a virtio device that uses the backend's socket with the following flags:
-chardev socket,id=vsnd,path=/tmp/snd.sock \
-device vhost-user-snd-pci,chardev=vsnd,id=snd
License
This project is licensed under either of
- Apache License, Version 2.0
- BSD-3-Clause License