LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (https://www.linuxquestions.org/questions/%2Absd-17/)
-   -   Sound in FreeBSD on VIrtualBox (https://www.linuxquestions.org/questions/%2Absd-17/sound-in-freebsd-on-virtualbox-4175558192/)

frankbell 11-06-2015 03:16 PM

Sound in FreeBSD on VIrtualBox
 
I wavered between putting this here or in the Virtualization Forum and then decided on here because I think the answer will more likely be in BSD than in VirtualBox.

I use VMs for distro-hopping and learning. Recently, I've been trying to learn something about BSD (I was inspired to do so by Mary at SMLR). Note that this is not an urgent problem, but I am mighty curious.

I have both FreeBSD and PC-BSD in separate VMs and I cannot get audio in FreeBSD. I can get it in PC-BSD; indeed, it works quite nicely and I've been using it to listen to streaming audio just because I can. I tried all the diagnostics in the Free BSD Handbook short of trying to compile my own kernel and have had no luck.

Here are the facts:

VirtualBox v. 5.0.8 r103449 running on Slackware --Current.

Quote:

PC-BSD v. 10.2-Release-p4
FreeBSD v 10.1-RELEASE-P24
Both are up-to-date.

The host settings for both VM's say

Quote:

Host Driver: ALSA Audio Driver
Controller: Intel HD Audio
Note that I have tried all the available virtual controller settings with the FreeBSD VM; the other two options are "ICH AC97" and "SoundBlaster 16."

Here's the output of some diagnostics on PC-BSD.

Code:

# dmesg | grep pcm
pcm0: <Sigmatel STAC9221 (Analog 5.1/2.0)> at nid 12,11,15 and 13 on hdaa0
pcm1: <Sigmatel STAC9221 (Analog)> at nid 10 and 21 on hdaa0
pcm2: <Sigmatel STAC9221 (Rear Digital)> at nid 16 and 17 on hdaa0

Here's some diagnostics on FreeBSD.

Code:

$ dmesg | grep pcm
pcm0: <Sigmatel STAC9221 (Analog 5.1/2.0)> at nid 12,11,15 and 13 on hdaa0
pcm1: <Sigmatel STAC9221 (Analog)> at nid 10 and 21 on hdaa0
pcm2: <Sigmatel STAC9221 (Rear Digital)> at nid 16 and 17 on hdaa0
# cat /dev/sndstat
Installed devices:
pcm0: <Sigmatel STAC9221 (Analog 5.1/2.0)> (play/rec) default
pcm1: <Sigmatel STAC9221 (Analog)> (play/rec)
pcm2: <Sigmatel STAC9221 (Rear Digital)> (play/rec)

They sure look alike to me.

Any hints would be appreciated.

cynwulf 11-06-2015 04:14 PM

Can you check and compare kldstat(8) output for both FreeBSD and PCBSD?

frankbell 11-06-2015 10:02 PM

Certainly. (I ran the command on each VM and piped it to a file, then scp'd the files to the host which I am using as I type this.)

From FreeBSD:

Code:

$ cat fbsdkldstat.txt
Id Refs Address            Size    Name
 1  87 0xffffffff80200000 1755638  kernel
 2    1 0xffffffff81a11000 113f2    ipfw.ko
 3    1 0xffffffff81a23000 cbd      snd_driver.ko
 4    1 0xffffffff81a24000 5f96    snd_ad1816.ko
 5    1 0xffffffff81a2a000 5043    snd_als4000.ko
 6    1 0xffffffff81a30000 581f    snd_atiixp.ko
 7    1 0xffffffff81a36000 50d9    snd_cs4281.ko
 8    1 0xffffffff81a3c000 b741    snd_ds1.ko
 9    1 0xffffffff81a48000 7ce5    snd_envy24.ko
10    3 0xffffffff81a50000 1381    snd_spicds.ko
11    1 0xffffffff81a52000 6cb6    snd_envy24ht.ko
12    1 0xffffffff81a59000 52fd    snd_ess.ko
13    4 0xffffffff81a5f000 2533    snd_sbc.ko
14    1 0xffffffff81a62000 3ecf    snd_fm801.ko
15    2 0xffffffff81a66000 ae80    snd_mss.ko
16    1 0xffffffff81a71000 7d3c    snd_maestro.ko
17    1 0xffffffff81a79000 8efb    snd_maestro3.ko
18    1 0xffffffff81a82000 11066    snd_neomagic.ko
19    1 0xffffffff81a94000 4515    snd_sb16.ko
20    1 0xffffffff81a99000 4129    snd_sb8.ko
21    1 0xffffffff81a9e000 597d    snd_solo.ko
22    1 0xffffffff81aa4000 4a69    snd_t4dwave.ko
23    1 0xffffffff81aa9000 414e    snd_via82c686.ko
24    1 0xffffffff81aae000 4d8f    snd_vibes.ko

From PC-BSD:

Code:

$ cat pcbsdkldstat.txt
Id Refs Address            Size    Name
 1  121 0xffffffff80200000 14f9000  kernel
 2    2 0xffffffff819a0000 250ce    drm.ko
 3    1 0xffffffff819c6000 424c9    vboxguest.ko
 4    1 0xffffffff81a09000 10a2    vboxvideo.ko
 5    3 0xffffffff81a0b000 32545    crypto.ko
 6    1 0xffffffff81a3e000 4f29    aesni.ko
 7    1 0xffffffff81a43000 1f920    geom_eli.ko
 8    1 0xffffffff81a63000 2dfa92  zfs.ko
 9    2 0xffffffff81d43000 53ae    opensolaris.ko
10    1 0xffffffff81d49000 10c7a    tmpfs.ko
11    3 0xffffffff81d5a000 a8777    linux.ko
12    1 0xffffffff81e03000 229a9    geom_journal.ko
13    1 0xffffffff81e26000 22b13    geom_mirror.ko
14    1 0xffffffff81e49000 63ba    ums.ko
15    1 0xffffffff82011000 9d6c    linprocfs.ko
16    2 0xffffffff8201b000 42a0    libiconv.ko
17    1 0xffffffff82020000 1565    libmchain.ko
18    1 0xffffffff82022000 7dc      msdosfs_iconv.ko
19    1 0xffffffff82023000 309b3    if_bwn.ko
20    1 0xffffffff82054000 6ed1    siba_bwn.ko
21    1 0xffffffff8205b000 1fa79    if_bwi.ko
22    1 0xffffffff8207b000 273d    runfw.ko
23    1 0xffffffff8207e000 476a    cuse4bsd.ko
24    1 0xffffffff82083000 672d    sem.ko
25    1 0xffffffff8208a000 233b    geom_uzip.ko
26    1 0xffffffff8208d000 56fa    fdescfs.ko
27    1 0xffffffff82093000 5561    linsysfs.ko
28    1 0xffffffff82099000 2e58b    iwn4965fw.ko
29    1 0xffffffff820c8000 52db4    iwn1000fw.ko
30    1 0xffffffff8211b000 53a22    iwn5000fw.ko
31    1 0xffffffff8216f000 52d44    iwn5150fw.ko
32    1 0xffffffff821c2000 6f720    iwn6000fw.ko
33    1 0xffffffff82232000 a5d06    iwn6000g2afw.ko
34    1 0xffffffff822d8000 a6564    iwn6000g2bfw.ko
35    1 0xffffffff8237f000 73266    iwn6050fw.ko
36    1 0xffffffff823f3000 374a    acpi_video.ko
37    1 0xffffffff823f7000 ddc3    fuse.ko
38    1 0xffffffff82405000 2b7e    uhid.ko
39    1 0xffffffff82408000 112b3    ipfw.ko
40    1 0xffffffff8241a000 c7df    iscsi.ko
41    1 0xffffffff82427000 782b    autofs.ko

I must say that the FreeBSD Handbook is one of the finest pieces of documentation that I've ever RTFM'd (though the section about MP3's and XMMS needs a bit of updating).

Emerson 11-07-2015 04:35 AM

What does mixer command print?

hitest 11-07-2015 01:48 PM

You mentioned you tried all diagnostics in the Handbook.
Did you add your sound driver to /boot/loader.conf to enable sound to start at boot up?

Try # kldload snd_driver

To determine which driver was selected for the sound card after loading the snd_driver metadriver, type cat /dev/sndstat

https://www.freebsd.org/doc/handbook/sound-setup.html

frankbell 11-08-2015 08:32 PM

I did try kldload snd_driver. It reported that the driver was already loaded or in the kernel.

The output of the mixer command in the FreeBSD VM is

Code:

Mixer vol      is currently set to  75:75
Mixer pcm      is currently set to  75:75
Mixer speaker  is currently set to  75:75
Mixer mic      is currently set to  50:50
Mixer rec      is currently set to  1:1
Recording source: mic


I should have mentioned this earlier: when I try to play audio in qmmp, the player acts as if it's playing something, but no sound comes out. The little mixer window in the upper left of the main window goes up and down.

Sound comes out of my other VMs, so, if there's host setting somewhere for this particular VM that's the issue, I have no idea what it possibly might be.

Emerson 11-09-2015 07:23 AM

What kind of emulated card does FreeBSD see? lspci

frankbell 11-11-2015 08:16 PM

This is the audio-related output of pciconf -lv (thanks! I learned a new command):

Code:

hdac0@pci0:0:5:0:      class=0x040300 card=0x76808384 chip=0x26688086 rev=0x01 hdr=0x00
    vendor    = 'Intel Corporation'
    device    = '82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio Controller'
    class      = multimedia
    subclass  = HDA
    cap 01[50] = powerspec 2  supports D0 D3  current D0

This is the output of the same command on PC-BSD

Code:

hdac0@pci0:0:5:0:      class=0x040300 card=0x76808384 chip=0x26688086
rev=0x01 hdr=0x00
    vendor    = 'Intel Corporation'
    device    = '82801FB/FBM/FR/FW/FRW (ICH6 Family) High Definition Audio
Controller'
    class      = multimedia
    subclass  = HDA


Emerson 11-12-2015 03:11 AM

Below is snippet from my kernel conf (I configure my kernels by hand). I have snd_hda and snd_ich built in for Intel ICH7 sound, you should have them as modules.
Code:

# Sound support
device          sound          # Generic sound driver (required)
# device                snd_cmi        # CMedia CMI8338/CMI8738
# device                snd_csa        # Crystal Semiconductor CS461x/428x
# device                snd_emu10kx    # Creative SoundBlaster Live! and Audigy
# device                snd_es137x      # Ensoniq AudioPCI ES137x
device          snd_hda        # Intel High Definition Audio
device          snd_ich        # Intel, NVidia and other ICH AC'97 Audio
# device                snd_via8233    # VIA VT8233x Audio


hitest 11-12-2015 01:04 PM

frankbell,

I ran FreeBSD 10.2 on this box for a few days and I was able to get sound support working. However, I'm back to running OpenBSD 5.8 which supports my sound card out of the box with no messing about.
In your OS evaluations you may wish to consider giving OpenBSD 5.8/amd a shot in Virtualbox. I think you might like it. OpenBSD is my favourite BSD compared to FreeBSD and NetBSD.

frankbell 11-13-2015 08:36 PM

Emerson, I'll try to track that down tomorrow, but I might not get to it until Monday. I try not to geek out too much when my girlfriend doesn't have to go to work.;)

hitest, I do want to give OpenBSD a try. I'm having a lot of fun learning about BSDs. I'd kind of like to figure this issue out as part of that learning process.

I promise I'll get around to OpenBSD. I'm not going to stop until I can manually partition a hard drive using BSD lingo.

hitest 11-14-2015 09:04 AM

Quote:

Originally Posted by frankbell (Post 5449468)
I promise I'll get around to OpenBSD. I'm not going to stop until I can manually partition a hard drive using BSD lingo.

The OpenBSD man pages and on-line documentation are great sources of information. I purchased Absolute OpenBSD 2nd Edition by Michael Lucas; it is an exceptional book that covers disk partitioning and a myriad of other topics.

frankbell 11-17-2015 11:35 AM

I must say I am on completely unfamiliar ground here.

I wandered around my file system and was mildly surprised to find that /proc was empty. I followed the instructions from several pages turned up by a web search and finally found an old post here at LQ to show loaded modules. Here's the output from that post (I added the grep for "snd"). Am I on the right track?


Code:

$ ls /boot/kernel | grep -v kernel | grep snd > snd.txt 
$ cat snd.txt
snd_ad1816.ko
snd_ad1816.ko.symbols
snd_als4000.ko
snd_als4000.ko.symbols
snd_atiixp.ko
snd_atiixp.ko.symbols
snd_cmi.ko
snd_cmi.ko.symbols
snd_cs4281.ko
snd_cs4281.ko.symbols
snd_csa.ko
snd_csa.ko.symbols
snd_driver.ko
snd_driver.ko.symbols
snd_ds1.ko
snd_ds1.ko.symbols
snd_emu10k1.ko
snd_emu10k1.ko.symbols
snd_emu10kx.ko
snd_emu10kx.ko.symbols
snd_envy24.ko
snd_envy24.ko.symbols
snd_envy24ht.ko
snd_envy24ht.ko.symbols
snd_es137x.ko
snd_es137x.ko.symbols
snd_ess.ko
snd_ess.ko.symbols
snd_fm801.ko
snd_fm801.ko.symbols
snd_hda.ko
snd_hda.ko.symbols
snd_hdspe.ko
snd_hdspe.ko.symbols
snd_ich.ko
snd_ich.ko.symbols
snd_maestro.ko
snd_maestro.ko.symbols
snd_maestro3.ko
snd_maestro3.ko.symbols
snd_mss.ko
snd_mss.ko.symbols
snd_neomagic.ko
snd_neomagic.ko.symbols
snd_sb16.ko
snd_sb16.ko.symbols
snd_sb8.ko
snd_sb8.ko.symbols
snd_sbc.ko
snd_sbc.ko.symbols
snd_solo.ko
snd_solo.ko.symbols
snd_spicds.ko
snd_spicds.ko.symbols
snd_t4dwave.ko
snd_t4dwave.ko.symbols
snd_uaudio.ko
snd_uaudio.ko.symbols
snd_via8233.ko
snd_via8233.ko.symbols
snd_via82c686.ko
snd_via82c686.ko.symbols
snd_vibes.ko
snd_vibes.ko.symbols


Emerson 11-17-2015 11:42 AM

This is the output of kldstat ?!

hitest 11-17-2015 01:18 PM

frankbell,

Are you running an up to date version of Virtualbox? Guest additions added? I know that vbox can on occasion have difficulty identifying devices.


All times are GMT -5. The time now is 05:26 AM.