kcat / openal-soft

OpenAL Soft is a software implementation of the OpenAL 3D audio API.
Other
2.19k stars 531 forks source link

Audio is lacking bass or the quality is low #877

Open Alexelnet opened 1 year ago

Alexelnet commented 1 year ago

When playing sound on GNU/Linux with PipeWire backend, I noticed a lack of bass in comparison with any other piece of software for playing sounds. With OpenAL it sounds dampen, low quality and lacking bass. It's almost like it has a mid and high pass filter applied to it.

I tested on Windows too and didn't notice any issue there. It sounds just as it should with the right amount of bass. I don't know if this happens with other backends such as PulseAudio, sndio or Jack.

ekshanator commented 1 year ago

Judging by your description, it sounds like HRTF is on. In my experience, if you have HRTF forced on, it applies even to stereo sounds and produces a really odd, dampened result, that also destroys bass and stereo imaging.

Alexelnet commented 1 year ago

I definitely have no HRTF. I play the sound in stereo. (no 3D sound). It's for ambient music. I compared the sound with other pieces of software and it only sounds like that with OpenAL. I tried with VLC, straight ALSA, straight PipeWire and they all sound the way it should, not the case with OpenAL.

kcat commented 1 year ago

Can you paste a trace log with the app that plays the sound with low-quality? Set the ALSOFT_LOGLEVEL environment variable to 3 when you run the app to have it print the log to stderr (or also set the ALSOFT_LOGFILE env var to a path+filename to write the log to the given file instead).

What speaker setup do you have? 7.1, 5.1, headphones/ear buds, plain stereo, ...?

Alexelnet commented 1 year ago

I have 5.1 and headphones.

Here are the logs:

[ALSOFT] (II) Initializing library v1.23.1-ff7bf52b master
[ALSOFT] (II) Supported backends: pipewire, pulse, alsa, oss, jack, port, null, wave
[ALSOFT] (II) Loading config /etc/openal/alsoft.conf...
[ALSOFT] (II) Loading config /etc/xdg/alsoft.conf...
[ALSOFT] (II) Loading config /home/user/.config/kdedefaults/alsoft.conf...
[ALSOFT] (II) Loading config /home/user/.alsoftrc...
[ALSOFT] (II) Loading config /home/user/.config/alsoft.conf...
[ALSOFT] (II) Got binary: "/home/user/somepath", "Launcher"
[ALSOFT] (II) Loading config /home/user/somepath/alsoft.conf...
[ALSOFT] (II) Key disable-cpu-exts not found
[ALSOFT] (II) Vendor ID: ""
[ALSOFT] (II) Name: "Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz"
[ALSOFT] (II) Extensions: +SSE +SSE2 +SSE3 +SSE4.1
[ALSOFT] (II) Key rt-prio not found
[ALSOFT] (II) Key rt-time-limit not found
[ALSOFT] (II) Key game_compat/enable-sub-data-ext not found
[ALSOFT] (II) Key game_compat/reverse-x not found
[ALSOFT] (II) Key game_compat/reverse-y not found
[ALSOFT] (II) Key game_compat/reverse-z not found
[ALSOFT] (II) Key game_compat/nfc-scale not found
[ALSOFT] (II) Key resampler not found
[ALSOFT] (II) Key uhj/decode-filter not found
[ALSOFT] (II) Key uhj/encode-filter not found
[ALSOFT] (II) Key trap-al-error not found
[ALSOFT] (II) Key trap-alc-error not found
[ALSOFT] (II) Key reverb/boost not found
[ALSOFT] (II) Key drivers not found
[ALSOFT] (II) Found PipeWire version "0.3.75" (0.3.75 or newer)
[ALSOFT] (II) Key pipewire/assume-audio not found
[ALSOFT] (II) Ignoring metadata "settings"
[ALSOFT] (II) Ignoring metadata "route-settings"
[ALSOFT] (II) Ignoring node class Midi/Bridge
[ALSOFT] (II) Initialized backend "pipewire"
[ALSOFT] (II) Added "pipewire" for playback
[ALSOFT] (II) Added "pipewire" for capture
[ALSOFT] (II) Key excludefx not found
[ALSOFT] (II) Key default-reverb not found
[ALSOFT] (II) Opening default playback device
[ALSOFT] (II) Got default playback device "alsa_output.pci-0000_00_1b.0.analog-surround-51"
[ALSOFT] (II) Got default capture device "alsa_input.pci-0000_00_1b.0.analog-stereo"
[ALSOFT] (II) Got sink device "alsa_output.pci-0000_00_1b.0.analog-surround-51"
[ALSOFT] (II)   "Built-in Audio Analog Surround 5.1" = ID 48
[ALSOFT] (II) Device ID 48 sample rate: 48000 (range: 44100 -> 192000)
[ALSOFT] (II) Device ID 48 got 6 positions for 5.1 Surround(rear)
[ALSOFT] (II) Got source device "alsa_input.pci-0000_00_1b.0.analog-stereo"
[ALSOFT] (II)   "Built-in Audio Analog Stereo" = ID 49
[ALSOFT] (II) Device ID 49 sample rate: 48000 (range: 44100 -> 192000)
[ALSOFT] (II) Device ID 49 got 2 positions for Stereo
[ALSOFT] (II) Created device 0x5569afa1a550, "Built-in Audio Analog Surround 5.1"
[ALSOFT] (II) Key frequency not found
[ALSOFT] (II) Key period_size not found
[ALSOFT] (II) Key periods not found
[ALSOFT] (II) Key sample-type not found
[ALSOFT] (II) Key channels not found
[ALSOFT] (II) Key ambi-format not found
[ALSOFT] (II) Key hrtf not found
[ALSOFT] (II) Key stereo-encoding not found
[ALSOFT] (II) Pre-reset: Stereo, Float32, 48000hz, 960 / 2880 buffer
[ALSOFT] (II) Key pipewire/rt-mix not found
[ALSOFT] (II) Post-reset: 5.1 Surround, Float32, 48000hz, 960 / 2880 buffer
[ALSOFT] (II) Key stereo-mode not found
[ALSOFT] (II) Key decoder/surround51 not found
[ALSOFT] (II) Using built-in 5.1 Surround decoder
[ALSOFT] (II) Key front-stablizer not found
[ALSOFT] (II) Key decoder/hq-mode not found
[ALSOFT] (II) Channel config, Main: 5, Real: 6
[ALSOFT] (II) Allocating 11 channels, 45056 bytes
[ALSOFT] (II) Enabling dual-band second-order ambisonic decoder
[ALSOFT] (II) Key sources not found
[ALSOFT] (II) Key sends not found
[ALSOFT] (II) Max sources: 256 (255 + 1), effect slots: 64, sends: 2
[ALSOFT] (II) Key dither not found
[ALSOFT] (II) Key dither-depth not found
[ALSOFT] (II) Dithering disabled
[ALSOFT] (II) Key output-limiter not found
[ALSOFT] (II) Output limiter disabled
[ALSOFT] (II) Fixed device latency: 0ns
[ALSOFT] (II) Post-start: 5.1 Surround, Float32, 48000hz, 512 / 1024 buffer
[ALSOFT] (II) Increasing allocated voices to 256
[ALSOFT] (II) Key volume-adjust not found
[ALSOFT] (II) Created context 0x5569afa58fa0
[ALSOFT] (II) Increasing allocated voice properties to 32
kcat commented 1 year ago

5.1 and headphones? A 5.1 mix won't sound correct on headphones without some sort of HRTF or binaural filter.

Alexelnet commented 1 year ago

It never sounded properly neither on 5.1 neither on straight stereo. Why there's no problem on Windows?

kcat commented 1 year ago

Can you provide a log of when it's set to stereo?

Do the headphones advertise some kind of built-in virtual surround sound capability, or are they plain headphones? How was the device configured on Windows (was it set to surround sound, virtual surround sound, or stereo headphones)? When you tested on Windows, was that also using OpenAL Soft, or a different OpenAL driver? Can you provide a log of it running under Windows?

If you make a recording of the app, then play that recording on a non-OpenAL app, does it still lack bass?