# FreeBSD without audio



## r0g3r (Nov 15, 2016)

Hi, my FreeBSD this no audio I've compiled the kernel and continues without sound followed the way to be in the handbook

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


----------



## shepper (Nov 15, 2016)

Sound in FreeBSD is complex and the page you linked is dated.  Several of the most popular sound drivers have already been compiled into the kernel for FreeBSD version 10.* and 11.0.  Even if you have an uncommon sound chip, you can load the module using kldload.

FreeBSD commonly sets up several pcm* devices and unless specified, pcm0 is the default.  pcm0 is often the hdmi driver for the video card.  In order to sort this out, I would start by posting your device information as was done is this thread : Thread 56956


----------



## r0g3r (Nov 15, 2016)

my devices: http://i.imgur.com/HvIpb2K.png
that helps a little?


----------



## SirDice (Nov 15, 2016)

Audio is detected and active. But the output is sent to the rear analog output (you can check with `cat /dev/sndstat`). You may be expecting to hear the audio from the built-in monitor speakers?


----------



## r0g3r (Nov 15, 2016)

actually I have two problems, not reproduces audio or videos from youtube


----------



## SirDice (Nov 15, 2016)

Stick to one issue at a time. Where do you expect the audio to output? Via the rear connector or via HDMI?


----------



## r0g3r (Nov 15, 2016)

the output or front output-rear


----------



## shepper (Nov 16, 2016)

If you are using speakers on the rear jack (should be the green one) and your default is pcm0, you should have sound.  How to change the default is in section 7.2.3 of the handbook you reference on your first post.  If pcm0 does not work, and you want to use the rear speakers, then there is a problem that needs to be sorted out.  To go down this path, provide the audio portion of a verbose dmesg.  How to do this and what the code looks like are in the manual page for snd_hda(4).

It may also prove useful to also test the front jack by setting the default to pcm1.  On a standard desktop, most users would like the rear sound to be muted when plugging headphones into the front.  Knowing if the front jack works will help in reassigning the nid pins.


----------



## r0g3r (Nov 16, 2016)

Hi, maybe the FreeBSD not be recognizing why my machine in virtualbox installed FreeBSD and I didn't have to configure anything, I was able to play audio and video on virtualbox, using another system


----------



## r0g3r (Nov 16, 2016)

in virtualbox works on my desktop not


----------



## marcelbonnet (Nov 16, 2016)

Hi, 

r0g3r , are you saying that FreeBSD is able to play when booted as a guest OS ? If so and the host itself, whatever OS it is, is capable of playing music, it is because the VirtualBox emulates a supported audio device to FreeBSD and the host  OS , which also has its own audio driver, outputs the sound from VirtualBox.

If you want FreeBSD to test and use the audio device as a host OS, everything changes. Those dmesg and sysctl output came from FreeBSD as a host or guest OS ?

One thing you can do: boot FreeBSD - as host OS - and start some program( audio/mpg23 , multimedia/mplayer , audio/sox , whatever ... ) to play a sound file. Take a look at mixer(8) and try to change volume levels from vol, pcm, etc ... also try to change output (rear, front, hdmi , etc...) . 

It seems you have the driver loaded - if that dmesg came from FreeBSD as a host OS.

`sysctl hw.snd.default_unit=0` will output to pcm0 . =1 to pcm1, and so on. This way you set the output device.

Good work, cheers.


----------



## r0g3r (Nov 16, 2016)

ok, I'll try


----------



## Zar Marco (Dec 1, 2016)

r0g3r have you resolved your problem? I have the same problem


----------



## r0g3r (Dec 2, 2016)

Zar Marco said:


> r0g3r have you resolved your problem? I have the same problem



still cannot solve


----------



## macondo (Jan 5, 2017)

r0g3r said:


> actually I have two problems, not reproduces audio or videos from youtube



I know nothing about multimedia. All I can tell you is what I did. I grabbed a FreeBSD 10.3 installation cd and installed. My opinion is that this version comes with sound enabled.


I went to the terminal and typed:

```
$ alsamixer
```

And went thru all the channels unmuting with the letter m.

Went to Firefox Extensions and typed "html 5" and got YouTube All HTML5, this one is for watching videos and movies. Just to make sure, I rebooted.
Went back and chose a video and no problems. Went to youtube.com chose a song and it worked.





On my other box, I installed DragonFlyBSD, no sound at all, but it's a fork from FreeBSD so I went to the link at the top of this thread:

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

And did the first 3 things: from the terminal:

First,

```
# kldload snd_hda
```
Pressed Enter

Second,
And put this:

```
snd_hda_load="YES"
```

in my /boot/loader.conf

And last, but not least:
Then just to make sure, I loaded in the file  /boot/defaults/loader.conf
this driver:

```
# kldload snd_driver
```

#reboot

Everything is working fine in both OSes, what can I tell you, luck of the Irish.


----------

