Virtual audio in LXC

VitaliyS

Member
Apr 5, 2021
2
0
6
36
Is it possible to create virtual audio in an LXC container?
I used the snd-aloop module on the host, mounted the kernel modules folder in the container, but neither aplay nor arecord show devices. /dev/snd is not created, but loopback is present in /proc/asound/devices.
How to get virtual audio?

Code:
root@3ed:~# modprobe snd-aloop

root@3ed:~# aplay -l
aplay: device_list:274: no soundcards found...

root@3ed:~# ls /dev/
.lxc-boot-id  core          full          initctl       lxc/          null          pts/          shm/          stdin         tty           tty2          zero         
console       fd/           hugepages/    log           mqueue/       ptmx          random        stderr        stdout        tty1          urandom       

root@3ed:~# cat /proc/asound/             
Loopback/ card0/    cards     devices   modules   oss/      pcm       seq/      timers    version   

root@3ed:~# cat /proc/asound/cards
 0 [Loopback       ]: Loopback - Loopback
                      Loopback 1
root@3ed:~# cat /proc/asound/devices
  2: [ 0- 0]: digital audio playback
  3: [ 0- 0]: digital audio capture
  4: [ 0- 1]: digital audio playback
  5: [ 0- 1]: digital audio capture
  6: [ 0]   : control
 33:        : timer
 
Containers use actual hardware (in a confined and unprivileged way) and not virtual (or emulated) hardware. Do you maybe want to allow the container to use an audio device on the Proxmox host? Can you explain more about the end result you want to achieve?
 
Containers use actual hardware (in a confined and unprivileged way) and not virtual (or emulated) hardware. Do you maybe want to allow the container to use an audio device on the Proxmox host? Can you explain more about the end result you want to achieve?
It is necessary to simultaneously process the same audio stream in different (several dozen) ways at the same time.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!