Hi! I'm Trawg

Why not tell us a little bit about yourself? Welcome to the community!

Moderators: MattKingUSA, khz

Post Reply
User avatar
trawglodyte
Established Member
Posts: 16
Joined: Thu Jan 11, 2024 4:32 pm
Has thanked: 11 times
Been thanked: 2 times

Hi! I'm Trawg

Post by trawglodyte »

*** note, I think I should say from the beginning I haven't done any multi-tracking in years and don't anticipate doing much in the future. Latency is not a concern for me. *** I use my Presonus AudioboxUSB to drive AudioEngine 2+ speakers and like having the analog knob within reach to adjust for the varying volume of internet content. Occasionally I use headphones and I have a cheapie dynamic mic hooked up all the time and use OBS Studio to make desktop recordings explaining or asking questions about computer geek stuff. I have Audacity, but it's just a fancy pants voice recorder for me at this point. I did get Ardour and some other apps, and have also taken a look at DaVinci Resolve. I like to keep my options open and enjoy learning how to use different apps, but my main one is definitely OBS Studio and I don't see multi-track recording being important to me anytime soon.

I've done some A/V stuff in the past, been on Linux for a little over a year. Always been confused about ALSA, JACK, pulseaudio, pipewire, pcm formats, snd-modules and so on. I'm starting to figure it out, but I could fill your screen with a million questions. I want guidance, suggestions, criticisms, correction... anything you can offer me to help me move from being confused towards being a Linux audio guru.

I currently have a Presonus AudioboxUSB (not the USB96, the old one) it is 24-bit / 48kHz and works with snd-usb-audio module. It sometimes breaks out into nasty digital noise when I open an app or click a video or something while having it used as in input on something else. I think I may have fixed that by increasing the block size (something I just learned about). Time will tell, but I haven't had that issue since doing that.

This https://linux-hardware.org/?probe=5fb795a75b probably has all the specs of interest for my hardware. You can get a probe of your system and a page like that to reference to if you want. If you don't want to click the link and find the relevant info, here's a few things.

card0 - USB USB-Audio Audiobox USB
card1 - C920 USB-Audio HD Pro Webcam C920

pcm
00-00: USB Audio : USB Audio : playback 1 : capture 1
01-00: USB Audio : USB Audio : capture 1

deb@BRUTUS:~$ cat /proc/asound/devices
1: : sequencer
2: [ 0- 0]: digital audio playback
3: [ 0- 0]: digital audio capture
4: [ 0- 0]: raw midi
5: [ 0] : control
6: [ 1- 0]: digital audio capture
7: [ 1] : control
33: : timer

I did recently go through all the pipewire .conf files and get them moved to /etc and it's working but I have a lot to learn. In general, what I think I want is everything to be 24-bit (preferably S24_3LE, but S24LE if not). I think this because I know I've seen Little Endian on my motherboard stuff so I think I shouldn't use the BE big endian formats. Am I right about that? I have noticed that OBS doesn't support 24-bt and I guess changes it to 32-bit float. If possible I would like to add support for S24_3LE or S24LE to OBS. Unless someone explains to me why that's stupid and pointless and I should stop caring about it.

As much as possible I want everything to be 48 kHz, this may be nitpicky and pointless but I just don't like things being converted back and forth, I want it to be one or the other as much as possible. I think the libopus codec is not doing 44100, only 48000, and that libopus is replacing AAC as the prevailing internet audio codec so that helps me choose 48000. (please correct me and take every statement I make with a large grain of salt) The reason I am posting my current thoughts is TO BE corrected and learn.

Part of the reason I got so interested in making sure things were 24-bit 48kHz is due to that issue with getting nasty digital noise in certain circumstances and thinking it was a unique issue with my card. I thought maybe it was a conflict between 44.1kHz and 48kHz or 96KHz even (which my card won't do). Or a conflict between 24-bit and 32-bit float. While most cards don't have issues with that, I thought there was something unique about mine, particularly when it is inputting and outputting at the same time.

I've just learned about block size, my card maxxes at 2048, and so far it seems as if that block size being too small may be what was causing my issues. So, for example, with the pipewire .conf files and anything I can find for ALSA or any other settings I try to tell it to default to 1024, max 2048, and 512 min. If I understand correctly, many people like to reduce block size to improve latency but I am the opposite. I don't care about latency and think pushing block size towards my cards max is needed to correct my issue.

Okay, so other than that, what should I be learning about? In the past I got rid of JACK because I thought it was less confusing to get rid of one thing. But now it seems like JACK doesn't do anything unless I intentionally start it, and it might be useful as a front end for another app to insure I'm sending what I want? Is that how JACK works?

It seems to me that pulseaudio is sort of a piece of ALSA, or an add-on. That's just my guess, am I close?

pipewire seems like a big f'n deal to me right now. Going through the configs I started to get an idea how it routes audio in a more complex way than ALSA, more options, more complex. Now that it's working I have an additional pcm choice for my microphone. I also have improved sound coming through my speakers.

Any other tips, tricks, hacks I should know about? What resources, other than this forum, are good? I had a very hard time finding the files I could change settings on. I kept finding the ones that just show you current reading that you cannot edit. I am working on a .asoundrc What should I include in that? Do I understand correctly that the .asoundrc is one way I can make ALSA behave how I want it too?

Sorry this was long. I'm glad to find this forum and hope I can start finding the info I need to understand Linux Audio that has been a mystery to me for so long.

Last edited by trawglodyte on Sat Jan 13, 2024 11:18 am, edited 1 time in total.
User avatar
Linuxmusician01
Established Member
Posts: 1547
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland (Europe)
Has thanked: 784 times
Been thanked: 144 times

Re: Hi! I'm Trawg

Post by Linuxmusician01 »

trawglodyte wrote: Sat Jan 13, 2024 12:02 am

[...] Always been confused about ALSA, JACK, pulseaudio, pipewire, pcm formats, snd-modules and so on. I'm starting to figure it out, but I could fill your screen with a million questions.

[...]

Okay, so other than that, what should I be learning about? In the past I got rid of JACK because I thought it was less confusing to get rid of one thing. But now it seems like JACK doesn't do anything unless I intentionally start it, and it might be useful as a front end for another app to insure I'm sending what I want? Is that how JACK works?

It seems to me that pulseaudio is sort of a piece of ALSA, or an add-on. That's just my guess, am I close?

Lemme try to explain this a bit (spoiler alert: it's gonna be confusing). To the more initiated people on this forum: I might be wrong but grosso modo this is what it comes down to.

ALSA is what you would call a "driver" in Windows. It "recognizes" your audio hardware and produces sound. You do not need JackAudio, PipeWire etc. to play music/audio on Linux. Unfortunately ALSA can only output audio from one single application at the time. Nowadays we're used to get sound from our browser playing a YouTube video whilst hearing sounds from the system too (e.g. an error message). Linux needed a solution for that.

Enter PulseAudio (PA). It is a "sound server" on top of ALSA. It enables audio from more than one source at the time. However, musicians etc. weren't too happy with it. Linux needed something more serious.

Enter JackAudio. You can configure it in a more "serious" way. Especially if you record audio in a DAW. A Linux computer used to start w/ PA, not Jack because some internet browsers are hard configured to use PA: they won't produce sound without it (big sigh). So indeed, like you said, you have to start Jack by hand.

To end the difficult PA and Jack situation we recently got PipeWire (PW) in Linux. It is meant to replace PA and Jack. For applications that want to work with Jack it "acts" like Jack (or PA). AFAIK (I might be totally wrong here tho) you can configure a DAW to use Jack (and it may look like you are using Jack) but PW takes over. PW can mimic PA or Jack. To newcomers this confuses stuff even more rather than being the godsend it's supposed to be. My distribution is too old: I don't have PW yet. So I can't help you w/ it.

A "sound module" (is that what you mean by snd-module?) gets "inserted" in the Linux kernel. It's what you would call a driver on Windows. Don't worry about that. If you can hear sound then ALSA inserted to correct module into the kernel.

PCM format. Hmmmm. I wouldn't worry about that too much either in the beginning. AFAIK it's digital audio like on a CD. Remember that a CD is 44.1 kHZ (sample rate) and 16 bit (per sample). That should be good enough for everybody. Some applications and/or hardware like the rounded number of 48 kHz better tho, like you said. But it shouldn't matter AFAIK (others here might give you more tips on this).

trawglodyte wrote: Sat Jan 13, 2024 12:02 am

Pipewire seems like a big f'n deal to me right now. [...]

Yep, it is. :wink: Learn to use it, forget about Jack and PA if possible.

trawglodyte wrote: Sat Jan 13, 2024 12:02 am

Any other tips, tricks, hacks I should know about? What resources, other than this forum, are good? I had a very hard time finding the files I could change settings on. I kept finding the ones that just show you current reading that you cannot edit. I am working on a .asoundrc What should I include in that? Do I understand correctly that the .asoundrc is one way I can make ALSA behave how I want it too?

Other resources? General Linux forums. Therefore I always recommend newcomers to install your average basic distro like Ubuntu, Debian, etc. Not a "special" audio Linux distro. Because there are many forums and many Linuxers that use, for instance, Ubuntu. The Ubuntu forums are quite good.

Don't worry about all those text files to configure your system. The file .asoundrec should be fine as it is.

Try to get some tips here on a good PipeWire config utility (AFAIK there's olnly one you need, the rest is surplus). Tell us which distro you use. Unfortunately PW is still in stormy, active, development and some distro's that come with it already use old utilities etc. That's why I personally will not upgrade my distro yet. What I learn today 'bout PW I might have to unlearn tomorrow.

Good luck and have fun making audio & video on Linux! :)

User avatar
trawglodyte
Established Member
Posts: 16
Joined: Thu Jan 11, 2024 4:32 pm
Has thanked: 11 times
Been thanked: 2 times

Re: Hi! I'm Trawg

Post by trawglodyte »

Linuxmusician01 wrote: Sat Jan 13, 2024 10:54 am

PCM format. Hmmmm. I wouldn't worry about that too much either in the beginning. AFAIK it's digital audio like on a CD. Remember that a CD is 44.1 kHZ (sample rate) and 16 bit (per sample). That should be good enough for everybody. Some applications and/or hardware like the rounded number of 48 kHz better tho, like you said. But it shouldn't matter AFAIK (others here might give you more tips on this).

I gotta tell ya that I can hear the difference between 16-bit and 24-bit. Maybe my ears are more sensative than most, IDK.

I experimented with it over a decade ago and found out. Just confirmed it recently when I tried plugging a USB cable directly into my AudioEngine 2+ speakers, rather than using the AudioboxUSB to drive them. I heard a difference right away, and sure enough the technology that supports the USB input in these speakers is 16-bit!

I don't think I can hear a difference between 44.1, 48, or even 96 or 192 kHz. The reasons I want it to be 48 kHz would not matter to most people and if your 44.1 kHz recording get converted to 48 kHz by modern codecs, the difference between that and them starting out as 48 kHz is probably indiscernable.

Also, I just booted into Debian 12 and no audio when I tried to play a YouTube video!! lol, so while I may have opinions and consider myself well-informed on 16-bit vs 24-bit vs 32-bit float and 44100 vs 48000, I still don't know Jack about Jack,pulseaudio,pipewire,and ALSA.

Thank you for the general description of how they came about and the purpose of each.

If I understand correctly, now that I have pipewire working I should look to solve my problems with pipewire and don't tinker with ALSA much?

You know, come to think of it I stored the .asoundrc I was working on in my home folder. It's a work-in-progress, I wonder if that's why my audio failed? I should probably rename it until I think it's ready.

User avatar
trawglodyte
Established Member
Posts: 16
Joined: Thu Jan 11, 2024 4:32 pm
Has thanked: 11 times
Been thanked: 2 times

Re: Hi! I'm Trawg

Post by trawglodyte »

FWIW - I renamed ~/.asoundrc ~/WIP.asoundrc.WIP, rebooted and my audio is back!!

User avatar
sunrat
Established Member
Posts: 925
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 152 times
Been thanked: 247 times

Re: Hi! I'm Trawg

Post by sunrat »

trawglodyte wrote: Sat Jan 13, 2024 11:47 am

I experimented with it over a decade ago and found out. Just confirmed it recently when I tried plugging a USB cable directly into my AudioEngine 2+ speakers, rather than using the AudioboxUSB to drive them. I heard a difference right away, and sure enough the technology that supports the USB input in these speakers is 16-bit!

That would be comparing different interfaces more than the difference between 16 and 24 bit. The USB DA converters on your Audioengine would likely be much lower quality than the Audiobox.
I have an Audio Technica LP5 turntable which is a perfect example of this. It has line outputs and USB out; the line outs plugged in to my M-Audio card sound profoundly better than the USB out.
Convert an audio file to both 16 and 24 bit then play both them through your Audiobox. I think I perceive a slight difference when doing this but enjoy listening to CD quality 16 bit files anyway. It's certainly not chalk and cheese.

User avatar
Linuxmusician01
Established Member
Posts: 1547
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland (Europe)
Has thanked: 784 times
Been thanked: 144 times

Re: Hi! I'm Trawg

Post by Linuxmusician01 »

trawglodyte wrote: Sat Jan 13, 2024 11:47 am

I gotta tell ya that I can hear the difference between 16-bit and 24-bit. Maybe my ears are more sensative than most, IDK.
[...]

Not that I don't believe you. But back in the days of the CD vs. LP "discussions" they did blind tests and nobody could hear the difference. If you sample something at 16 bit then the amount of possible "steps" in volume are 216 = 65536 "tick marks" on the volume knob (instead of the usual 10) of an amplifier. I highly doubt that anybody can hear the difference between a volume of 65535 and 65536.

The physics of sampling an audio wave are very simple. You can hear the audio quality degrading if one decreases the sample frequency or the number of bits per sample. Philips wanted the CD to be 14 bit, so in my naivety I think that 16 bit must be more than enough.

Remember that PCM is sampling the audio volume 44100 times per second at a "precision" of the audio volume between 0 and 65536 (the precision then is 100%/65536 = 0.0015%). That is: max. volume (100%) is 65536 and min. volume (0%) is 0. A higher precision in volume is probably overkill (that is, I think the physicists at Sony and Philips thought about that very well and must have talked to experts like medical doctors).

Maybe some hardware and/or software might work better/less erroneous with other/exotic bit-rates, I don't know. But I'll bet you a million dollars that people will have a very hard time hearing the difference between 16 bit or more, if even possible.

Moreover, this only goes for uncompressed audio (WAV, FLAC, a CD, etc). Once you compress audio (OGG Vorbis, MP3, etc.) then the subtleties get "thrown away" for compression. Compression is "lossy".

User avatar
trawglodyte
Established Member
Posts: 16
Joined: Thu Jan 11, 2024 4:32 pm
Has thanked: 11 times
Been thanked: 2 times

Re: Hi! I'm Trawg

Post by trawglodyte »

Concerning 16-bit vs 24-bit your explanations makes sense. I probably was other differences between the devices. I love my AudioEngine 2+ speakers, but driving them with the USB input is very blah. Like, it's nice they added that as a convenience but the rca inputs are the way to go.

Also the explanation concerning whether 24-bit is perceptibly better than 16-bit by human ears also makes sense. In hindsight it was probably just the software I was using at the time which produced audibly better recordings with the 24-bit setting than 16-bit (for some other reason). Maybe it used a crappy encoder on the 16-bit setting or something?

Maybe a higher concern is if the audio format you choose requires resampling? On Debian 12 here the default rate converter was "samplerate". Other options include samplerate_medium samplerate_best lavrate lavrate_high lavrate_higher speexrate speexrate_medium speexrate_best. Most of which are better than the default "samplerate".

I don't know why it's so hard to find information on something so fundamental to our computer audio. Making a text file that says "defaults.pcm.rate_converter "speexrate_best"" and saving it as ~/.asoundrc is all you have to do to set your system default.

I also don't know how speexrate_best compares to lavrate_high or lavrate_higher. Am I doing something wrong? Why do I have such a hard time finding this information?

Last edited by trawglodyte on Sat Jan 13, 2024 3:27 pm, edited 3 times in total.
User avatar
Impostor
Established Member
Posts: 1392
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 148 times
Been thanked: 366 times

Re: Hi! I'm Trawg

Post by Impostor »

sunrat wrote: Sat Jan 13, 2024 1:26 pm

Convert an audio file to both 16 and 24 bit then play both them through your Audiobox.

Even then...the results would be dependent on the bit depth of the source material, not? If the source is 16 bit, you wouldn't increase the dynamic range of the recording if you convert this to 24 bit audio (but maybe you could lower the noise floor by some additional processing though). Conversely, I think it would be hard to find a musical recording in the wild which is recorded at 24 bits, and actually uses more than 96dB of dynamic range, which you'll lose when converting to 16 bit. And then there's the question of auditory sensitivity: you can probably only discern, if at all, such a large dynamic range between quietest and loudest parts. Definitely not simultaneously with loud and quiet instruments playing together.

User avatar
trawglodyte
Established Member
Posts: 16
Joined: Thu Jan 11, 2024 4:32 pm
Has thanked: 11 times
Been thanked: 2 times

Re: Hi! I'm Trawg

Post by trawglodyte »

sunrat wrote: Sat Jan 13, 2024 1:26 pm

Convert an audio file to both 16 and 24 bit then play both them through your Audiobox.

I think you're getting to the root of it now. If I make a 24-bit recording it doesn't have to be converted to be 24-bit, it already is. And if my system uses a so-so rate_converter like "samplerate" there's a good chance the converted 16-bit will be audibly worse. But if my system uses speexrate_best or lavrate_higher maybe I can't hear the difference??

But the same might be said if you make a nice 16-bit recording and it gets converted to 24-bit with a so-so converter. The 24-bit output might be worse sounding than the 16-bit input.

Maybe it comes down to whatever format you think the software people are going to use or a website you upload to uses. If you think they use 16-bit, then you hand them a 16-bit recording and don't risk it being converted badly?

I dunno, we're talking about relatively minor loss in quality even with a bad converter, but it's fun to nit-pick and adapt best practices. When my computer gives me options I like to try to pick the best one even if it's only slightly better. Over time all these tiny tweaks add up.

User avatar
sunrat
Established Member
Posts: 925
Joined: Wed Jul 22, 2020 2:08 pm
Has thanked: 152 times
Been thanked: 247 times

Re: Hi! I'm Trawg

Post by sunrat »

Here's some links to peruse:
SRC Comparisons - You can select SRCs to compare. I use soxr-vhq in PulseAudio (I'm not totally in with Pipewire yet). It shows less artifacts than speex (Xiph.org Speex) in this test. Pipewire's default SRC is also selectable to compare.

https://wiki.archlinux.org/title/PipeWire - possibly the best PW guide atm.

And LinuxAudio wiki has some great configuration tips. It can make a lot of difference to suitably optimise your system.
There are a lot of topics about config optimisation here on the forum too.

User avatar
Linuxmusician01
Established Member
Posts: 1547
Joined: Mon Feb 23, 2015 2:38 pm
Location: Holland (Europe)
Has thanked: 784 times
Been thanked: 144 times

Re: Hi! I'm Trawg

Post by Linuxmusician01 »

sunrat wrote: Sat Jan 13, 2024 10:55 pm

Here's some links to peruse:
SRC Comparisons - You can select SRCs to compare. I use soxr-vhq in PulseAudio (I'm not totally in with Pipewire yet). It shows less artifacts than speex (Xiph.org Speex) in this test. Pipewire's default SRC is also selectable to compare.

https://wiki.archlinux.org/title/PipeWire - possibly the best PW guide atm.

And LinuxAudio wiki has some great configuration tips. It can make a lot of difference to suitably optimise your system.
There are a lot of topics about config optimisation here on the forum too.

Thanks for the links. Is there a Pipewire mixer like pavucontrol and alsamixer?

Post Reply