[Solved] Terrible sound in linux, much better in windows

I think he wanted to say that headphones is the way to go for him (and for me, too :smile:)

1 Like

Never need a mute button once you own a pair of headphones man. :wink:

1 Like

I just used your advice and put above settings to ~/.config/pulse/daemon.conf and music quality boosted a lot!
Now it’s good! It’s a bit different then in windows and I can’t put my fingers on it to decide what is better or different, but luckily now there is no dynamicless and can-like sound like before!

It looks like linux is capable of higher quality sound, only generic settings a crappy as hell.

Now I can only learn more above music settings and how to change them to tweak sound more but it’s comparable to windows now. The wow effect and dynamic is also on linux :smiley:

Again, where is it or where to create this asound.conf? If the first piece of linux magic worked, I am curious if this would do something to ;). And yes, it’s all terribly complicated and sounds more like magic: say this spell and you will get X. Still it’s joy if it works!

1 Like

its

/etc/asound.conf

:wink:

facepalm…

Sorry to be so blind. @Calthax did say it’s in etc. Thanks @cscs for reminding me of this.

I adjusted asound.conf as pointed above and it does improve sound, however the difference is not so huge to hear on laptop speakers.

Is there a way to use this file in user folder? I prefer my home location for better backup/restore possibilities.

Anyway, I’m happy now! :smile: :sunny: I can hear music on linux and there is no need to switch to windows!

Just few more things to solve and system will be perfect :slight_smile:

Configuration

The system configuration file is /etc/asound.conf, and the per-user configuration file is ~/.asoundrc.

https://wiki.archlinux.org/index.php/Advanced_Linux_Sound_Architecture#Configuration
Actually, you can read the entire wiki page if you want. Arch Wiki is the best we have, don’t waste it! :wink:

2 Likes

Thanks. Will copy the file there.

Arch wiki can be very helpful but often there are articles that are not too helpful for newbies (too technical, over packed with details or… having not enough info to go on - for more advanced users that know what to do with the info). For me going through those articles and making something out of it, it’s a project for many weeks if not months… I just have couple free hours at evening and my mind is not fresh enough to lean so new and foreign content. Not all linux users are technical geeks ;).

1 Like

After that I don’t have any sound anymore. pavucontrol only says “Establishing connection to PulseAudio. Please wait…” and stays there.

Had that too, but realized I pasted settings with @Calthax’s comments… :stuck_out_tongue: When I corrected the text in the file and rebooted, sound came back and with a kick!

First I did the same mistake (he should format the text :smile:), but I found it out by myself and changing it didn’t help. Did you only change the deamon.conf or both files?

I changed the daemon.conf first (you made a spell mistake in your post - in your file name, check if your file doesn’t have the same mistake) and it worked incredibly well so I went to change the second file, which did make some difference but not so stellar as the first one.

No problem, we got you covered here :wink:

I did some trial and error with the result, that changing the asound.conf works for my system, changing the daemon.conf doesn’t.
Are there some lines that don’t work with all hardware?
So to be sure I didn’t do any mistake, I post how my not working daemon.conf looks like:

default-sample-format = float32le
default-sample-rate = 48000
alternate-sample-rate = 44100
default-sample-channels = 2
default-channel-map = front-left,front-right

default-fragments = 2
default-fragment-size-msec = 125
resample-method = soxr-vhq
enable-lfe-remixing = no
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 9
daemonize = no

I forgot a piece of the settings put this after realtime-priority but before daemonize
rlimit-rtprio = 9
realtime-priority and rlimit-rtprio have to be used in conjunction with each other to work
If that doesn’t solve your problem
try switching to speex-float-10
also float32le should be float32ne

Should I change those two if it works for me? Are those spelling mistakes or alternative version if it doesn’t work so I would have to not worry about it? Ah wait, I can google it… facepalm…

OK. found this:

default-sample-format=  The default sampling format. Specify one of u8,
       s16le, s16be, s24le, s24be, s24-32le, s24-32be, s32le, s32be float32le,
       float32be,  ulaw,  alaw.  Depending  on  the  endianness of the CPU the
       formats s16ne, s16re, s24ne, s24re, s24-32ne, s24-32re,  s32ne,  s32re,
       float32ne,  float32re  (for native, resp. reverse endian) are available
       as aliases.

So those are alternatives so in my case if it works I don’t have to do anything aside adding rlimit-rtprio = 9

EDIT: Added rlimit-rtprio = 9 and have impression that sound improved a little but at this already improved qualitry level and laptop speakers possibilities, the difference is no obvious or sure, but sound works, it didn’t mess anything so that’s a good thing :slight_smile:

Anyway, music can be listened in comfortable manner in linux. There is only an issue left of jack not working, see the thread:

That one works for me finally :slight_smile:

default-sample-format = float32ne
default-sample-rate = 48000
alternate-sample-rate = 44100
default-sample-channels = 2
default-channel-map = front-left,front-right

default-fragments = 2
default-fragment-size-msec = 125
resample-method = soxr-vhq
enable-lfe-remixing = no
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 9
rlimit-rtprio = 9
daemonize = no
2 Likes

IMPORTANT UPDATE:

As a second advice I changed /etc/asound.conf by adding:

pcm.!default {
type pulse
slave.pcm hw
}

Unfortunatellt it caused a bug:

ALSA lib pcm_pulse.c:1097:(sndpcm_pulse_open) Unknown field slave

as described here:

I talked with alsa specialist on irc #alsa channel and he pointed out that the setting above is just wrong and this is the cause of the issue so I REVERTED BACK TO DEFAULT asound.conf and the problem is gone.

So once again, the first advice of setting daemon.conf worked great, but not the second. Here is the first advice again:

Add to or create ~/.config/pulse/daemon.conf with:

default-sample-format = float32le
default-sample-rate = 48000
alternate-sample-rate = 44100
default-sample-channels = 2
default-channel-map = front-left,front-right
default-fragments = 2
default-fragment-size-msec = 125
resample-method = soxr-vhq
enable-lfe-remixing = no
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 9
rlimit-rtprio = 9
daemonize = no

As in the message above, it won’t work for all, so you may try out float32le instead or any of default sampling formats:

s16le, s16be, s24le, s24be, s24-32le, s24-32be, s32le, s32be float32le, float32be, ulaw, alaw

Also depending on the endianness of the CPU the
formats s16ne, s16re, s24ne, s24re, s24-32ne, s24-32re, s32ne, s32re,
float32ne, float32re (for native, resp. reverse endian) are available
as aliases.

That’s the summary of the sound quality fix.

4 Likes

In order to fix this replace
pcm.!default {
type pulse
slave.pcm hw
}
with
pcm.!default {
type plug
slave.pcm hw
}

2 Likes

This is great. I can finally watch movies without falling asleep because of the poor default settings.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.