Internships/ProjectIdeas/VirtioSound: Difference between revisions

From QEMU
No edit summary
(Add update status info)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=== VirtioSound ===
<div class="mw-message-box">
<strong>Update (2024-02-17): </strong> a [https://crates.io/crates/vhost-device-sound vhost-user sound device] has been implemented in the [https://github.com/rust-vmm/ rust-vmm project]. QEMU supports it through the vhost-user-snd and vhost-user-snd-pci devices {{git|4ae0fc18a1dc91bfe3a494292faf3c4c1b2cc16c}}
</div>
 
=== Implement virtio-sound emulation as a Rust vhost-user back-end ===
   
   
'''Summary:''' Create a virtio sound device.
'''Summary:''' Implement device emulation for the new virtio-sound device.
 
The VIRTIO specification defines a sound device and Linux has a guest driver for it, but QEMU does not emulate the virtio-sound device yet.
 
The goal is to implement virtio-sound emulation with mono and stereo playback and capture support. The code should be developed as a vhost-user back-end (a standalone program that communicates with QEMU) using the Rust vhost-user and gstreamer crates. The vhost crate handles the interfacing with QEMU and the low-level VIRTIO details. The gstreamer crate is a cross-platform multimedia API that abstracts the native audio API (ALSA, CoreAudio, etc).
 
As stretch goals you can implement additional functionality covered by the VIRTIO sound device specification, including support for multi-channel devices (e.g. surround sound playback), channel maps, etc. If you have even more time you can implement QEMU dbus-display support for streaming audio over remote desktop connections (for remote viewers like VNC/RDP/Spice).


A specification for a virtio sound device is being worked on.
To familiarize yourself with the project idea (see links below):
The specs are pretty close to be finalzed, a linux guest driver should be available soon.
# Review the VIRTIO sound device specification.
# Review the vhost-user crate's vhost-user-backend module and the gstreamer crate.
# Review the unfinished patches for an idea of how to implement the device in C.
 
Intermediate Rust programming skills are required for this project. This project will expose you to device emulation, VIRTIO, and you'll learn how audio devices work at the hardware interface level.


Project goal is a virtio sound device implementation for qemu.
'''Links:'''
'''Links:'''
* specs: https://www.kraxel.org/virtio/virtio-v1.1-cs01-sound-v6.html#x1-49500014
* Device specification: https://docs.oasis-open.org/virtio/virtio/v1.2/csd01/virtio-v1.2-csd01.html#x1-52900014
* driver: https://github.com/OpenSynergy/linux/commits/virtio-snd-draft (not yet updated for draft v6).
* Linux guest driver: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/virtio
* vhost crate: https://github.com/rust-vmm/vhost/tree/main/crates/vhost-user-backend
* vhost-device repo: https://github.com/rust-vmm/vhost-device
* gstreamer crate: https://docs.rs/gstreamer/latest/gstreamer/
* dbus-display: https://www.qemu.org/docs/master/interop/dbus-display.html


'''Details:'''
'''Details:'''
* Project size: 350 hours
* Skill level: intermediate/advanced
* Skill level: intermediate/advanced
* Language: C
* Language: Rust
* Mentor: Gerd Hoffmann <kraxel@redhat.com>, Anton Yakovlev <anton.yakovlev@opensynergy.com>
* Mentor: Stefan Hajnoczi <stefanha@redhat.com>, Alex Bennée <alex.bennee@linaro.org>
* Suggested by: Gerd Hoffmann <kraxel@redhat.com>
* Suggested by: Gerd Hoffmann <kraxel@redhat.com>

Latest revision as of 18:24, 17 February 2024

Update (2024-02-17): a vhost-user sound device has been implemented in the rust-vmm project. QEMU supports it through the vhost-user-snd and vhost-user-snd-pci devices (commit 4ae0fc18a1dc91bfe3a494292faf3c4c1b2cc16c)

Implement virtio-sound emulation as a Rust vhost-user back-end

Summary: Implement device emulation for the new virtio-sound device.

The VIRTIO specification defines a sound device and Linux has a guest driver for it, but QEMU does not emulate the virtio-sound device yet.

The goal is to implement virtio-sound emulation with mono and stereo playback and capture support. The code should be developed as a vhost-user back-end (a standalone program that communicates with QEMU) using the Rust vhost-user and gstreamer crates. The vhost crate handles the interfacing with QEMU and the low-level VIRTIO details. The gstreamer crate is a cross-platform multimedia API that abstracts the native audio API (ALSA, CoreAudio, etc).

As stretch goals you can implement additional functionality covered by the VIRTIO sound device specification, including support for multi-channel devices (e.g. surround sound playback), channel maps, etc. If you have even more time you can implement QEMU dbus-display support for streaming audio over remote desktop connections (for remote viewers like VNC/RDP/Spice).

To familiarize yourself with the project idea (see links below):

  1. Review the VIRTIO sound device specification.
  2. Review the vhost-user crate's vhost-user-backend module and the gstreamer crate.
  3. Review the unfinished patches for an idea of how to implement the device in C.

Intermediate Rust programming skills are required for this project. This project will expose you to device emulation, VIRTIO, and you'll learn how audio devices work at the hardware interface level.

Links:

Details:

  • Project size: 350 hours
  • Skill level: intermediate/advanced
  • Language: Rust
  • Mentor: Stefan Hajnoczi <stefanha@redhat.com>, Alex Bennée <alex.bennee@linaro.org>
  • Suggested by: Gerd Hoffmann <kraxel@redhat.com>