# New to Pure [Free]BSD And Having Some Issues



## Shiggitay (Jan 27, 2022)

Hello all! This is my first post here. I am new to FreeBSD and the like, but I've used (and currently have installed) Arch Linux and macOS on several computers in my room/home office here. I recently decided to wipe my Windows SSD on my main system (a custom AMD Ryzen 9 build I did) to play with FreeBSD because I'd never been able to experience a true pure BSD system before. I managed to get a base 13-RELEASE system installed with X and KDE Plasma 5 (I ultimately want GNOME 3.x and then upgrade to 40 or 41 whenever that's available... BUT I have an AMD Radeon RX 480 4GB GPU that has documented issues with X and GNOME and other stuff). I'm very happy with the speed and responsiveness of FreeBSD vs my Arch Linux install (of which is no slouch) but I can't really do anything without audio if I wanna use it as an alternate (and hopefully at some point replacement) desktop OS/workstation.

So, here's what's not working:

• No audio anywhere throughout the system. KDE's KMix or w/e it's called nowadays sees my GPU's HDMI audio out of which I'm not using, and I think it sees my motherboard's line out "green jack" but no audio plays at all through my speakers. Am I missing a driver pkg or is it just not in my kernel or something? KMix sees the non-HDMI audio out option as "Realtek ALC892 (Analog)". I read on another post here that the command "sndstat" can be run to see what has a connection, but I apparently don't have the pkg that provides it? What pkg provides sndstat? The audio chipset according to lspci is: "[AMD] Starship/Matisse HD Audio Controller".

• I cannot for the life of me get Grub on my Arch Linux NVMe to chainload into FreeBSD should I want to use it over Arch itself. That's a minor thing, as I can easily F11 (Boot menu on reboot) and choose the proper secondary SSD to boot into FreeBSD, but it'd be nice not to have to do that.

• YouTube does not play in Chromium but will in FireFox. I'd prefer to use Chromium as I have a deep

With all that said, I'm going to post this on FreeBSD's subreddit as well to get more exposure of my issues, but all in all I am loving FreeBSD and if these issues are resolved I might daily drive it for a bit to see how I like a BSD system vs a Linux system.

TIA,
Sorry if this kind of post was made before (I couldn't find it in a search),
Shiggitay#1839 (my Discord hash/handle. Feel free to DM me if you can help me get my issues sorted.)


----------



## SirDice (Jan 27, 2022)

Shiggitay said:


> I read on another post here that the command "sndstat" can be run to see what has a connection, but I apparently don't have the pkg that provides it? What pkg provides sndstat?


Not a command, not a package either. It's part of the sound driver framework; `cat /dev/sndstat`. Also see the use of the `hw.snd.default_unit` sysctl(8) to change the default audio output.









						Chapter 8. Multimedia
					

FreeBSD supports a wide variety of sound cards, allowing users to enjoy high fidelity output from a FreeBSD system




					docs.freebsd.org


----------



## zirias@ (Jan 27, 2022)

Shiggitay said:


> I'd prefer to use Chromium


Be aware that Chromium decided to not accept any portability patches required for BSD, they don't want to support BSD at all. That's why the FreeBSD port is littered with local patches. As a consequence

Bugs are more likely than on supported platforms (and happen regularly)
It takes quite some time for new versions to be ported (maintaining this huge mess of patches is a ton of work)
That said, Chromium works for me at the moment (with a few broken things that aren't too important for me). Still you might reconsider and prefer Firefox instead.


----------



## Shiggitay (Jan 27, 2022)

SirDice said:


> Not a command, not a package either. It's part of the sound driver framework; `cat /dev/sndstat`. Also see the use of the `hw.snd.default_unit` sysctl(8) to change the default audio output.
> 
> 
> 
> ...


I tried doing all that (am I still missing something?), and in KMix when I play a local MKV video I can see audio playing, but I can't hear it. 



Zirias said:


> Be aware that Chromium decided to not accept any portability patches required for BSD, they don't want to support BSD at all. That's why the FreeBSD port is littered with local patches. As a consequence
> 
> Bugs are more likely than on supported platforms (and happen regularly)
> It takes quite some time for new versions to be ported (maintaining this huge mess of patches is a ton of work)
> That said, Chromium works for me at the moment (with a few broken things that aren't too important for me). Still you might reconsider and prefer Firefox instead.


I mean sure.. I'll use whatever works the best... I don't mind building the port myself (I have a beefy enough system that it shouldn't take THAT long...).

How would I resolve my audio issues? I did kldload snd_driver and snd_hda, and it seems to have loaded since it didn't complain... kldstat shows some audio drivers loaded, but I still can't hear anything from my speakers. With ZERO changes to where the speakers are connected on my Linux side it works without a hitch.


----------



## SirDice (Jan 27, 2022)

Shiggitay said:


> I tried doing all that (am I still missing something?), and in KMix when I play a local MKV video I can see audio playing, but I can't hear it.


Forget about KDE for the moment, if FreeBSD itself doesn't activate or enable your sound card everything else won't be able to use it either.



Shiggitay said:


> How would I resolve my audio issues? I did kldload snd_driver and snd_hda, and it seems to have loaded since it didn't complain... kldstat shows some audio drivers loaded, but I still can't hear anything from my speakers.


Post the output of `cat /dev/sndstat`.


----------



## Shiggitay (Jan 27, 2022)

SirDice said:


> Forget about KDE for the moment, if FreeBSD itself doesn't activate or enable your sound card everything else won't be able to use it either.
> 
> 
> Post the output of `cat /dev/sndstat`.




```
shiggitay@VocaloidHavenFreeBSD:~ % cat /dev/sndstat
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <ATI R6xx (HDMI)> (play)
pcm2: <ATI R6xx (HDMI)> (play)
pcm3: <ATI R6xx (HDMI)> (play)
pcm4: <ATI R6xx (HDMI)> (play)
pcm5: <ATI R6xx (HDMI)> (play)
pcm6: <Realtek ALC892 (Analog)> (play/rec) default <===== that's the device I see getting audio in KMix
pcm7: <Realtek ALC892 (Front Analog Mic)> (rec)
pcm8: <USB audio> (rec)
pcm9: <USB audio> (rec)
pcm10: <USB audio> (play/rec)
Installed devices from userspace:
dsp: <Virtual OSS> (play/rec)
```
Thank you btw for your time.


----------



## Friend Of Jolly Devil (Jan 27, 2022)

You can find some useful info here and here, but it could be too much for a novice user.


----------



## mer (Jan 27, 2022)

pcm6 is likely the rear audio connectors.  Is that where you have speakers or headphones plugged in?
please post output of (you may need to run as root or sudo)
`sysctl hw.snd.default_unit`
if it does not say "6" and you do have speakers/headphones plugged into the rear analog audio jacks, try the following as root:
`sysctl -w hw.snd.default_unit=6`

What are the USB Audio devices?  Is pcm10 a set of USB headphones with a mic?
I don't use KDE/KMix but there should be a way for you to switch the "default device" somehow with the tools.  If so, and you see something like the headphones for USB audio try setting to that.


----------



## Shiggitay (Jan 27, 2022)

mer said:


> pcm6 is likely the rear audio connectors.  Is that where you have speakers or headphones plugged in?
> please post output of (you may need to run as root or sudo)
> `sysctl hw.snd.default_unit`
> if it does not say "6" and you do have speakers/headphones plugged into the rear analog audio jacks, try the following as root:
> ...


shiggitay@VocaloidHavenFreeBSD:~ % sysctl hw.snd.default_unit
hw.snd.default_unit: 6
shiggitay@VocaloidHavenFreeBSD:~ % sysctl -w hw.snd.default_unit=6
hw.snd.default_unit: 6 -> 6

Also yes. The USB audio devices are a crappy Logitech headset I use only for its headphones and a USB mic. I've tried issuing sysctl -w hw.snd.default_unit=10 but no joy out of the Logitech headset's headphones.



Friend Of Jolly Devil said:


> You can find some useful info here


I tried that but no dice.


----------



## Geezer (Jan 27, 2022)

If you want a_ complete_ desktop, it will not work out of the box. You will have to read and re-read the manual a few times, and spend at least a few days (more like a few years), to get everything running the way you like.

Sound most definitely can and does work.

 Chromium does work for youtube.


----------



## zirias@ (Jan 27, 2022)

Shiggitay said:


> I don't mind building the port myself


That won't change anything, the binary packages are just built from ports with default settings. Have a look at my link to understand why trying to catch up with keeping Chromium to work on FreeBSD at all is a major struggle...

About sound, maybe too obvious, but what's the output of `mixer`?


----------



## Shiggitay (Jan 27, 2022)

Zirias said:


> That won't change anything, the binary packages are just built from ports with default settings. Have a look at my link to understand why trying to catch up with keeping Chromium to work on FreeBSD at all is a major struggle...
> 
> About sound, maybe too obvious, but what's the output of `mixer`?




```
shiggitay@VocaloidHavenFreeBSD:~ % mixer
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100
Mixer speaker  is currently set to 100:100
Mixer line     is currently set to 100:100
Mixer mic      is currently set to  97:97
Mixer mix      is currently set to 100:100
Mixer rec      is currently set to 100:100
Mixer igain    is currently set to 100:100
Mixer ogain    is currently set to 100:100
Recording source: line
```
Re: building chromium, I started a compile and it's going super quick... I don't intend on "keeping up" with it... I'll swap over to FireFox once I get everything working right, but I was just curious to see how all that works on FreeBSD.


----------



## Shiggitay (Jan 27, 2022)

Geezer said:


> If you want a_ complete_ desktop, it will not work out of the box. You will have to read and re-read the manual a few times, and spend at least a few days (more like a few years), to get everything running the way you like.
> 
> Sound most definitely can and does work.
> 
> Chromium does work for youtube.


I'm aware a vanilla FreeBSD install (i.e. not Dragonfly or GhostBSD that're tailored for desktop out of the box) won't work out of the box... I don't mind that. I've setup Linux (I know it's different) distro's from scratch (not LFS sadly) so I know what it all entails.... I want to learn FreeBSD, and the audio issues are about the only thing stopping me from using it as my daily driver.


----------



## zirias@ (Jan 27, 2022)

Ok so all sound settings look fine (assuming it's indeed the correct device).

Then try this (turn down volume): `cat /dev/random > /dev/dsp`. Do you hear anything?


----------



## Shiggitay (Jan 27, 2022)

Zirias said:


> Ok so all sound settings look fine (assuming it's indeed the correct device).
> 
> Then try this (turn down volume): `cat /dev/random > /dev/dsp`. Do you hear anything?


Nope. Nothing.


----------



## Friend Of Jolly Devil (Jan 27, 2022)

What
`ls /dev/dsp*`
says?
For every /dev/dspX from the command above try cat /dev/random > /dev/dspX
like this:
`cat /dev/random > /dev/dsp7`

If it plays nothing disable the virtual oss, and try the above again.

You can also post '/usr/local/etc/rc.d/virtual_oss' file


----------



## Shiggitay (Jan 27, 2022)

Friend Of Jolly Devil said:


> What
> `ls /dev/dsp*`
> says?
> For every /dev/dspX from the command above try cat /dev/random > /dev/dspX
> ...


shiggitay@VocaloidHavenFreeBSD:~ % ls /dev/dsp*
/dev/dsp    /dev/dsp0.1    /dev/dsp2.0    /dev/dsp5.0    /dev/dsp8.0
/dev/dsp.ctl    /dev/dsp1.0    /dev/dsp3.0    /dev/dsp6.0    /dev/dsp9.0
/dev/dsp0.0    /dev/dsp10.0    /dev/dsp4.0    /dev/dsp7.0

And I just did cat /dev/random > /dev/dsp* on all I could in there and still nothing. I'll disable virtual oss and try again yeah.


----------



## mer (Jan 27, 2022)

I've just verified on a 13-release-p6 system, with chromium 94.0.4606.81 from packages that sound works with a USB headset. Firefox sound also works.
A difference is I am not running KDE or any desktop, rather just a simple windowmanager, so you should be able to get it to work.


----------



## Shiggitay (Jan 27, 2022)

Shiggitay said:


> shiggitay@VocaloidHavenFreeBSD:~ % ls /dev/dsp*
> /dev/dsp    /dev/dsp0.1    /dev/dsp2.0    /dev/dsp5.0    /dev/dsp8.0
> /dev/dsp.ctl    /dev/dsp1.0    /dev/dsp3.0    /dev/dsp6.0    /dev/dsp9.0
> /dev/dsp0.0    /dev/dsp10.0    /dev/dsp4.0    /dev/dsp7.0
> ...


ANNNNDD nothing still.


----------



## kpedersen (Jan 27, 2022)

Shiggitay said:


> I'm aware a vanilla FreeBSD install (i.e. not Dragonfly or GhostBSD that're tailored for desktop out of the box


GhostBSD / NomadBSD will have the same sound issue. All they do is just install FreeBSD with some default packages installed. Nothing that a `pkg install` shouldn't achieve. DragonflyBSD is fairly specialist and not tailored for the desktop (thus I assume you meant NomadBSD instead).

As for your problem, it could be that your hardware is working, it is just "mis-wired" by the driver. This seems a little common on FreeBSD for the snd_hda drivers (which most are these days). Check out:

https://www.freebsd.org/cgi/man.cgi?snd_hda#EXAMPLES

It is a complex procedure and I am only 75% certain of it when I had to do it myself a few years back. Perhaps the best guide I have found is here on the forums:

https://forums.freebsd.org/threads/internal-microphone-setup-question.77091/#post-479069


----------



## Shiggitay (Jan 27, 2022)

kpedersen said:


> GhostBSD / NomadBSD will have the same sound issue. All they do is just install FreeBSD with some default packages installed. Nothing that a `pkg install` shouldn't achieve. DragonflyBSD is fairly specialist and not tailored for the desktop (thus I assume you meant NomadBSD instead).
> 
> As for your problem, it could be that your hardware is working, it is just "mis-wired" by the driver. This seems a little common on FreeBSD for the snd_hda drivers (which most are these days). Check out:
> 
> ...


Would the fact that I'm not running on Intel hardware cause any issues? I'm 100% AMD.


----------



## Friend Of Jolly Devil (Jan 27, 2022)

You have


Shiggitay said:


> /dev/dsp.ctl


I think it should be '/dev/vdsp.ctl', so there's probably some mistake in config, without vdsp.ctl you won't be able to control virtual_oss


----------



## Shiggitay (Jan 27, 2022)

Friend Of Jolly Devil said:


> You have
> 
> I think it should be '/dev/vdsp.ctl', so there's probably some mistake in config, without vdsp.ctl you won't be able to control virtual_oss


I actually just removed virtual_oss... Do I need it?


----------



## Friend Of Jolly Devil (Jan 27, 2022)

It depends 

For now, try catting the random to dsps

Do you have sndio? According to wiki, it may not work well with virtual_oss.

Are you sure your output / cables work as expected? No power issues? 

I have a Realtec ALC sound card and it works as expected, so if yours is not broken it should work too, so check if you don't have any spelling mistakes in configs


----------



## zirias@ (Jan 27, 2022)

I don't see a reason for it...

FreeBSD's OSS implementation already does multiplexing. I mostly use it directly. Some applications don't support OSS, for these you can use sndio, alsa with OSS backend, sdl, openal, whatever is supported


----------



## Shiggitay (Jan 27, 2022)

Friend Of Jolly Devil said:


> It depends
> 
> For now, try catting the random to dsps
> 
> ...


I've done basically everything besides allowing one of you onto my system via SSH and it's getting a bit aggravating that something like audio is being such a pain in my ass... lol


----------



## Friend Of Jolly Devil (Jan 27, 2022)

Do you have snd_hda loaded? What's the output of `kldstat -v | grep snd`?

Don't worry, you can always reinstall FreeBSD 13 without KDE and Chromium and see if it works then


----------



## Shiggitay (Jan 27, 2022)

Friend Of Jolly Devil said:


> Do you have snd_hda loaded? What's the output of `kldstat -v | grep snd`?
> 
> Don't worry, you can always reinstall FreeBSD 13 without KDE and Chromium and see if it works then


shiggitay@VocaloidHavenFreeBSD:~ % kldstat -v | grep snd
        263 hdac/snd_hda
        262 pci/snd_hda
        261 hdaa/snd_hda_pcm
        260 hdacc/snd_hda
        259 pci/snd_via8233
        258 pci/snd_ich
        257 pci/snd_es137x
        256 emu10kx/snd_emu10kx_midi
        255 emu10kx/snd_emu10kx_pcm
        254 pci/snd_emu10kx
        253 csa/snd_csapcm
        252 pci/snd_csa
        251 pci/snd_cmi
37    1 0xffffffff8368a000     e538 snd_uaudio.ko (/boot/kernel/snd_uaudio.ko)


----------



## macbias (Jan 27, 2022)

This is nothing technical, but can you try running cava while playing audio? If it at least shows activity, check your connections, outputs and speakers; sound might be going somewhere. If it's dead, continue troubleshooting drivers etc


----------



## bsduck (Jan 27, 2022)

The KDE Plasma port currently installs PulseAudio by default so it's probably running on your system. To control its volume levels you need to use audio/plasma5-plasma-pa, not KMix (which is for native OSS volume control). If you still can't get any sound, try disabling PulseAudio.


----------



## freebuser (Jan 27, 2022)

TLDR
While playing audio check if you get sound in any of the outputs including HDMI.
I also see you have soundblaster modules loaded not sure why.
I do not use FreeBSD as desktop or for sound this is only a guess.


----------



## malavon (Jan 27, 2022)

Check (system) mixer settings as well, I remember having had 0 volume on several installs due to that.
This is what I have, be sure to check vol, pcm and ogain. Maybe others.

```
> mixer  
Mixer vol      is currently set to  87:87
Mixer pcm      is currently set to 100:100
Mixer speaker  is currently set to 100:100
Mixer line     is currently set to 100:100
Mixer mic      is currently set to 100:100
Mixer mix      is currently set to 100:100
Mixer rec      is currently set to 100:100
Mixer igain    is currently set to   0:0
Mixer ogain    is currently set to 100:100
Recording source: speaker
```
If the problem is related to PulseAudio though I won't be able to help you, I've made sure to compile all my local ports without support or dependency on it. Not that you should have to, plenty of people use packages without issues.


----------



## Friend Of Jolly Devil (Jan 28, 2022)

You have the same drivers loaded as me, so sound should work out of the box.
To gather more info, check pulseaudio like bsduck suggested. If it doesn't help:
Run NomadBSD and check if sound works there:
If it works: 1) Try to reinstall FreeBSD step by step, and check every time if sound works on the dsp* outputs, and write down the outputs of 'cat /dev/sndstat'.
If it doesn't work: 2) Run some other operating system and check if sound works there.

  If 2) works, turn off your computer, unplug it completely from any power source and wait for a few minutes (you can also push power button few times). Next reconnect it, and check if sound on FreeBSD still doesn't work. If it doesn't, follow 1).
  If 2) doesn't work, probably your hardware doesn't work properly, so you should fix it first.


----------



## Shiggitay (Jan 28, 2022)

Friend Of Jolly Devil said:


> You have the same drivers loaded as me, so sound should work out of the box.
> To gather more info, check pulseaudio like bsduck suggested. If it doesn't help:
> Run NomadBSD and check if sound works there:
> If it works: 1) Try to reinstall FreeBSD step by step, and check every time if sound works on the dsp* outputs, and write down the outputs of 'cat /dev/sndstat'.
> ...


It's not that important for me to have FreeBSD working, but as I've said a few times already... my system is fully functional with audio etc on everything except FreeBSD so far... it's strange. I'll revisit it at some point, but for now I'll let it sit.


----------



## RoGeorge (Jan 28, 2022)

Shiggitay said:


> 37 1 0xffffffff8368a000 e538 snd_uaudio.ko (/boot/kernel/snd_uaudio.ko)


I don't have that last line, no idea if that module is required for your hardware.  Also, try disconnecting any other USB headsets, bluetooth headphones, etc. just to be sure the sound is not rerouted to any of those.


----------



## grahamperrin@ (Jan 29, 2022)

Shiggitay said:


> … going to post this on FreeBSD's subreddit as well …



Thanks; New/Fresh FreeBSD Install with no Audio and no Grub entry to chainload from Linux



Shiggitay said:


> … custom AMD Ryzen 9 build … AMD Radeon RX 480 4GB GPU that has documented issues with X and GNOME and other stuff … audio chipset according to lspci is: "[AMD] Starship/Matisse HD Audio Controller". …





Shiggitay said:


> Would the fact that I'm not running on Intel hardware cause any issues? I'm 100% AMD.



I don't know. Anyone?



Shiggitay said:


> I actually just removed virtual_oss... Do I need it?



No. 

I do have a configuration for virtual_oss, but I rarely experiment with it.



mer said:


> … verified on a 13-release-p6 system, with chromium 94.0.4606.81 from packages that sound works with a USB headset. Firefox sound also works. …



Here (Intel): 


```
% pkg info -x chromium firefox
chromium-94.0.4606.81_3
firefox-95.0.2_2,2
% freebsd-version -kru ; uname -aKU
14.0-CURRENT
14.0-CURRENT
14.0-CURRENT
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #1 main-n252531-0ce7909cd0b-dirty: Wed Jan 19 13:29:34 GMT 2022     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG  amd64 1400048 1400048
%
```

Sound to USB is audible. 

Sound from USB was recently inaudible through Chromium, although  this might have been my failure to notice a big red glowing button dangling a few inches below a headset that I had not previously used:









						Chromium audio
					

With Teams, neither the microphone nor the speaker can be changed.  Is this normal?    www/chromium only in this topic, please.




					forums.freebsd.org
				






bsduck said:


> … use audio/plasma5-plasma-pa, not KMix (which is for native OSS volume control).



☑ and plasma5-plasma-pa should be present with a regular installation of kde5, since <https://github.com/freebsd/freebsd-ports/commit/7dc8045a63930a3a520e17723139003867b58c39>.



bsduck said:


> If you still can't get any sound, try disabling PulseAudio.



For reference:



Alexander88207 said:


> … Open /usr/local/etc/pulse/client.conf and uncomment the line with
> 
> 
> 
> ...


----------

