Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Running two virtio-sound devices on top of virtio-loopback on AGL Reference Hardware platform (RefHw)

An overview

This guide contains instructions and sources/binaries to manually compile, test and experiment virtio-loopback with two vhost-user sound devices on **AGL reference hardware**. This initial multi-device support was developed to demonstrate the flexibility of virtio-loopback, but it is by no means stable and optimized. The yocto integration of virtio-loopback and vhost-user-sound in AGL is ongoing and is targeting single device support only. Future work idea is to properly support multi-devices in 2024. This work was presented at OSS Japan by Virtual Open Systems (https://ossjapan2022ossjapan2023.sched.com/event/1D1271TvYP/virtio-loopback-the-anagl-hardware-abstraction-layer-hal-for-non-virtualized-environments-michele-paolino-virtual-open-systems). The code of this demo diverges a bit from the single-device that is targeting upstream in AGL. For instance, it contains makefiles to build two identical virtio-loopback-drivers with different names. For this reason, we placed all the sources/binaries in a temporary public repository available [ here](: https://git.virtualopensystems.com/virtio-loopback/docs/-/tree/multi-sound-guide). 

Alt text

Description of two virtio-sound device running on top of virtio-loopback architecture*

...

Before start compiling and running the components of the architecture you need:

- **RefHw Linux kernel** dependencies:

+ The following configuration flags need to be enabled: *CONFIG_VIRTIO*, *CONFIG_SND_VIRTIO* -

**RefHw filesystem** dependencies:

+ **alsa-utils** so to use *aplay* command, in order to feed audio stream to a sound device of the system

- **Host system** dependencies + **git** to fetch the sources and patch them before compilation Since RefHw current kernel version is older than v5.13, the virtio-sound driver is not available in the kernel. In that case, patches provided in the *[virtio_snd_patches/](https://git.virtualopensystems.com/virtio-loopback/docs/-/tree/multi-sound-guide/virtio_snd_patches)* subdirectory of the current repo should be applied to the kernel sources. Please find more information about that in the next section (3.1).

...

Patches which backport the virtio-sound driver on kernel v5.10 (used by AGL reference HW) can be found under "virtio_snd_patches/" of the current repo. To apply them to the target kernel (assuming you have sources in the "linux_kernel_source" folder) the following steps are required:

- `cd linux_kernel_source`

- `git am $HOME/virtio-loopback-test/virtio_loopback_guide/virtio_snd_patches/000*`

- `make sound/virtio/virtio_snd.ko`

- For cross-compile please use: `make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- sound/virtio/virtio_snd.ko` >


**NOTE:** A **prebuilt** virtio_snd.ko module can be found under "[prebuilt_binaries](https://git.virtualopensystems.com/virtio-loopback/docs/-/tree/multi-sound-guide/prebuilt_binaries)" directory.

...