Skip to content

Commit 92a4ffb

Browse files
Dorinda Basseystefano-garzarella
authored andcommitted
OSPP-2025: Proposal for Audio Controls Feature in vhost-device-sound
Add proposal to extend vhost-device-sound and QEMU vhost-user-sound pci device to support audio control operations, as defined in VirtIO Sound 1.3 Signed-off-by: Dorinda Bassey <dbassey@redhat.com>
1 parent 9fdf9c7 commit 92a4ffb

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

ospp/OSPP-2025.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,92 @@ Libraries & Tools:
8282
## Project Repository
8383

8484
https://github.com/rust-vmm/vhost-device/tree/main/vhost-device-sound/src
85+
86+
# Project Name
87+
88+
Audio Controls Feature for vhost-device-sound
89+
90+
## Project Mentor
91+
92+
Dorinda Bassey <dbassey@redhat.com>
93+
94+
## Project Description
95+
96+
The virtio-sound device emulation has been evolving to provide better virtualization support for audio functionalities.
97+
The goal of this project is to extend the capabilities of the virtio-sound device within the [vhost-device-sound](https://github.com/rust-vmm/vhost-device/tree/main/vhost-device-sound)
98+
crate by adding audio control features such as volume adjustment, muting/unmuting, and mode switching.
99+
100+
Recent [patches](https://lore.kernel.org/all/20240423150951.41600-39-pbonzini@redhat.com/) have introduced support for audio
101+
controls in the Linux headers used by QEMU, and the [VirtIO sound 1.3 specification](https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.html#x1-56700014)
102+
has now incorporated these audio controls feature.
103+
104+
This project will focus on implementing these new features in the Rust-based vhost-device-sound crate. This new feature enhancement will
105+
allow a user of the guest OS to dynamically control audio settings, improving the flexibility and usability of virtualized audio devices.
106+
107+
The audio controls support should be implemented following the [VirtIO sound 1.3 specification](https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.html#x1-56700014).
108+
109+
## Project Notes
110+
111+
- This project should extend vhost-device-sound to support audio control operations in compliance with [VirtIO Sound 1.3 specification](https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.html#x1-56700014).
112+
- Add Feature Negotiation support for [VIRTIO_SND_F_CTLS](https://gitlab.com/qemu-project/qemu/-/blob/master/include/standard-headers/linux/virtio_snd.h#L15)
113+
to both vhost-device-sound and QEMU to ensure that control messages are only enabled if `VIRTIO_SND_F_CTLS` is successfully negotiated between the guest and host.
114+
- Extend the vhost-device-sound to Handle the new audio control messages from the guest.
115+
- Requires modifications to QEMU’s vhost-user-sound frontend to handle feature negotiation and control messages.
116+
- The implementation should support:
117+
- Volume control (per-channel adjustments).
118+
- Muting/unmuting audio streams.
119+
- Switching audio output modes (e.g., speakers/headphones).
120+
- Extend the [PipeWire Backend](https://github.com/rust-vmm/vhost-device/blob/main/vhost-device-sound/src/audio_backends/pipewire.rs)
121+
to Implement audio control features using the [pipewire-rs crate](https://gitlab.freedesktop.org/pipewire/pipewire-rs).
122+
- Extend the [Alsa Backend](https://github.com/rust-vmm/vhost-device/blob/main/vhost-device-sound/src/audio_backends/alsa.rs)
123+
to Implement audio control features using the [alsa rust bindings](https://github.com/diwic/alsa-rs.git).
124+
- The implementation will be tested using QEMU as the vhost-user frontend.
125+
- Automated tests will be written using cargo test.
126+
- A possible stretch goal is contributing to rust-vmm/vhost-device by fixing existing issues.
127+
128+
### Other contacts
129+
130+
Matias Ezequiel Vara Larsen <mvaralar@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>
131+
132+
## Project Difficulty
133+
134+
Advanced (some understanding of QEMU vhost-user sound frontend device would be good to know)
135+
136+
## Project Size
137+
138+
180 Hours
139+
140+
## Technical Domain Labels
141+
142+
[Virtualization] | [Emulation] | [Vhost-user]
143+
144+
## Programming Language Labels
145+
146+
[Rust] | [C]
147+
148+
## Expect Outcome
149+
150+
1. Extended Audio Control Features in vhost-device-sound
151+
- Implement support for volume adjustment, muting/unmuting, and mode switching.
152+
- Ensure compliance with the [VirtIO Sound 1.3 specification](https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.html#x1-56700014).
153+
2. Integration with QEMU
154+
- Modify QEMU's vhost-user frontend to handle new audio control commands.
155+
3. Automated Testing
156+
- Unit tests for the backend using cargo test.
157+
- Verification through QEMU testing.
158+
4. Documentation and Upstreaming
159+
- Well-documented and upstreamed code both in vhost-device and QEMU following Rust, rust-vmm and QEMU coding standards.
160+
161+
## Project Technical Requirements
162+
163+
Libraries & Tools:
164+
- vhost-device-sound crate
165+
- Alsa Rust bindings
166+
- Pipewire Rust bindings
167+
- QEMU for testing the vhost-user integration
168+
169+
## Project Repositories
170+
171+
https://github.com/rust-vmm/vhost-device/tree/main/vhost-device-sound/src
172+
173+
https://gitlab.com/qemu-project/qemu

0 commit comments

Comments
 (0)