Solved setup virtual Audio driver inside VMware VM with FreeBSD like guestOS

how to setup old creative Sound Blaster offered by VMware as virtual audio adapter inside a VM with FreeBSD, while it's easy to setup Intel HD Audio driver by VirtualBox, other hypervisor virtual card cause sound distortion and noise until it's also freeze and break audio inside VM and an issue with original Intel host audio service. Host Windows 11 Home. it should be the Vadapter Creative AudioPCI (ES1371)
FreeBSD 13.1 64-bit - VMware Workstation 16 Player (Non-commercial use only) 06_09_2022 08_53_58.png
 
i just typed :kldload snd_driver and write snd_driver_load="YES" in /boot/loader.conf . I should try..thanks ,now i do and then tell you if resolve my problem
 
i read the knowledge sheet by Vmware and before a thread Sound is not working...about an issue with windowsOS like guest where was expressly said :to didn't type sound.virtualDev = "sb16", or "sound.virtualdev = "hdaudio"
in vmx config file and check that are instaed :
sound.present = "TRUE"
sound.filename = "-1"
sound.autodetect = "TRUE"
and I look ,yet was present,in VMX, but i lack in configuration, freeBSD side, I tried to configure manually throw
/boot/device.hints, but this solution, without correct knowledge has worsened my situation, and VMware choose to disable Virtual card adapter.
 
Did you successfully use this soundcard on this host under FreeBSD VM under different hypervisor? Meaning you have FreeBSD VM detect the desired soundcard under different hypervisor. If so what driver is FreeBSD using there? (kldstat).
 
i use IntelHDaudio in VirtualBox and with kldload snd_hda and snd_hda_load="YES" in /boot/loader.conf, work like a charm with pulseaudio. On VMware setting i ticked :use default host sound card, and i think should be automatically detect IntelHDaudio because host OS, use smart sound Intel technology..or not?
kldstat.png
 
Above there is kldstat | less by FreeBSD VM in vmware,and under there is Virtualbox kldstat -v
Vbox kldstat.png
 
Handful of sound drivers are built in to FreeBSD kernel, you don't need to manually load them. pciconf -lv would also show you that driver is attached. I don't have Windows machine at hand now but I tested it under VMware Fusion. The default sound card is the same as you have shown in your original post.
Code:
vmfbsd13(~)# dmesg |grep pcm
pcm0: <AudioPCI ES1371-A> port 0x2040-0x207f irq 16 at device 2.0 on pci2
pcm0: <Cirrus Logic CS4297A AC97 Codec>
pcm0: <Playback: DAC1,DAC2 / Record: ADC>
vmfbsd13(~)#
With the driver attached:
Code:
vmfbsd13(~)# pciconf -lva pcm0
pcm0@pci0:2:2:0:    class=0x040100 rev=0x02 hdr=0x00 vendor=0x1274 device=0x1371 subvendor=0x1274 subdevice=0x1371
    vendor     = 'Ensoniq'
    device     = 'ES1371/ES1373 / Creative Labs CT2518'
    class      = multimedia
    subclass   = audio
vmfbsd13(~)#
And the driver snd_es137x(4)
Code:
vmfbsd13(~)# kldstat -v|grep es13
        253 pci/snd_es137x
vmfbsd13(~)#
Your 2nd picture confuses me a bit, as I can see VMware modules there I'm assuming it's from VMware VM and you manually tried to load all the drivers. As mentioned some are already present in generic kernel (hence my kldstat -v to give you verbose output).

Now to your original question: can you change the virtual sound card under VMware? Fusion doesn't give me this option; I can only select I/O device. But Fusion sadly don't present all possible options to user. I tried the link I shared, with that I can't see the card at all. I know, it's a legacy card. But I was not able to figure out what would be missing to at least detect the unknown device (even devinfo is not mentioning it). Log on host side is ok too:
Code:
2022-09-06T13:55:54.212+02:00| vmx| I005: DICT          sound.autoDetect = "TRUE"
2022-09-06T13:55:54.212+02:00| vmx| I005: DICT            sound.fileName = "-1"
2022-09-06T13:55:54.212+02:00| vmx| I005: DICT             sound.present = "TRUE"
2022-09-06T13:55:54.212+02:00| vmx| I005: DICT       sound.pciSlotNumber = "34"
2022-09-06T13:55:54.212+02:00| vmx| I005: DICT        sound.opl3.enabled = "TRUE"
2022-09-06T13:55:54.212+02:00| vmx| I005: DICT          sound.virtualDev = "sb16"
I'm leaning towards an opinion you can't do what you want under VMware.
 
the first image is about freeBSD VM VMware with snd_driver_load, look it charged all possible audio driver to autoconfigure the audio connector if you didnt know exactly which is the correct one, second image , it is just VirtualBox VM with virtual Intel audio driver adapter by sigmatel , it's easy to me to configure 'cos just I need to charge snd_hda and all work as should ,sound is good and I can amplify audio output. in VMware setting i can choose between two options or :-1 use default host sound card.-2specify host sound card (and in my case is just Intel smart sound technology speakers) I ticked first option.
its's exactly this one:
Code:
pciconf -lva pcm0
pcm0@pci0:2:2:0:    class=0x040100 rev=0x02 hdr=0x00 vendor=0x1274 device=0x1371 subvendor=0x1274 subdevice=0x1371
    vendor     = 'Ensoniq'
    device     = 'ES1371/ES1373 / Creative Labs CT2518'
    class      = multimedia
    subclass   = audio
anyway in both cases it has created an issue about sound, in second case ,also host side, freezing audio
 
I was able to identify the images based on the guest modules (vmware/vbox) but was a bit confused when I read your description.

Anyway in default FreeBSD installation (generic kernel) there should be no need to load anything extra, support for that card is built in (at least on 13 where I tested it).
In this regard VirtualBox does provide more options for you to configure on host side. I don't think you can do much on VMware side here.
 
well.inside FreeBSD Handbook there is paragraph in Multimedia ,that's talking about soundblaster card configuration:

Non-PnP ISA sound cards may require the IRQ and I/O port settings of the card to be added to /boot/device.hints. During the boot process, loader(8) reads this file and passes the settings to the kernel. For example, an old Creative SoundBlaster® 16 ISA non-PnP card will use the snd_sbc(4) driver in conjunction with snd_sb16. For this card, the following lines must be added to the kernel configuration file:
device snd_sbc
device snd_sb16
If the card uses the 0x220 I/O port and IRQ 5, these lines must also be added to /boot/device.hints:
hint.sbc.0.at="isa"
hint.sbc.0.port="0x220"
hint.sbc.0.irq="5"
hint.sbc.0.drq="1"
hint.sbc.0.flags="0x15"
The syntax used in /boot/device.hints is described in sound(4) and the manual page for the driver of the sound card.
The settings shown above are the defaults. In some cases, the IRQ or other settings may need to be changed to match the card. Refer to snd_sbc(4) for more information about this card.
 
The syntax used in /boot/device.hints is described in sound(4) and the manual page for the driver of the sound card.
i check then https://www.freebsd.org/cgi/man.cgi?query=sound&sektion=4&format=html .

Legacy Hardware
For old legacy ISA cards, the driver looks for MSS cards at addresses
0x530 and 0x604. These values can be overridden in /boot/device.hints.
Non-PnP sound cards require the following lines in device.hints(5):

hint.pcm.0.at="isa"
hint.pcm.0.irq="5"
hint.pcm.0.drq="1"
hint.pcm.0.flags="0x0"

Apart from the usual parameters, the flags field is used to specify the
secondary DMA channel (generally used for capture in full duplex cards).
Flags are set to 0 for cards not using a secondary DMA channel, or to
0x10 + C to specify channel C.
It didnt should be snd_es137x(4)?
SND_ES137X(4) FreeBSD Kernel Interfaces Manual SND_ES137X(4)

NAME
snd_es137x -- Ensoniq AudioPCI ES137x bridge device driver

SYNOPSIS
To compile this driver into the kernel, place the following lines in your
kernel configuration file:

device sound
device snd_es137x

Alternatively, to load the driver as a module at boot time, place the
following line in loader.conf(5):

snd_es137x_load="YES"

DESCRIPTION
The snd_es137x bridge driver allows the generic audio driver sound(4) to
attach to the Ensoniq 137x audio cards.

Runtime Configuration
The following sysctl(8) variables are available in addition to those
available to all sound(4) devices:

hw.snd.pcm%d.latency_timer Controls the PCI latency timer setting.
Increasing this value will solve most
popping and crackling issues (espe-
cially on VIA motherboards).

hw.snd.pcm%d.spdif_enabled Enables S/PDIF output on the primary
playback channel. This sysctl(8) vari-
able is available only if the device is
known to support S/PDIF output.

and then....

dev.pcm.%d.polling Experimental polling mode, where the
driver operates by querying the device
state on each tick using callout(9).
Polling is disabled by default. Do not
enable it unless you are facing weird
interrupt problems or if the device
cannot generate interrupts at all.

HARDWARE
The snd_es137x driver supports the following sound cards:

+o Creative CT5880-A
+o Creative CT5880-C
+o Creative CT5880-D
+o Creative CT5880-E
+o Creative SB AudioPCI CT4730
+o Ensoniq AudioPCI ES1370
+o Ensoniq AudioPCI ES1371-A
+o Ensoniq AudioPCI ES1371-B
+o Ensoniq AudioPCI ES1373-A
+o Ensoniq AudioPCI ES1373-B
+o Ensoniq AudioPCI ES1373-8
I should try this?
snd_es137x_load="YES"
 
my sound crackling a lot ?
hw.snd.pcm%d.latency_timer Controls the PCI latency timer setting.
Increasing this value will solve most
popping and crackling issues (especially on VIA motherboards).​
 
Well main problem isn't FreeBSD as a guest but rather hypervisor. es137x driver is part of the kernel so you don't need to load anything else. Commands I showed above will help you identify that the driver is already connected. You hear sound so driver is attached. I'm assuming you have open-vm-tools installed as I've seen vmmemctl loaded in your output.

Do you have these sound issues on all hypervisors or VMware only?

edit: for me to test on my fusion, what do you do to test sound?
 
Just VMware How like I said yet, Virtualbox work fine, I tested a FreeBSD also as nested VM in Hyper-V with Windows 11 pro on Vmware player and apart lack by microsoft virtual drivers support, work without issue, I tried with xrdp ,generation 1,
mouse and keyboad working well...It need only kern.evdev.rcpt_mask=6?
 
I could solve this issue,I needed just to change .vmx parameters,it was my fault cause privacy concern, i had disable microphone access to the apps in VMware. There aren't two differents options in setting, to grant access to audio, output and input, like in VirtualBox,and Cortana in other VM crashed without gave me chance to change privacy setting.So vmware didnt have chance to recognize hda audio settings
sound.autoDetect = "TRUE"
sound.virtualDev = "hdaudio"
sound.fileName = "-1"
sound.present = "TRUE"
i don't know why when I created VM, first time VMware had chosen "Ensoniq S16". I checked was 1997 pci audio adapter,? instead of hda audio sound
 
I like VMware a lot, it's my hypervisor of choice when it comes to virtualization (followed by qemu). But these hidden options always drove me crazy. I don't understand why VMware doesn't show these options in advance menu,etc.

I pulled my "work shovel", notebook with windows 10 and tested it on VMware Workstation I have there. I can only use "default" or sound card that is on the system. As notebook has only one card I can choose only one. But it doesn't matter what I choose, internally VMware uses this virtual es137x card. Only when I set the virtualDev manually in the config (vmx) it works. I don't understand why this is not presented in UI.
There are handful of options that can be put into config and UI is not aware of them.
 
Primaly, I think it is just for commercial reasons VMware workstation Pro have this chance to modify diffents parameters inside VMs, in Player version just need to modify .vmx, maybe it's the same with Fusion, also VirtualBox have a lot of parameters that's we could modify throw powershell and cmd with direct commands ,when VMs are shut downed,and those can't to be with GUI, and if you use VMware ESXi ,also a Vmware-cli command tools with powershell,and and dev-virtual-guest-tools and support.Thanks for your help;)
last thing ...how can mark like solved this post??
 
I think it is just for commercial reasons VMware workstation Pro have this chance to modify diffents parameters inside VMs,
Unfortunately no. I own Workstation Pro/Fusion and it's not there. But yeah, if you're lucky and google what to put where it works nicely.
It's been some time since I started new thread, you should see it somewhere in the original edit of the post.
 
Back
Top