/tech/ - Technology

Technology & Computing

New Reply
Files Max 5 files32MB total
[New Reply]

linux_audio.png (u)
[Hide] (276.1KB, 1404x913)
What's the simplest way to work with Linux sound? If I install Gentoo or something, presuming I have X and a WM up and running but no sound, what's the simplest way to get desktop-quality audio?
General audio software thread as well I guess, since we need something more than this to discuss. Discuss ways of improving the Linux audio mess.
Replies: >>121
ClipboardImage.png (u)
[Hide] (87.3KB, 1368x575)
>>91 (OP) 
>What's the simplest way to work with Linux sound?
In practice? Just stick with ALSA plus JACK for DAWs and other audio work and run anything that requires PulseAudio through apulse. PulseAudio just adds another layer of mess above ALSA, aka more stuff that can break, and I've had more problems with it than ALSA on its own.
Your main alternatives are OSS4 and sndio. I have no idea if anyone uses OSS4 but it sounds cool even with the poor hardware and software support nowadays, while sndio is mostly used by OpenBSD users and Voidfags. There's also whatever the fuck PipeWire is, which is trying to replace PulseAudio, JACK, and some video stuff. I know jack shit about it, but it's by a Red Hat employee so there's a good chance it will be cancer.
>Discuss ways of improving the Linux audio mess
Maybe some OSS4 fags can chime in, but it sounds promising to me.
Replies: >>198
>>91 (OP) 
>If I install Gentoo 
On Gentoo you can just enable the alsa USE flag in your /etc/portage/make.conf and enable the relevant options for ALSA and the HD audio in Linux kernel config (i.e. after you run make menuconfig) The tl;dr for PukeAudio is that you enable the kernel options that the ALSA/PukeAudio gentoo wiki articles tell you to enable and just enable the pulseaudio USE flag globally in your /etc/portage/make.conf 


If anyone uses mpd + alsa, make sure to resample to 32bit with libsamplerate. Audible difference.
Since this thread exists, I'll repost >>>/v/23570

Save this to ~/.asoundrc
possible language: rust, relevance: 10
pcm.!default {
        type asym

        playback.pcm "plug:Output"
        capture.pcm "plug:Input"

pcm.Output {
        type dmix

        ipc_key 1024
        ipc_perm 0666
        slave {
                pcm "hw:FIXME,0"

                rate 48000
                periods 128
                period_time 0
                period_size 2048
                buffer_size 32768

pcm.Input {
        type dsnoop

        ipc_key 1025
        ipc_perm 0666
        slave {
                pcm "hw:FIXME,0"

                rate 48000
                periods 128
                period_time 0
                period_size 2048
                buffer_size 32768
}Replace FIXME with your audio device number. You can find out what it is by doing aplay -l if you don't have PulseAudio installed or running.
>>91 (OP) 
Whatever you do, audio is shit on Linux. If you have one of these generic on board sound chips it probaby won't be much of a problem, not matter which route you go. But try using some expensive firewire audio interface and you'll have to fight dropouts and shit.
Most consumer sound cards have mixing functionality already included so you could theoretically use bare alsa. However if you have a soundchip that can't mix you could only ever have one application at a time play audio unless you install something like pulseaudio that brings its own software mixing.
Never had any luck with Jack. It does achieve lower latencies but I never could get it to run without timing issues/jitter/dropouts. I'd rather use windows for that stuff, I can't imagine it being very fun running six gorillion VST plugins through wine.
Schismtracker and Renoise work fine though and of course limitations can sometimes lead to creativity.
Replies: >>408
>However if you have a soundchip that can't mix
>What is dmix (literally post above)
>NOTE: For ALSA 1.0.9rc2 and higher you don't need to setup dmix for analogue output. Dmix is enabled by default for soundcards which don't support hardware mixing. You still need to set it up for digital outputs.
You don't know what you are talking about, go back.
boomer_wii_punch.png (u)
[Hide] (139.2KB, 1561x753)
>>91 (OP) 
>alsa + pulseaudio but run both of them through JACK
>you could use apulse to get rid of pulseaudio but for whatever reason in practice, it doesn't work as cleanly
>for an alsa + JACK only build, slam this into your .asoundrc
pcm.rawjack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    capture_ports {
        0 system:capture_1
        1 system:capture_2
pcm.jack {
    type plug
    slave { pcm "rawjack" }
    hint {
        description "JACK Audio Connection Kit"
pcm.!default {
    type plug
    slave { pcm "rawjack" }
i don't do any music stuff but it does make recording certain sources much easier with JACK
1455236569213.jpg (u)
[Hide] (101.6KB, 775x1523)
Redpill me on PipeWire. Do any of you fags use it? Is it any good? I'm likely reinstalling Void Linux soon and sadly sndio isn't an option because not everything I use supports it.
Replies: >>1950 >>1966
Have you searched "<program you use> pipewire"?
>sndio not supported
>let me quickly ask about something also as obscure
Really nigger?
Replies: >>1952
PipeWire isn't exactly "obscure" now: it's supposedly big with Archfags who are sick of PulseAudio, and Fedora's using it by default with Ubuntu close behind. It also has a better ALSA plugin than sndio's (which only supports playback) and can spin up a pulseaudio server if you really need one for whatever reason.
Chances are, I'll probably go with ALSA +apulse again, since I'm not using Wayland (thanks Nvidia) and PipeWire makes screen recording on Wayland much easier. Mostly just wanted to hear if anyone here has tried it yet and how it worked for them.
Replies: >>1957
What's wrong with plain ALSA? ALSA is the bottom of Linux audio stack, sndio on Linux is implemented on top of it. If it is about sharing audio device, dmix is enough for most use cases.
One case ALSA fails to cover is switching device during playback. It is possible to rig some acpid scripts together to get this feature, but restart the program just work.
Replies: >>1966
>Void Linux
Just use pulseaudio, it's been surprisingly very smooth in my experience and the experiences of other void users too. Pure alsa works fine too but don't count on apulse too much.

>What's wrong with plain ALSA?
Nothing, but it doesn't have separate volume controls for every application which can be impractical. This is why I chose to stick with pulseaudio even though the original reason I got it was because the dumpster fire known as wine won't output audio without it
Replies: >>1967
Separate volume controls is typically implemented by each individual application. What program do you use doesn't have that?
Replies: >>1973
>What program do you use doesn't have that?
Games & emulators mainly, the vast majority of them don't have proper audio controls of their own.
The only problem with pulse usually is that its defaults are bad quality (default resampling method is poor quality, while it defaults to 44.1kHz which is outdated, since a lot use 48kHz now), all while pulseaudio could not properly support some bluetooth setup that got all its hate which I don't even care about ever using.

Albeit bad defaults, pulse can actually be have transparent quality and support native playback of high fidelity audio without the need to resample (avoid-resampling) which is great for the CPU.

Is there any way to force pipewire to adapt to the native samplerate playback just like pulseaudio's avoid-resampling?

I don't want to be using a music editor at 96kHz natively and have it be downsampled back to 48kHz again, the problem is not about "audiophile bullshit" but about the wasted CPU and latency caused by unnecessary downsampling which I don't even need, I'm not using a portabledevice/laptop/bluetooth that benefits with downsampling.

Pipewire has great defaults which resamples to and have native 48kHz which most consumer video and audio formats already have. Although the default was better than pulseaudio's defaults, It's just worse if it's gonna be stuck on 48kHz only or two samplerates.
I want to know if there's a way to avoid resampling since the docs weren't clear enough.

I don't like how it's already a Plasma dependency either but that's Red Hat for you, your distro is just a RHEL cushion.
Replies: >>2019
>Albeit bad defaults, pulse can actually be have
*actually have
Also, adding to this, I don't see the point of resampling to 48kHz strictly which pipewire does. Would be a waste if you had good audio card, I don't even know which library or resampling method/algorithm it uses.
>read all posts in audio thread
>make pulse do some retarded shit soo it uses more CPU
>it makes no impact because my headphone is trash
It is so hard being poor.
Replies: >>2150 >>2230
Good headphones aren't expensive. Just do some research.
Replies: >>2230
Good earphones aren't expensive.
pipewire_resampler_locked.png (u)
[Hide] (310.7KB, 1058x718)
Honestly, I think pipewire is such a downgrade.
Here's the benefits though:
>glownig bluetooth now works properly
>proprietary bluetooth stuff like qcomm aptX now just werks
>all bluetoothfags now stopped crying about linux audio
>all microphonefags now stopped crying about linux audio
>you can now "OBS" (some twitch/youtuber software) better on your linux
I'm neither of these >people.
At least though, jack now has better support but damn, pulseaudio + alsa had so much better control and bitperfect that it's the most "audiophile" setup out there.
At this point even a blu-ray player is much more bit-perfect than a linux computer with pipewire.

Even at Quality10 the resampler is pretty shit and there's not yet any way to change it (unless there is but it's undocumented) and I can't be bothered learning its code.
As you can see on the image, this is a sweep of frequency ~0Hz up to 48kHz and noise artifacts can be seen after downsampling from 96kHz to 44.1kHz on Pipewire resampler, on the other hand pulse has sox/ffmpeg which has no digital aliasing of any kind, I can only imagine upsampling to 48kHz (or pipewire default)  has worse artifacting and that's even with Quality4 (pipewire default) which is much much worse. Worse defaults so bluetooth werks and underpowered laptops don't lose so much battery (or processing power because it has a shitty card).

Might as well throw away your USB DAC because you can't have bitperfect playback on linux anymore because they always like to quote "nyquist" bullshit and tells you that you can't hear the difference when difference is like day and night (warm gear playing back 96kHz sounds neutral, ultrasound distortion improves the timbre and I've yet to break any transducer and if they do they deserve it)
If any, playing back at 22.05kHz or 8kHz sample rate (~0Hz up to 4kHz) causes MORE significant popping distortion or even the shitty default resample like pic related causes unnecessary harmonics you can see with a spectogram even when there's no signal after (actually it's 20kHz~48kHz signal but since the resampler sucks so much it has some kind of digital aliasing when it's supposed to be nonexistent after 5 second mark x-axis).
Replies: >>2244 >>2247 >>3278
mpd + libsamplerate + alsa raw hw imo better than pulseshit and definitely beat niggerwire.
Bluetooth is such a gaping security hole that only niggers use it.
OBS is an open source screen capture and streaming software though.
People always talk about how much of a piece of shit audio on Linux is, but did you try OSS on a BSD? I don't have any audio equipment at all because of poverty and my headphones are so shitty that nothing even matters, and I never really had anything good anyway, but eventually I want to be able to care, so it's worth asking because I do want to get more into audio, though  considering how much worse everything is getting, it may never happen.

For me, audio on FreeBSD just works, but again, my headphones were like, 15 dollars, and I only bought them because the previous piece of shit broke and I wanted one fast, and it was the only one that I could find in this shithole. They sound worse and are more uncomfortable than the piece of shit that I bought for 2 dollars one time (with free shipping, I don't even know how that was even possible). The wire is broken too, so one of the sides doesn't work, so I'm hanging it over my ear because it makes it work consistently as long as it stays still and that will be enough until the one that I ordered (that has a detachable wire) shows up. Fuck my life.
Replies: >>2249
40mm-speaker-HIFI-Speaker-driver-ED9-style-Titanium-film-unit.jpg.webp (u)
[Hide] (36.9KB, 618x520)
As far as I know, OSS should be better than ALSA when it comes to resampling and mixing multiple audio sources (which alsa fails to do by default) although both are almost equal.

Maybe OSS would win when combined with a dedicated USB DAC since a linux distro now defaults to pipewire and quite possibly touched by pipewire before it goes into your DAC (in which case OSS is probably better, I'm thinking of switching to BSD, tbh).

As for the audio equipment, price really doesn't matter. There will be things like the BLON or QKZ VK4 that costs $6-$20 which measure similar, on-par, or better than $1000 in ear earphones but then there will even be <$4 ones that would easily beat them all (which I use as my daily driver).

With headphones, you might as well build them yourself with a $4 dynamic driver like pic related (the keyword is "40mm driver") since the off-brands and even known brands are just using the same exact thing coming from china and taiwan anyway. I've seen old or even new Sony headsets that are actually just a replica or rebrand of some not-so famous taiwan OEM which is 10-100x cheaper and sounds great too (same earcups, same mold, same box too!), easily beats koss porta pros or even beyerdynamic (you can always try them from a tech store).

>I don't even know how that was even possible
It's possible since they just jam it all into cargo planes that are always full, shipping used to be expensive back when people rarely use online shops 10 years ago.
Replies: >>2250 >>2348
OSS's default sampler is better than ALSA, but it can be changed https://wiki.archlinux.org/title/Talk:Advanced_Linux_Sound_Architecture#On_high_quality_resampling (Link shits on libsamplerate, but I can hear the difference and have cycles to spare). Software mixing is enabled by default in ALSA a few years ago.
You can always try cheap chinkshit, especially "diy" models, they are usually just refab meme expensive models. Static power noise can be disturbing for usb dac, you can make a usb wire with separated power supply and/or use those low-pass caps to filter the power (just get the cheap stuff on ebay or somewhere)
Replies: >>2259 >>4159
947bd9f93282f8460940cfd4ed61dc76ce429b515eac17e3b11481ae78984c54.png (u)
[Hide] (14.6KB, 568x568)
>>91 (OP) 
>another manjaro update
>my sound is broken once again
I know manjaro probably a shit but I didn't even change anything to do with sound from default so what the fuck? I ended up having to open alsamixer all the time and manually changing the sound levels since the last fuck up and haven't gotten around to figuring out how to fix it because I'm still a linux noob. Now I have to unplug and re-plug my headphones for sound to start working properly for some reason.
Manjaro is a pile of fucking dogshit stop using it before it randomly decides against your will to auto update and wipes your entire system with it.
Replies: >>2253
Nervous_Monkey.jpg (u)
[Hide] (174.9KB, 960x960)
Now that I think about it, I remember now that I'm using the i3 version which is also a "community" version. I guess that could be translated to "shit might break and it's not our fault because we aren't the ones maintaining it".
Should...should I be seriously worried about something like that happening? I'm pretty sure I don't have auto updates on if that's a thing.
Replies: >>2260
rc.png (u)
[Hide] (4.7KB, 640x480)
You can use amixer to set levels from a script.  I set volume to 77% every time my computer boots up.  This is my /etc/rc init script that gets called from /etc/inittab (I use busybox as /sbin/init), so you'll have to adapt for your init, or maybe just call amixer from your shell's ~/.profile or whatever.
Chances are your arch-based distro upgraded to pipewire. On my case, it just breaks so I had to reuse my cached packages, and use dummy pipewire (since KDE now has hard dependency on pipewire).
>Now I have to unplug and re-plug my headphones for sound to start working properly for some reason.
Maybe you should delete your user's alsa/pulseaudio settings (on /home/user/), had the same problem when I downgraded back to pulse.
> Static power noise can be disturbing for usb dac, you can make a usb wire with separated power supply and/or use those low-pass caps to filter the power (just get the cheap stuff on ebay or somewhere)
Sounds like a terrible dac or a bad source.
There was a recent review on 40 USB DACs online but the guy retracted their review. They mentioned some useful information about some DACs exhibiting noise floor (static noise?) and some that aren't. It's still cached somewhere though (like google cache).
Also, another problem could be improper grounding of equipment resulting to power noise which affects the quality of data, like when flashing with a usb to chip flasher, it's recommended to use a usb M to F noise filter which should help the dac too although usb filters are pretty hard to find.
rage.gif (u)
[Hide] (655.4KB, 225x234)
>Should...should I be seriously worried about something like that happening? I'm pretty sure I don't have auto updates on if that's a thing.
It happened to me suddenly and randomly last year, and I turned auto updates off. 

It auto force launched some mother fucking retarded applet that you can't see that updates in the backround, never even seen before, i saw it pop up and say "autoupdate complete" just before a shut down and bam next reboot it couldn't even find mountfs for encryption scheme, Everything was broken, grub was broken too. Manjaro is the windows 10 of linux, actually it's worse, bill 'lolita express' gates doesn't take your entire system with it like that with no recourse. I back up frequently too but there was still some important shit I lost on that retarded niggerOS. I found out why on forums, shit tons of people had their systems broken, because apparently the fucking dumb nigger peabrain developers intentionally sabotaged people by somehow turning it on for them and fucked a load of systems up.
Replies: >>2261 >>2269
Try instead Slackware, Gentoo, Devuan, Alpine.  All the others are a waste of time, if you know your way around Linux.
Replies: >>2262 >>2545
linuxmint is probably a better recommendation seeing how clueless this guy is
Replies: >>2268
Mint makes me feel nostalgic
Its the windows xp of linux, those simpler times, I miss then, when "wifi not working" was your only worry
Replies: >>2275
just use artix or arch. it's pretty easy to install, literally google: "encrypted arch linux install 2021 blog" or maybe use ddg instead since the search engine prioritizes linux stuff.
I like mint because its openly anti-israel 
fuck israel
Hardware support could be an issue, but I guess I should just buy whatever works on both FreeBSD and OpenBSD anyway because hardware that only works on corporate OSs (now including Linux) is a prison anyway. I don't have a DAC, but I want to get one eventually. Also, building headphones definitely appeals to me. I like building my own peripherals when I can. It's just nice to use something that I built myself, and I can do a better job than any big corporation with the right tools (I really want to get more tools, to build more stuff, but I don't have the space). Very satisfying. For now I have the headphones that I bought, though. They are gigantic, and very comfortable. I only like big headphones, even on-ears are too painful for me. Definitely wouldn't use earphones.
Replies: >>2349
>do a better job than any big corporation
Reminds me about those rage-inducing thinass headphone wires, solder doesn't stick and had to burn off the coating. Still shit at soldering though. One reason big corporation is shit is monopolies always use the cheapest, non-repairable stuff.
>FreeBSD, the original tranny drama cuck bsd
Avoid at all cost.
Replies: >>2350
Yes, cheap headphones are built like crap. I opened a lot of headphones, and every time I am shocked by what I see. No matter how bad at soldering you are, you are still better than the Chinese, that's for sure. It may just be that you have a shit iron, though. I have a nice soldering station, so it's easier. Still, dettachable wires are mandatory for me. Only made an exception last time because I was in a hurry and got the only one that the store had, and it was horrendous but I used it for half a year until the wire broke for no reason.

>FreeBSD, the original tranny drama cuck bsd
>Avoid at all cost
I used to say the same thing, but I look at Linux now and I think it's even worse, and even back then, Debian and the Linux Foundation were at least as bad when it comes to that. Linus himself is a nigger and a piece of shit commie. At least FreeBSD isn't controlled by the entire corporate world like Linux is. Still, I don't dismiss that concern. I want to use OpenBSD later on (because of that and because it's the best), but for now I need my main computer to have ZFS because I don't have the hardware for a file server at the moment. 

I don't judge FreeBSD too much, though. The users are probably still overall better, and their team containing and tolerating some commie tranny faggots is still better than the abomination that is Google, Microsoft, Red Hat, IBM, the Linux Foundation, cuck king Linus Torvalds and other corporations, all joining forces to bring communism to our computers. And that's ignoring the fact that pretty much all big distributions have teams that are full of commies and trannies too. Linux is so pozzed that it kinda makes me forget about the FreeBSD nonsense years ago. If you want based and redpilled, though, I guess OpenBSD is your OS (well, that and TempleOS), and it will be mine sooner than later. NetBSD and Dragonfly too, probably.
Ea9YZDbU4AIDq0c.jpg (u)
[Hide] (183.4KB, 1200x630)
I've pretty much settled on starting JACK from my x11 session.
Then as a default device I use snd-aloop (alsa loopback).
I believe my solution is the most simple, stable and versatile (not elegant or ideal).

Everything that doesn't explicitly use JACK falls back to the alsa loopback which I can connect with alsa_in / alsa_out.
Plug in a second sound card? Just use alsa_in / alsa_out.
fuck alsa-plugins, fuck pulseaudio (bluetooth audio is for niggers and their lawn-sprinkler 808 subwoofer "beatz"), fuck pipewire (might be good actually I just don't care for another API).
If the software only works with pulseaudio then I uninstall it and correctly identify the author/organization as a "complete fucking faggot".
need to mixon a per client basis? just use the program's internal gain setting or ask your doctor for some ritalin then you'll stop playing four different streams at once.

The vast majority of complexity comes from modern desktop environments, gnome/kde, freedesktop, redhat, canon, etc.
Linux is a bitch. Fuck linux. I love linux. Not really.
Linux is neck and neck with wangblows in terms of audio, it really isn't clear that either is superior.
voicemeter and asio4all is basically the equiavlent of running jack with an alsa-bridge.
Most critiscisms of linux audio are fairly petty and ignore the bullshit every other OS has.

Criticsisms of alsa (vis a vis promotion of OSS4) is usually petty and on the same level as autists arguing over lame V0 VBR mp3s vs 256k CBR mp3s, you might be technically correct but you would probably fail a double-blind A/B test.
The main complaint with linux audio is the actual API, fuck that shit. you couldn't pay me to write an alsa backend for anything I'll just use some bitch-made audio API wrapper or jack only, fuck I'd rather use SDL lmao.
This, advanced Linux is not actually hard unless you're gay or niggerbrained. Newfag distros are niggerlicious and will only create problems for you in the long run.
me.webm (u)
[Hide] (725.8KB, 480x360, 00:15)
>install Pipewire
>instantly dislike how it sounds
>sounds...less sharp somehow?
>look back at my previous ALSA setup
>I hadn't installed a resampler
>not even the speexrate resampler
>it was the linear interpolation fallback
>Void Linux had that in a separate subpackage from alsa-plugins (of course)
However bad Pipewire's resampler is, can't be as bad as linear interpolation. This does make me wonder, though: is Pipewire just running everything through a resampler for some reason?
Replies: >>3282 >>4121
Just record the playback of something and compare the files.
The simplest way to work with Linux sound is to install an operating system that follows a concise design where programs within this operating system are made to play well with each other like a BSD.
Yes, Pipewire resamples everything to not need to deal with the issue of different samplerates or dropouts when there's a samplerate change
Replies: >>4132
Is that good or bad?
Replies: >>4136
Bad if the resampler is bad. Also bad in general if programs have no way to set their own sample rate if they want to. ALSA dmix do that and also allow program to take over the audio device if needed. Not sure what the point of pipewire is.
Replies: >>4155
So what should I use for best possible audio quality on Linux then? I pretty much have Pipewire installed just because EasyEffects has it as a dependency, and I use that for it's convolver plugin in order to make my headphones sound better with impulse file from the AutoEq Github project. Also pavucontrol is really handy for mic spamming during gamenights. Is pure ALSA with apulse the way to go?
Replies: >>4159
All audio system on Linux builds on alsa. Audio quality can only get worst from the source. More layer, more chance for fuckups. Just alsa raw hw prevents resampling and let the software do the thing. If you have more than one software playing audio at the same time, resampling is needed. To improve resample quality, use libsamplerate >>2250.
Replies: >>4164
Tried with pure ALSA and apulse, but apulse doesn't work with the PA-only programs that I use, so I've just simply gave up and installed PulseAudio again. Uncommented and changed these lines in my copy of daemon.conf from ~/.config/pulse for better quality:
resample-method = src-sinc-best-quality
avoid-resampling = true
default-sample-format = float32le
default-fragments = 2
default-fragment-size-msec = 1
Replies: >>4165
apulse's library override doesn't work, did you use "apulse program" to run your program?
Replies: >>4166
Yes, I did.
Replies: >>4167
What program? All of mine works.
Replies: >>4172
https://aur.archlinux.org/packages/pulseeffects-legacy/ and pavucontrol.
Replies: >>4178
Of course those won't work. apulse only works with basic audio output while pretending to be pulse. Both software you listed interacts with an actual pulse audio server.
Do you really need per program volume control? If not, alsamixer. Otherwise you can give this a try: https://alsa-devel.alsa-project.narkive.com/jH4DT3mN/patch-per-application-volume-control-plugin-for-alsa
Use the fifo plugin and set up ffmpeg filter chain, outputs to raw hw. You should nice it realtime.
[New Reply]
56 replies | 12 files
Show Post Actions



- news - rules - faq -
jschan 0.1.7