Duplicate intel hda sound card in guest

Fail

Member
Nov 16, 2018
5
2
23
43
Hi All, I can't understand if it is a bug of the driver o something related to Proxmox.

For testing an application, I need a sound card. I added to a debian 11 guest and audio device with:

Code:
qm set <VMID> -audio0 device=ich9-intel-hda

aplay -l

Code:
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: Generic Analog [Generic Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 2: Generic Analog [Generic Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0

Same thing happens in windows guest, resulting in 2 devices.

If i switch to AC97 card, only 1 card is displayed.


The problem is that launching alsamixer results in an error:

Code:
alsamixer
ALSA lib simple_none.c:1544:(simple_add1) helem (MIXER,'Master Playback Switch',0,1,0) appears twice or more
cannot load mixer controls: Invalid argument
 
can you post the complete vm config?
 
The Q35 virtual motherboard has an audio device (which does nothing AFAIK) and when you add a working virtual audio devices, you end up with two. I tend to use options pci_stub ids=8086:293e inside Linux VMs to disable and hide the non-working virtual motherboard device.
 
  • Like
Reactions: janssensm
can you post the complete vm config?


Fresh install of debian 11
Linux:

Code:
agent: 1
audio0: device=ich9-intel-hda
boot: order=scsi0;ide2;net0
cores: 2
ide2: local:iso/debian-11.5.0-amd64-netinst.iso,media=cdrom,size=382M
memory: 2048
meta: creation-qemu=7.1.0,ctime=1674125083
name: debian-test
net0: virtio=66:16:35:DD:AA:00,bridge=vmbr0
numa: 0
ostype: l26
scsi0: local-raid60-thin:vm-105-disk-0,cache=writeback,discard=on,iothread=1,size=32G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=3513a1bb-951b-4981-8ee2-1f8cb165c72d
sockets: 1
vmgenid: 2f90b278-989a-4eb9-b000-ad401e3fda8a

Windows:

Code:
agent: 1
audio0: device=ich9-intel-hda,driver=none
boot: cdn
bootdisk: scsi1
cores: 4
cpu: host
machine: pc-i440fx-7.1
memory: 4096
name: win10
net0: virtio=8A:17:26:72:5E:CD,bridge=vmbr2
numa: 0
ostype: win7
scsi1: local-lvm:vm-100-disk-0,cache=writeback,iothread=1,size=32G
scsihw: virtio-scsi-single
smbios1: uuid=e0a65291-b299-4640-965f-c4786b58fbf8
sockets: 1
vga: virtio
vmgenid: 111a9c64-b8d1-40d6-937d-8285f730b103


The Q35 virtual motherboard has an audio device (which does nothing AFAIK) and when you add a working virtual audio devices, you end up with two. I tend to use options pci_stub ids=8086:293e inside Linux VMs to disable and hide the non-working virtual motherboard device.

My vm motherboard is old i440fx. If i set audio device to AC97 does not happen.

lspci shows only one card.

root@debian:/home/roby# lspci
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01)
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
00:02.0 VGA compatible controller: Device 1234:1111 (rev 02)
00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon
00:05.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
00:08.0 Communication controller: Red Hat, Inc. Virtio console
00:12.0 Ethernet controller: Red Hat, Inc. Virtio network device
00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
00:1f.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge
01:01.0 SCSI storage controller: Red Hat, Inc. Virtio SCSI
03:0c.0 Audio device: Intel Corporation 82801I (ICH9 Family) HD Audio Controller (rev 03)
 
Last edited:
In order to have audio.. can it be better to passthroug the pci audio board and then install the driver in your windows10 vm ? The option of adding : ich9-intel-hda , wasn't it only to be used with spice display to get audio related, like rdp, but no have audio in the vm for something else...
 
In order to have audio.. can it be better to passthroug the pci audio board and then install the driver in your windows10 vm ? The option of adding : ich9-intel-hda , wasn't it only to be used with spice display to get audio related, like rdp, but no have audio in the vm for something else...

Yes, would be better.. but I have a server motherboard without integrated audio. As I said, i need an audio card to test an application that needs 5.1 or 7.1 output. For now, under linux, as a workaround I'm using a virtual dummy sound card ( snd-dummy module ) with a proper asound.conf
 
This is quite offtopic but I'll explain better.

That is quite interesting.. Can it be possible to share the config and setting of that asound file ?

Background: what I'm trying to achieve is a DIY wireless multichannel audio setup ( sonos like ). This is possible thanks to snapcast server. Snapcast can take different sources as input as 2 channels, and send the output to clients in sync. What i'm trying to do is splitting 6 channel in 3x2 channels or 6x2 channels ( with 1 channel muted ) and writing fifo files that snapcast can use as input sources. The alsa.conf below does this but only for left/right/center channels ( i'm simulating this 2.1 setup using 3 mobile phones running snapclient ) At every speaker will be a raspberry pi with snapclient that can select the correct snapserver output.

kodi mediaplayer -> audio split to fifo files -> snapserver with multiple fifo input and output -> snapclients connected to speakers

First of all you have to load dummy driver and set options:

Code:
##debian /etc/modules

snd-dummy
snd-pcm-oss
snd-mixer-oss
snd-seq-dummy

Code:
root@nas:~# cat /etc/modprobe.d/alsa.conf
       # ALSA portion
       alias char-major-116 snd
       alias snd-card-0 snd-dummy
       # module options should go here
      
       # OSS/Free portion
       alias char-major-14 soundcore
       alias sound-slot-0 snd-card-0
      
       # card #1
       alias sound-service-0-0 snd-mixer-oss
       alias sound-service-0-1 snd-seq-oss
       alias sound-service-0-3 snd-pcm-oss
       alias sound-service-0-8 snd-seq-dummy
       alias sound-service-0-12 snd-pcm-oss


This is my alsa.conf

Code:
root@nas:~# cat /etc/asound.conf
pcm.!default {
    type plug
    slave {
        pcm rate44100Hz # Direct default output to the below converter
        channels 6
    }
}

pcm.rate44100Hz {
    type rate
    slave {
        pcm writeFile #Direct to the plugin which will write to a file
        format S16_LE
#        channels 2
        rate 44100
    }
    #route_policy copy
}


pcm.writeFile {
    type plug
    slave.pcm {
       type multi
       slaves {
         a {channels 2 pcm "chfrontleft"}
         b {channels 2 pcm "chfrontright"}
       }
       bindings{
        0 {slave a channel 0}
        1 {slave a channel 1}
        2 {slave b channel 0}
        3 {slave b channel 1}
       }
    }
    ttable [
    ##  1 2 3 4 ##

      [ 1 0 1 0 ] #Source FL  -> a.frontleft b.frontleft
      [ 0 1 0 1 ] #Source FR  -> a.frontright b.frontright
      [ 1 1 1 1 ] #Source C   -> a.center b.center
      [ 0 0 0 0 ] #Source LFE -> a.lfe b.lfe
      [ 0 0 0 0 ] #Source BL  -> a.backleft b.backleft
      [ 0 0 0 0 ] #Source BR  -> a.backright b.backright
      
    ]
}

pcm.chfrontleft {
    type file
    file "/tmp/audio/snapfifo_fl"
    format "raw"
    slave {pcm null}
}

pcm.chfrontright {
    type file
    slave {pcm null}
    file "/tmp/audio/snapfifo_fr"
    format "raw"
}
pcm.chbackleft {
    type file
    slave {pcm null}
    file "/tmp/audio/snapfifo_bl"
    format "raw"
}
pcm.chbackright {
    type file
    slave {pcm null}
    file "/tmp/audio/snapfifo_br"
    format "raw"
}
pcm.chcenter {
    type file
    slave {pcm null}
    file "/tmp/audio/snapfifo_c"
    format "raw"
}
pcm.chlfe {
    type file
    slave {pcm null}
    file "/tmp/audio/snapfifo_lfe"
    format "raw"
}




pcm.dummy {
  type hw
  card 0
}
      
ctl.dummy {
  type hw
  card 0
}
 
  • Like
Reactions: Docop2

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!