You are not logged in.

#1 2020-10-06 03:15:23

babyturtle
Member
Registered: 2015-05-22
Posts: 12

pulseaudio headphone problem (compressor plugin not loading)

I have a pulseaudio setup with a dynamic range compressor plugin. I use the headphone jack for output.
It all works perfectly... up until the point I pull out the headphones from the jack and plug them back in.
The compressor plugin is not reloaded.

Here is what it looks like when it's working:

 pacmd list-sinks | awk '/index/ || /name:/ || /alsa.card_name/ || /device.description/'
    index: 0
        name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
                alsa.card_name = "HDA Intel PCH"
                device.description = "Built-in Audio Analogue Stereo"
  * index: 1
        name: <compressor-stereo>
                device.description = "LADSPA Plugin SC4 on Built-in Audio Analogue Stereo"

When I pull the headphones out, I get the following:

  pacmd list-sinks | awk '/index/ || /name:/ || /alsa.card_name/ || /device.description/'
  * index: 4
        name: <auto_null>
                device.description = "Dummy Output"

               

When I plug the headphones back in I get (with no compressor plugin and an increase in the index #):

  pacmd list-sinks | awk '/index/ || /name:/ || /alsa.card_name/ || /device.description/'
  * index: 5
        name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
                alsa.card_name = "HDA Intel PCH"
                device.description = "Built-in Audio Analogue Stereo"

               

Here is the main part of the config (default.pa) which is loading the plugin:

                
# My changes for the compressor
set-default-sink alsa_output.pci-0000_00_1f.3.analog-stereo

#Dynamic Range Compression
load-module module-ladspa-sink sink_name=compressor-stereo sink_master=alsa_output.pci-0000_00_1f.3.analog-stereo plugin=sc4_1882 label=sc4 control=1,1.5,401,-30,20,5,12
# set our custom compressor audio as default
set-default-sink compressor-stereo

               

How can I get the compressor plugin to reload after plugging the headphones back in (without manually restarting pulseaudio)?

Thanks.

Offline

#2 2020-10-06 07:23:25

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

Re: pulseaudio headphone problem (compressor plugin not loading)

The default.pa is just an easy way to define default pacmd commands.  So you can reload this during runtime with

pacmd load-module module-ladspa-sink sink_name=compressor-stereo sink_master=alsa_output.pci-0000_00_1f.3.analog-stereo plugin=sc4_1882 label=sc4 control=1,1.5,401,-30,20,5,12

What I do find weird in general is that the card completely disappears, I'd expect it to just change the underlying output port to speakers which should not affect the top level sink nor the compressor plugin or so what's your

pacmd list-cards

after an unplug?

To actually automate this you will likely want to listen to the jack event, see this post and thread for an example of how to do that with acpid.

Offline

#3 2020-10-06 12:38:31

babyturtle
Member
Registered: 2015-05-22
Posts: 12

Re: pulseaudio headphone problem (compressor plugin not loading)

Thanks for that! I will research that.

Here are the diffs of the command you asked for (with correct functionality with headphone in VS headphone out)

diff /tmp/a /tmp/b 
25,26c25,26
<               output:analog-stereo: Analogue Stereo Output (priority 6500, available: unknown)
<               output:analog-stereo+input:analog-stereo: Analogue Stereo Duplex (priority 6565, available: unknown)
---
>               output:analog-stereo: Analogue Stereo Output (priority 6500, available: no)
>               output:analog-stereo+input:analog-stereo: Analogue Stereo Duplex (priority 6565, available: no)
58,60c58
<       active profile: <output:analog-stereo>
<       sinks:
<               alsa_output.pci-0000_00_1f.3.analog-stereo/#0: Built-in Audio Analogue Stereo
---
>       active profile: <input:analog-stereo>
62c60
<               alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#0: Monitor of Built-in Audio Analogue Stereo
---
>               alsa_input.pci-0000_00_1f.3.analog-stereo/#3: Built-in Audio Analogue Stereo
64c62
<               analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: no)
---
>               analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)
67c65
<               analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: yes)
---
>               analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)
70c68
<               analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: yes)
---
>               analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)

Thanks

V1del wrote:

The default.pa is just an easy way to define default pacmd commands.  So you can reload this during runtime with

pacmd load-module module-ladspa-sink sink_name=compressor-stereo sink_master=alsa_output.pci-0000_00_1f.3.analog-stereo plugin=sc4_1882 label=sc4 control=1,1.5,401,-30,20,5,12

What I do find weird in general is that the card completely disappears, I'd expect it to just change the underlying output port to speakers which should not affect the top level sink nor the compressor plugin or so what's your

pacmd list-cards

after an unplug?

To actually automate this you will likely want to listen to the jack event, see this post and thread for an example of how to do that with acpid.

Offline

#4 2020-10-08 03:26:04

babyturtle
Member
Registered: 2015-05-22
Posts: 12

Re: pulseaudio headphone problem (compressor plugin not loading)

I've finally fixed this problem as follows:

sudo vi /usr/share/pulseaudio/alsa-mixer/paths/analog-output-lineout.conf

Made the following chages:

[Jack Front Headphone]
state.plugged = no
state.unplugged = no

restart pulseaudio

Now when I pull and plug the headphones in and out... nothing changes. All good!

Offline

Board footer

Powered by FluxBB