There's a bunch of config files in folders /usr/share/alsa /etc/alsa/conf.d /usr/share/pipewire (this folder must be copied to /etc if it's not there already for best use of pipewire according to documentation), so also /etc/pipewire after you copy it there. And /usr/share/wireplumber. (you do not copy the wireplumber folder to /etc). If anyone knows other A/V config folders I should look through, please tell me.
I think this is important, your apps CAN over-ride defaults, but handing them the proper ones to begin with can only improve how they handle your audio. It will also prevent a lot of conversions from one format, rate, etc... to another. I don't care how good the tech is for converting, best quality is still no conversion needed. In other words, no program can take 16-bit audio change it into 24-bit or 32-bit float and make it better, nor can it take 24-bit and convert it to 16-bit and make it better. Same for changing it from 48000 to 44100 or 96000. There's always going to be something lost in the conversion IMO.
First I was going through every config file in all these folders, looking up every spec and trying to figure out what was optimal for my system. If you do it this way, make a backup first.
Now, I'm under the impression that both ALSA and pipewire will accept any specs I put in /etc/asound.conf (or ~/.asoundrc), and anything I spec there will over-ride system defaults. Is this correct?
What I can't find ANYWHERE is a list of ALL the specs I can put in /etc/asound.conf with clear explanation of what each does, so this is cobbled together with info I had to search distant crevices of the interwebs to find. This is what I have so far...
Code: Select all
## Linux usually defaults to "samplerate" but there are better converters
## put one of the following - samplerate samplerate_medium samplerate_best lavcrate
## lavcrate_high lavcrate_higher speexrate speexrate_medium speexrate_best
## in between " " below to choose rate converter.
## save file as /etc/asound.conf or copy/paste to existing
## /etc/asound.conf if you have that file already.
defaults.pcm.rate_converter = "lavcrate_higher"
## resample quality - Linux defaults to 4, this will be used by some apps to pick from the above mentioned converters.
resample.quality = 10
## audio channels, I only do stereo and don't want anything attempting surround
## if I can help it. So I put 2 channels.
audio.channels = 2
## below sets low and high frequency cutoff. Linux usually defaults to 150/15000
## uncomment "channelmix.lfe-cutoff" to extend low frequencies (more bass if your speakers are capable)
channelmix.lfe-cutoff = 60
## uncomment "channelmix.fc-cutoff" to extend high frequencies (you may notice a bit more "sparkle" on your audio)
channelmix.fc-cutoff = 22000
## audio rate, 44100 and 48000 are both good, but codec libopus always converts to 48000.
## IMO, libopus will replace AAC as predominent internet audio codec, so may as well do 48000
## In other words, if anything I produce is going to be converted to 48000 anyway, I might as well
## make it 48000 to begin with instead of hoping the converter various apps and servers use
## aren't sub-par, and knowing even the best ones can't do a perfect conversion.
audio.rate = 48000
## Set other allowed rates if you want. I don't for reasons specific to my audio card.
## But you could put something like "44100,32000,96000,192000" any one or combination.
# audio.allowed-rates = [ 44100 96000 ] # not sure about the formatting with brackets.
## very important setting depending on your hardware. Options include ALAW F32BE F32LE F64BE F64LE
## MULAW S16BE S16LE S24BE S24LE S32BE S32LE S8 U16BE U16LE U24BE U24LE U32BE U32LE U8
## a different format U8 S16_LE S16_BE S24_LE S24_BE S32_LE S32_BE FLOAT_LE FLOAT_BE MU_LAW A_LAW S24_3LE S24_3BE
## to be clear, these optionss are not "better" or "worse", you just want to match your hardware.
## Important for my card, newer cards probably adapt to different formats easier.
audio.format = S24_3LE
pulse.default.format = S24
## video stuff - Linux defaults to 640x480 25fps
default.video.width = 1920
default.video.height = 1080
default.video.rate.num = 30
## I don't know what this next one is yet.
#default.video.rate.denom = 1
## The following are commented out, because I need to learn more.
## What you see right now is current defaults on my machine.
#default.clock.rate = 48000
#default.clock.allowed-rates = [ 48000 ] # I'm unsure of the bracket formatting. It seems to me as if formatting changes whether it's ALSA, pipewire, LUA, etc... and not sure what format is right for this file.
#default.clock.quantum = 1024
#default.clock.min-quantum = 16
#default.clock.max-quantum = 2048
#default.clock.quantum-limit = 8192
You can see I am trying to add useful notes as I go, so that in the end someone can paste this into their own /etc/asound.conf and use as a template. But it's a WIP, so do that at your own risk and comment out anything you aren't sure of, many fo these are specific to my setup and are not optimal for yours.
Please tell me if anyone knows what other important things do I need to add here so this template can be useful to others (and help me get my defaults optimized)?? I should also say that I do not multi-track much these days and am not that concerned with latency but I will try to add the relevant settings for that. If someone knows them well and can give me something to paste in, that would be great because it's outside of my wheelhouse.