# OSS Sound Quality



## Yelphos (Jan 27, 2019)

The default settings of oss are insane.

These settings are for pure quality without cracking or any other kind of distortion and low-quality annoyance. This is an passthrough, bypassing some features you don't need. This gives you full quality without thinking about it anymore.

sysctl.conf

Change this to:
hw.snd.default_unit=0
hw.snd.compat_linux_mmap=1
dev.pcm.0.bitperfect=1
dev.pcm.0.play.vchanmode=passthrough
dev.pcm.0.play.vchanrate=192000
dev.pcm.0.play.vchanformat=s16le:2.0

---------------------------------------
Additional non necessary settings:
dev.pcm.0.play.vchans=128
hw.snd.maxautovchans=256
hw.snd.verbose=0
hw.snd.report_soft_formats=0
hw.snd.report_soft_matrix=1
hw.snd.vpc_autoreset=0
---------------------------------------
Required for sound-card-kernel-panics, this bypasses them.
dev.hdac.0.polling=1


----------



## shkhln (Jan 28, 2019)

Yelphos said:


> dev.pcm.0.play.vchanrate=192000





Yelphos said:


> 192khz sample rate means very hard stuttering within grim dawn for e.x.


----------



## tedbell (Jan 28, 2019)

Native OSS is why I switched to FreeBSD.


----------



## RichardM (Jan 28, 2019)

I've found OSS excellent out of the box, I guess it depends on your hardware though. I tried some of these settings, but the only one that made a noticeable difference for me was:

```
hw.snd.vpc_0db=100
```
which isn't in your list. This gives a lot more room for attenuation control, and matched my powered speakers well.


----------



## Yelphos (Jan 29, 2019)

I am not convinced from OSS, it produces an nice feeling the way it is made. I also pay attention to psychic aspects when using this. I have not much clue about this because i am new to FreeBSD but this needs to be better with same feeling.

OSS doesn't use any sound-hardware, it does anything via cpu and bypasses all processing that should be within the soundcard. That's an dissapointment, at least you can have high quality sound with some different settings like within this guide.


----------



## shkhln (Jan 29, 2019)

Yelphos said:


> I have not much clue



You still have to explain the contradiction with your previous statement and amend the PR you have filled, which explicitly states you are experiencing stuttering with 192 KHz setting.


----------



## sidetone (Feb 7, 2019)

Yelphos said:


> dev.pcm.0.play.vchanrate=192000


This is good if you're playing FLAC24 or 24bit WAV files. My computer leaves this at its original setting, when I try to change it. Perhaps my soundcard max setting is 16bit PCM, so isn't made for PCM at 24 bit. My old motherboard had it, but it failed a year ago.

I used some settings from above.


----------



## Yelphos (Feb 7, 2019)

This hurts reading something like this, even with low quality sound-files you will notice much difference. The sound-equipment is also not that expensive anymore these days. Especially for gaming and video you need settings like this. I did test such things over many years. This makes a lot of difference. Headphones 100-200€ and soundcard less then 100€. I was glad that i finally found these settings for my soundcard, it sounds like on windows with best settings. I do always use good equipment for quality-sound, i was disappointed by freebsd at the beginning with sound.


----------



## olli@ (Feb 7, 2019)

Audio works perfectly fine for me out of the box, using it for playing mp3 files and watching movies (I don't play games). I did not change any settings except `hw.snd.default_unit` to switch between HDMI, headphone and line-out (connected to a nice 2.1 system by Philips). For volume control I use the standard mixer(8) CLI tool and `xmixer` (Port audio/xmixer) for X11.


----------



## shkhln (Feb 7, 2019)

Please note, OP is a troll, so their statements won't make any sense anytime soon. There is nothing wrong with default OSS settings.


----------



## aragats (Feb 7, 2019)

shkhln said:


> There is nothing wrong with default OSS settings.


I think the point is that they can be better. But that's not true for ALL hardware options. That's why it makes no sense to change the *default* settings.
The OP is good as an improvement recommendation for the corresponding hardware, thus the "insane" word is not appropriate here.


----------



## getopt (Feb 7, 2019)

For those looking for better sound configuration see this from FOSDEM'19


			https://mirror.as35701.net/video.fosdem.org/2019/K.3.401/freebsd_in_audio_studio.mp4
		


There this is advocated for approx. studio quality:
kern.timecounter.alloweddeviation=0 (for realtime sound  which means noticable sound latency <5ms)​hw.usb.uaudio.buffer_ms=2 for usb audio devices​hw.snd.latency=0​dev.pcm.0.bitperfect=1​​


----------



## fernandel (Feb 8, 2019)

If I am using dev.pcm.1.bitperfect=1 than multimedia/mpv works but audio/aqualung doesn't and I get:

```
No output driver specified, probing for a usable driver.
Probing sndio driver... unable to start with default params
Probing OSS driver... unable to start with default params
No usable output driver was found. Please see aqualung --help
and the docs for more info on successfully starting the program.
```


----------



## rsronin (Feb 8, 2019)

I think the defaults are sane. It depends on the situation and hardware you are using.
E.g. on a desktop I use a cheap Asus Xonar U3 USB soundcard(stick) and it accepts the: `dev.pcm.0.bitperfect=1` value without problems.

On my music server I use a dac/preamp wich is capable of 192khz output but I use only FLAC files for my CD's. 

If I set the value `dev.pcm.0.bitperfect=1`, I get a stuttering sound so I am not using it now and still I find the sound quality better than with Pulseaudio or OSS4 in Linux.


----------



## fernandel (Feb 8, 2019)

rsronin said:


> I think the defaults are sane. It depends on the situation and hardware you are using.
> E.g. on a desktop I use a cheap Asus Xonar U3 USB soundcard(stick) and it accepts the: `dev.pcm.0.bitperfect=1` value without problems.
> 
> On my music server I use a dac/preamp wich is capable of 192khz output but I use only FLAC files for my CD's.
> ...


I am using on my desktop computer and as I wrote before multimedia/mpv works without problems but audio/aqualung doesn't. It works with Firefox and listening something online. An I am using x11-wm/openbox.


----------



## rigoletto@ (Feb 8, 2019)

If you set `dev.pcm.0.bitperfect=1` the audio data will be passed directly to the hardware without any sort of processing. If your hardwere is good at that specific playing frequency/bit depth everything will be fine, if not it will sound bad, and if the hardware doesn't support those you will hear nothing.


----------



## rsronin (Feb 8, 2019)

fernandel said:


> I am using on my desktop computer and as I wrote before multimedia/mpv works without problems but audio/aqualung doesn't. It works with Firefox and listening something online. An I am using x11-wm/openbox.



I was triggered by your post but I reacted to the OP. Maybe this can give you a clue. BTW, did you try audio/deadbeef/?


----------



## fernandel (Feb 8, 2019)

rsronin said:


> I was triggered by your post but I reacted to the OP. Maybe this can give you a clue. BTW, did you try audio/deadbeef/?


I will stay with Aqualung which I am using so long that I forgot how long .


----------

