You are not logged in.

#1 2019-06-15 02:13:50

suson
Member
Registered: 2018-12-23
Posts: 24

[SOLVED] using alsa equalizer with pulseaudio

Is it possible to use pulseaudio along with alsa equalizer. what i want is something like this:
applications->pulseaudio->alsa-equalizer->alsa.
I thought it would be like directing the output of pulseaudio to plugins in alsa, so all the audio passes through pulseaudio and then through alsa pulgin and to alsa.

Last edited by suson (2020-07-18 12:37:30)

Offline

#2 2019-06-15 10:46:09

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,409

Re: [SOLVED] using alsa equalizer with pulseaudio

You really, really don't want to do this. Pulse should be the final processing step before the audio card, use a pulse equalizer instead, there's a relatively limited one in pulseaudio-equalizer, there is a quite expansive one in pulseaudio-equalizer-ladspa and there is everything you could ever want in pulseffects (note the optdepends), pick one.

Last edited by V1del (2019-06-15 10:46:56)

Offline

#3 2019-06-15 14:52:04

suson
Member
Registered: 2018-12-23
Posts: 24

Re: [SOLVED] using alsa equalizer with pulseaudio

Thanks for your reply, i was using pulseaudio-equalizer-ladspa, but the problem is, there is audio crackling when multiple application are playing sound. It doesn't happen with the pulseaudio without the equalizer, i had done some research and it was some kind of "buffer rewind" in pulseaudio. So, I was wandering if i could use the equalizer in the alsa end, and let pulseaudio handle the software mixing. I also tried pulseeffects and the same crackling issue appears.

Offline

#4 2019-06-16 04:35:18

wwmm
Member
From: Rio de Janeiro, Brazil
Registered: 2010-08-14
Posts: 28

Re: [SOLVED] using alsa equalizer with pulseaudio

It is a little strange to have cracklings just because multiple apps are playing audio at the same time. The rewind bug shows itself in a different situation as you can see here https://github.com/wwmm/pulseeffects/issues/350. This bug will be solved for PulseEffects through an workaround that will come with the next Pulseaudio release. Maybe you can try to use the aur package pulseaudio-git and see what happens. But it feels like the source of your problem is somewhere else.

Last edited by wwmm (2019-06-16 04:35:54)

Offline

#5 2019-06-16 17:53:02

suson
Member
Registered: 2018-12-23
Posts: 24

Re: [SOLVED] using alsa equalizer with pulseaudio

As i said, pulseaudio works fine(without crackling) if pulseaudio-equalizer-ladspa is not used, but if the equalizer is used, then there is audio crackling, it's not that worse, it happens when one app pauses or plays, and other app are playing.

Offline

#6 2019-06-16 18:06:43

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,409

Re: [SOLVED] using alsa equalizer with pulseaudio

Try bigger buffers, while this happens what is your output for

pacmd list-sinks
pacmd list-sink-inputs
pacmd list-sources
pacmd list-source-outputs

?

Offline

#7 2019-06-17 03:28:27

suson
Member
Registered: 2018-12-23
Posts: 24

Re: [SOLVED] using alsa equalizer with pulseaudio

output of list-sinks:

2 sink(s) available.
    index: 0
        name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
        driver: <module-alsa-card.c>
        flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
        state: RUNNING
        suspend cause: (none)
        priority: 9039
        volume: front-left: 51774 /  79% / -6.14 dB,   front-right: 51774 /  79% / -6.14 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 8.88 ms
        max request: 2 KiB
        max rewind: 2 KiB
        monitor source: 0
        sample spec: s32le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 1
        linked by: 1
        fixed latency: 7.98 ms
        card: 1 <alsa_card.pci-0000_00_1b.0>
        module: 7
        properties:
                alsa.resolution_bits = "32"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC668 Analog"
                alsa.id = "ALC668 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "1"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xf7a00000 irq 38"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:1b.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card1"
                device.bus = "pci"
                device.vendor.id = "8086"
                device.vendor.name = "Intel Corporation"
                device.product.id = "8c20"
                device.product.name = "8 Series/C220 Series Chipset High Definition Audio Controller"
                device.form_factor = "internal"
                device.string = "front:1"
                device.buffering.buffer_size = "2816"
                device.buffering.fragment_size = "704"
                device.access_mode = "mmap"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "Built-in Audio Analog Stereo"
                alsa.mixer_name = "Realtek ALC668"
                alsa.components = "HDA:10ec0668,104313bf,00100003"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        ports:
                analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)
                        properties:
                                device.icon_name = "audio-speakers"
                analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)
                        properties:
                                device.icon_name = "audio-headphones"
        active port: <analog-output-speaker>
  * index: 1
        name: <ladspa_output.mbeq_1197.mbeq>
        driver: <module-ladspa-sink.c>
        flags: HW_MUTE_CTRL LATENCY 
        state: RUNNING
        suspend cause: (none)
        priority: 1000
        volume: front-left: 51774 /  79%,   front-right: 51774 /  79%
                balance 0.00
        base volume: 65536 / 100%
        volume steps: 65537
        muted: no
        current latency: 8.81 ms
        max request: 2 KiB
        max rewind: 2 KiB
        monitor source: 2
        sample spec: float32le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 1
        linked by: 1
        fixed latency: 7.98 ms
        module: 23
        properties:
                device.master_device = "alsa_output.pci-0000_00_1b.0.analog-stereo"
                device.class = "filter"
                device.ladspa.module = "mbeq_1197"
                device.ladspa.label = "mbeq"
                device.ladspa.name = "Multiband EQ"
                device.ladspa.maker = "Steve Harris <steve@plugin.org.uk>"
                device.ladspa.copyright = "GPL"
                device.ladspa.unique_id = "1197"
                device.description = "LADSPA Plugin Multiband EQ on Built-in Audio Analog Stereo"
                device.icon_name = "audio-card"

output of list-sink-inputs:

2 sink input(s) available.
    index: 0
        driver: <module-ladspa-sink.c>
        flags: START_CORKED 
        state: RUNNING
        sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        muted: no
        current latency: 0.00 ms
        requested latency: n/a
        sample spec: float32le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        resample method: copy
        module: 23
        properties:
                media.name = "LADSPA Stream"
                media.role = "filter"
                module-stream-restore.id = "sink-input-by-media-role:filter"
    index: 53
        driver: <protocol-native.c>
        flags: START_CORKED 
        state: RUNNING
        sink: 1 <ladspa_output.mbeq_1197.mbeq>
        volume: front-left: 63570 /  97% / -0.79 dB,   front-right: 63570 /  97% / -0.79 dB
                balance 0.00
        muted: no
        current latency: 174.85 ms
        requested latency: 7.98 ms
        sample spec: s16le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        resample method: copy
        module: 10
        client: 16 <Clementine>
        properties:
                media.name = "'365' by 'Zedd & Katy Perry'"
                application.name = "Clementine"
                native-protocol.peer = "UNIX socket client"
                native-protocol.version = "32"
                media.role = "music"
                application.process.id = "3582"
                application.process.user = "suson"
                application.process.host = "archsuson"
                application.process.binary = "clementine"
                application.language = "en_US.UTF-8"
                window.x11.display = ":0"
                application.process.machine_id = "83be8c03d1a84d4192a5421de9baba85"
                application.process.session_id = "2"
                application.icon_name = "clementine"
                module-stream-restore.id = "sink-input-by-media-role:music"
                media.title = "365"
                media.artist = "Zedd & Katy Perry"

output for list-sources:

3 source(s) available.
    index: 0
        name: <alsa_output.pci-0000_00_1b.0.analog-stereo.monitor>
        driver: <module-alsa-card.c>
        flags: DECIBEL_VOLUME LATENCY 
        state: IDLE
        suspend cause: (none)
        priority: 1030
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max rewind: 2 KiB
        sample spec: s32le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 0
        linked by: 0
        fixed latency: 7.98 ms
        monitor_of: 0
        card: 1 <alsa_card.pci-0000_00_1b.0>
        module: 7
        properties:
                device.description = "Monitor of Built-in Audio Analog Stereo"
                device.class = "monitor"
                alsa.card = "1"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xf7a00000 irq 38"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:1b.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card1"
                device.bus = "pci"
                device.vendor.id = "8086"
                device.vendor.name = "Intel Corporation"
                device.product.id = "8c20"
                device.product.name = "8 Series/C220 Series Chipset High Definition Audio Controller"
                device.form_factor = "internal"
                device.string = "1"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
  * index: 1
        name: <alsa_input.pci-0000_00_1b.0.analog-stereo>
        driver: <module-alsa-card.c>
        flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
        state: RUNNING
        suspend cause: (none)
        priority: 9039
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 20724 /  32% / -30.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.18 ms
        max rewind: 0 KiB
        sample spec: s32le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 1
        linked by: 1
        fixed latency: 7.98 ms
        card: 1 <alsa_card.pci-0000_00_1b.0>
        module: 7
        properties:
                alsa.resolution_bits = "32"
                device.api = "alsa"
                device.class = "sound"
                alsa.class = "generic"
                alsa.subclass = "generic-mix"
                alsa.name = "ALC668 Analog"
                alsa.id = "ALC668 Analog"
                alsa.subdevice = "0"
                alsa.subdevice_name = "subdevice #0"
                alsa.device = "0"
                alsa.card = "1"
                alsa.card_name = "HDA Intel PCH"
                alsa.long_card_name = "HDA Intel PCH at 0xf7a00000 irq 38"
                alsa.driver_name = "snd_hda_intel"
                device.bus_path = "pci-0000:00:1b.0"
                sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card1"
                device.bus = "pci"
                device.vendor.id = "8086"
                device.vendor.name = "Intel Corporation"
                device.product.id = "8c20"
                device.product.name = "8 Series/C220 Series Chipset High Definition Audio Controller"
                device.form_factor = "internal"
                device.string = "front:1"
                device.buffering.buffer_size = "2816"
                device.buffering.fragment_size = "704"
                device.access_mode = "mmap"
                device.profile.name = "analog-stereo"
                device.profile.description = "Analog Stereo"
                device.description = "Built-in Audio Analog Stereo"
                alsa.mixer_name = "Realtek ALC668"
                alsa.components = "HDA:10ec0668,104313bf,00100003"
                module-udev-detect.discovered = "1"
                device.icon_name = "audio-card-pci"
        ports:
                analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: unknown)
                        properties:
                                device.icon_name = "audio-input-microphone"
        active port: <analog-input-mic>
    index: 2
        name: <ladspa_output.mbeq_1197.mbeq.monitor>
        driver: <module-ladspa-sink.c>
        flags: DECIBEL_VOLUME LATENCY 
        state: IDLE
        suspend cause: (none)
        priority: 1000
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        base volume: 65536 / 100% / 0.00 dB
        volume steps: 65537
        muted: no
        current latency: 0.00 ms
        max rewind: 2 KiB
        sample spec: float32le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        used by: 0
        linked by: 0
        fixed latency: 7.98 ms
        monitor_of: 1
        module: 23
        properties:
                device.description = "Monitor of LADSPA Plugin Multiband EQ on Built-in Audio Analog Stereo"
                device.class = "monitor"
                device.icon_name = "audio-input-microphone"

output for list-source-outputs:

1 source output(s) available.
    index: 10
        driver: <protocol-native.c>
        flags: START_CORKED 
        state: RUNNING
        source: 1 <alsa_input.pci-0000_00_1b.0.analog-stereo>
        volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
                balance 0.00
        muted: no
        current latency: 0.00 ms
        requested latency: 7.98 ms
        sample spec: s16le 2ch 44100Hz
        channel map: front-left,front-right
                     Stereo
        resample method: copy
        owner module: 10
        client: 7 <Chrome input>
        properties:
                application.icon_name = "google-chrome"
                media.name = "RecordStream"
                application.name = "Chrome input"
                native-protocol.peer = "UNIX socket client"
                native-protocol.version = "32"
                application.process.id = "3405"
                application.process.user = "suson"
                application.process.host = "archsuson"
                application.process.binary = "chrome"
                application.language = "en_US.UTF-8"
                window.x11.display = ":0"
                application.process.machine_id = "83be8c03d1a84d4192a5421de9baba85"
                application.process.session_id = "2"
                module-stream-restore.id = "source-output-by-application-name:Chrome input"

By the way I am using pulseaudio in timer based scheduling, so i don't think

buffer_size and fragment_size

would have any difference. I tried with

tsched=0

and it doesn't make any difference. So, i think the issue is with the pulseaudio-equalizers, any thing like pulseeffects or pulseaudio-equalizer-ladspa would cause this type of cracking.

Offline

#8 2019-06-17 09:03:35

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,409

Re: [SOLVED] using alsa equalizer with pulseaudio

Those are some very unrealistic latency targets there, see if you get any improvements from increasing that in pavucontrol (not sure whether you'd have to adjust just the actual card or the ladspa sink as well, probably rather the card, as that is what is unlikely to be able to drive such a low latency)

That said

suson wrote:

So, i think the issue is with the pulseaudio-equalizers, any thing like pulseeffects or pulseaudio-equalizer-ladspa would cause this type of cracking.

That wording makes it sound like you haven't tried either option, based on the assumption that whatever's affecting your current equalizer must affect them all. Which I'd say is a quite short sighted approach for various reasons. First of all, there is no THE pulseaudio-equalizer, they all (like alsaequal) can use different LADSPA plugins with differing implementations. The standard pulseaudio-equalizer equalizer is known for being a bit clunky, that doesn't have to hold true for anything else. FWIW I usually do not use any effects like these, but I've dabbled with pulseeffects and you get vastly more control over the exact processing steps.

Last edited by V1del (2019-06-17 09:15:40)

Offline

#9 2019-06-17 14:33:50

suson
Member
Registered: 2018-12-23
Posts: 24

Re: [SOLVED] using alsa equalizer with pulseaudio

So, I switched to pulseeffects, It been 5-6 months since the last time i used it. Back then it was stuttering so, I decided to try pulseaudio-equalizer-ladspa which was also stuttering but to a lesser degree. And today, I installed pulseeffects and the stuttering is almost gone, they have improved a lot. Anyway, thank you all for your support and  I think I should close this topic now.

Offline

Board footer

Powered by FluxBB