Bug 98377 - Poor Audio Quality on iMac 2011 27 Inch - Solution inside
Summary: Poor Audio Quality on iMac 2011 27 Inch - Solution inside
Status: RESOLVED MOVED
Alias: None
Product: PulseAudio
Classification: Unclassified
Component: daemon (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: pulseaudio-bugs
QA Contact: pulseaudio-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-22 01:49 UTC by Dylan Taft
Modified: 2018-07-30 10:13 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Dylan Taft 2016-10-22 01:49:44 UTC

    
Comment 1 Dylan Taft 2016-10-22 01:58:44 UTC
Was told to file a bug in #pulseaudio for this.  It's more of a missing feature than a bug?  Basically Audio sounds awful on Linux compared to MacOS.  I slept on it, and thought maybe apple doesn't do hardware bandpass filtering.

The iMac audio is exposed as surround 4.0,  that's not right.  It's actually two high range speakers, and two speakers capable of bass. I'm not going to use the terms tweeter and sufwoofer, I don't think that's quite right.  A simple highpass\lowpass filter didn't seem to be good enough in testing, didn't sound anything like OSX.

I managed to get something together in Alsa with a LADSPA filter.   I would say running the speakers without any type of filter would probably damage them, it sounds that bad. 

This is all abstracted away from the user in OSX, it "just works", but it's pretty apparent they are doing "black magic" to the audio in software.  This sounds _very_ close.  OSX you have no control over what frequencies are sent to the 4 speakers.

Furthermore, does Pulse have the ability to apply LADSPA filters to sinks _per channel_?  I saw a way to do it per sink, but you'd have to split sinks into 4, apply LADSPA filters, and then recombine.


LADSPA FILTER: CAPS http://quitte.de/dsp/caps.html#Install
ALSA Audio volume settings:
MASTER 100, Speaker 73, Bass 94

This will combine the PCMs into one and apply filtering.
.asoundrc
pcm.default pulse

pcm.upmix20 {
    type route
    slave.pcm "plug:bandpass"
    slave.channels 4
    ttable.0.0 0.70
    ttable.1.1 0.70
    ttable.0.2 0.90
    ttable.1.3 0.90
}



pcm.bandpass {
	type ladspa
	#slave.pcm "plug:mydmix"
	slave.pcm "plughw:CARD=PCH,DEV=0"
	#slave.pcm "dmix:CARD=PCH,DEV=0"
	path "/usr/lib/ladspa"
    channels 4 
    plugins {
        0 {
            id 1773 #per listplugins
            policy none
            input.bindings.0 "in";
            output.bindings.0 "out";
            input {
                controls [ -48 -48 -48 -48 -30 -36 -30 -20 -4 5 ]
            }
        }
        1 {
            id 1773
            policy none
            input.bindings.1 "in";
            output.bindings.1 "out";
            input {
                controls [ -48 -48 -48 -48 -30 -36 -30 -20 -4 5 ]
            }
        }
        2 { #bass
            id 1773
            policy none
            input.bindings.2 "in";
            output.bindings.2 "out";
            input {
                controls [ 3 5 -4 -30 -35 -40 -40 -40 -48 -48 ]
            }
        }
        3 { #bass
            id 1773
            policy none
            input.bindings.3 "in";
            output.bindings.3 "out";
            input {
                controls [ 3 5 -4 -30 -35 -40 -40 -40 -48 -48 ]
            }
        }
    }
}
Comment 2 Dylan Taft 2016-10-22 02:03:08 UTC
Unsure if this is related, but Pulse also dies for me once every other day, I have to pulseaudio -k repeatedly to get it going.
http://pastebin.com/BeGS38FL


I sort of found a fix for that - default-sample-rate = 48000 in daemon.conf, it doesn't always open in 44100.  Will keep an eye on it.  

I did a lsof /dev/snd/* - nothing was locking the devices when Pulse was failing to work, and actually stopping pulse would allow alsa to work if I specified it to use my upmix20 pcm.
Comment 3 Dylan Taft 2016-10-22 02:07:39 UTC
A cool "fix" for this could be to add support for per channel LADSPA filtering inside sinks, and drop the code for that pulse equalizer if that still exists.  In theory a user audio calibration tool could be written that helps configure filters for the user - it's only possible to add ladspa filters inside default.pa right now, right?
Comment 4 GitLab Migration User 2018-07-30 10:13:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/274.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.