Help needed: pulse audio volume control per single application

xfce
pulseaudio
volume

#1

Hi all,

I hope this is the correct category for this post. If not please feel free to move.

To explain my hardware set up to understand the question:

I previously used a USB volume knob to control volume. It worked fine, controlled volume system-wide and I allowed the notifications to show the volume levels. Let’s call this Volume A.

Then, I changed my desktop speakers for something a little fancier. These 2.1 speakers came with its own hardware control knob which has a bass slider, and itself is an on/off switch. Let’s call this Volume B. This now replaced Volume A and controls volumes system-wide but obviously externally.

But what I now want to do is use both pieces of hardware in a specific configuration. I want Volume A to control ONLY my media player and NOT affect any other volume levels across the system. I will then continue using Volume B system-wide.

Using the graphical interface pavucontrol doesn’t give me this fine-grain control. I’m guessing that I’ll need to edit the `etc/pulse/default.pa’ file, or one of the files in that directory?

Can anyone please help me with this? Thanks :slight_smile:


#2

pavucontrol definitely does provide per-application volume control:


#3

My version of pavucontrol does not show this level of control. It used to, several versions back. Perhaps I should restore the default.pa?

Currently, this is how my version looks - as you can see, no choice possible about how the music is routed:

pavucontrol


#4

I haven’t touched my configuration and it all works with multiple devices. :man_shrugging:


#5

That isn’t really telling me very much is it, if you don’t mind me saying?

What I need to do is effectively ‘lock down’ pavucontrol so that my Volume A ONLY affects my media player volume and that NO OTHER system volumes i.e. browser, movie player, are affected.


#6

is pavucontrol showing multiple output devices on the output devices tab? if not, check the configuration tab


#7

If by ‘multiple output devices’ you mean is there a choice then yes, there’s a long dropdown list available :slight_smile:


#8

I’m telling you that I didn’t alter any configuration. You said you might want to

so you could infer that any changes you have made were unnecessary. I don’t know what changes you’ve made so you’ll have to make that decision for yourself.

I suspect what you need to do is make sure that pavucontrol can see your audio devices.


#9

a long dropdown list each for how many devices?


#10

oops, sorry - confused the tabs in the GUI. Under ‘output devices’ there’s only TWO: line out and headphones. The long list I was referring to is under the configuration tab: Built-In-Audio and which offers me a long list. However, as ‘output devices’ there’s just the line out and headphones.

Perhaps I should have explained that ALL audio exits my computer via the 3.5mm jack on the motherboard.


#11

So, have completely reinstalled the pulse audio stack, thus back to standard installation.

However I note that pavucontrol comes up EXACTLY as the screenshot already posted!

While yes, I have previously seen the ability to select on a per application basis, currently nothing of the sort is showing.

Apart from having previously tweaked the default.pa to allow me to swap left and right channels on my previous speaker set up, I have made NO OTHER changes at all to the sound configuration on this computer. So I seem to have now ended up with a different, ‘less featured’ version of pavucontrol.

From your original reply I can see how to do what I need, but currently my issue seems to be that I’ve lost this ability to choose the sound routing.


#12

the dropdown list in pavucontrol -t 1 for each audio stream will only show if there is more than one audio hardware device available

dropdown list in pavucontrol -t 5 show profiles available for each audio device
can only choose one profile at a time

pavucontrol -t 4 will probably show dropdown to switch between ‘Line Out’ and ‘Headphones’

if all audio uses onboard sound device, that device may or may not be able to support using ‘line out’ and ‘headphones’ independently and show 2 playback routing options
it will not be possible if aplay -l only shows one subdevice available for analog audio output
even if it were possible, it is not easy to disable udev detecting audio devioces for the 2 subdevices to be loaded as independent outputs

you have posted very little information about your audio hardware, or system information
in absence of something more specific, is not easy to advise much generally

see also man default.pa


#13

Thank you :slight_smile:

VERY happy to post more information about my system - please let me know what sort of terminal output you’d like to see and I’ll post it here. I only ask because there seem to be about six thousand ways of interrogating the system. Helpful if I only post what’s relevant to the discussion.


#14

please post inxi -Fxz also aplay -l

you should be aware of this, especially section2 and 20:
https://wiki.manjaro.org/index.php?title=Forum_Rules

you need to explain in detail what is device you call ‘Volume A’

  • what is device manufacturer and model name/number?
  • if it is a usb device, what does lsusb show it detected as?
  • please post any links to manufacturer specifications/support/manual
    or links to any other Linux information about device

#15

Reading through things again, it looks like OP wants their hardware USB volume knob to alter the volume of only an arbitrary media player instead of sending multimedia key input which is detected by the OS.

This doesn’t sound trivial to me.


#16

This is correct Jonathon :slight_smile:

Internet here is intermittent, so it’s difficult for me to keep up at present, but you are correct.

This is why I felt that posting my machine specs etc. wasn’t going to help. What I have gained from posting the ‘issue’ here is to clarify for myself what exactly I’m trying to achieve. What your replies (and those of others too) have done is shown me that I’m looking at the problem the wrong way around.

pavucontrol will give me output options but this is NOT what I’m trying to do. I am not trying to pipe the output from my media player into a USB sink.

I think my solution - if such exists at all - is more closely aligned to xfce4 volume control scripts? (are they scripts?).

I realise it might end up being way too complicated for something which is ultimately just a fancy bit of customisation, but that said hey - it’s Linux right? :wink:

Because I currently have two pieces of sound hardware connected i.e. my desktop speakers with their own dedicated volume control (and thus no part at all of my OS), AND the USB volume control knob, which I note is using the same bindings as for keyboard volume control, for any potential solution I would:

obviously back up any files first. Then I could happily reconfigure the entire shebang so that my USB control knob - effectively the keyboard volume control system inside xfce - will ONLY affect my media player, since of course the master volume levels would be controlled via the speakers with their own control knob, thus entirely outside of the OS.

I hope that explanation is sufficiently clear. I struggle to be concise, which is why I sometimes err on the side of brevity.