Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
alsa: need suggestions to separate volume control of apps
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
taskman
n00b
n00b


Joined: 29 Nov 2018
Posts: 37

PostPosted: Thu Mar 07, 2019 3:38 am    Post subject: alsa: need suggestions to separate volume control of apps Reply with quote

hi,

atm I am using dmix to output sound streams of several apps at once via one sound device.
But the volume of each app variables and sometimes I can not hear all at once.
The sound of www-client/surf is so quiet when watching documentations and at the same time listen to msuic via mpg123, for example.

My goal is to have/make a volume control center, so I can manipulate the volume of each app on its own.
Most of the time I will use a web browser, a music/media player and qemu, all at once.
All my sound is put to S/PDIF.

Alsamixer doesn't support volume control of each app by default.
I cant even change the master volume (I think its because of S/PDIF output).
Maybe I have to setup softvol ?
Is is possible to build softvol via alsa and control each app via alsamixer ?
Or do I need something like jack support, or audio tools like ardour ?
Sometimes I also like to capture streams sparately.

What are your thoughts on this ?
Hope you guys have some suggestions.

Here is my ~/.asoundrc if needed.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7160
Location: almost Mile High in the USA

PostPosted: Thu Mar 07, 2019 4:37 am    Post subject: Reply with quote

This is one of the features of pulseaudio, which doesn't need dmix to allow multiple applications to use the sound devices, switch between sources and sinks, and independent per-application volume control (both record and playback) that's done outside of the application (i.e. handled by pulseaudio). It works fairly well for me.

If you want to continue using dmix, I suspect an API change is needed if you want to add a volume multiplier for each source, that could also be done...
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
taskman
n00b
n00b


Joined: 29 Nov 2018
Posts: 37

PostPosted: Thu Mar 07, 2019 12:42 pm    Post subject: Reply with quote

I had some problems with pa on my other computer, so this time I switched to alsa instead.
The sound drivers are the same on this computer, so I bet pa will give me the same headache.

for example:
Rosegarden doesn't like it, so I had to gave up using it.
PA has problems using s/pdif in combination with front and rear audio jack for mic and headset,
and I had to use alsa too to get all working at once.

But to be honest, I had this problems while using debian back in the days.

Ok, this time my headset connects over bluetooth and my mic connects via usb, this could be working with pa only.
But it means I will gave up on front and read audio jacks again and I have to use s/pdif, usb and bluethooth only.

Are there no other options ?
Back to top
View user's profile Send private message
Leio
Developer
Developer


Joined: 27 Feb 2003
Posts: 487
Location: Estonia

PostPosted: Thu Mar 07, 2019 2:18 pm    Post subject: Reply with quote

I don't understand what kind of configuration you require from s/pdif, as I've never used that, etc, but pulseaudio also supports various configuration via module parameter, extra modules and so on. So if you look and learn, I bet what you need can be done, just not working out of the box. But alsa is manual configuration for everything besides the simplest case, so doesn't sound like something that you can't handle with PA config.
_________________
GNOME team lead; GStreamer; MIPS/ARM64
Back to top
View user's profile Send private message
taskman
n00b
n00b


Joined: 29 Nov 2018
Posts: 37

PostPosted: Thu Mar 07, 2019 2:45 pm    Post subject: Reply with quote

eccerr0r wrote:
If you want to continue using dmix, I suspect an API change is needed if you want to add a volume multiplier for each source, that could also be done...

I looked at the API, but I find C code only and I am not C aware.
looks like i have to use pa again :cry:

anyway, thanks for the advice.


Leio wrote:
I don't understand what kind of configuration you require from s/pdif, as I've never used that, etc, but pulseaudio also supports various configuration via module parameter, extra modules and so on. So if you look and learn, I bet what you need can be done, just not working out of the box. But alsa is manual configuration for everything besides the simplest case, so doesn't sound like something that you can't handle with PA config.

yeah, atm I am looking at https://gavv.github.io/articles/pulseaudio-under-the-hood/ .
also I found a keaboard driven UI called pactl (me like).

I will give it a shot.
thanks.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7160
Location: almost Mile High in the USA

PostPosted: Thu Mar 07, 2019 4:32 pm    Post subject: Reply with quote

When I first found pavucontrol for pulseaudio, I was hooked -- alsa is now only used as a low level hardware transport and I don't need dmix anymore (which was an old "killer" application that was annoying in the OSS days).

pavucontrol is a GUI that you can set the volume, both record and playback, for each pulseaudio application. So even if a particular application does not have a volume control, you can mute it with pavucontrol.

Not only that, you can see in the GUI which applications are recording, and you can plug the ears of those too.

The only thing I'm not sure about is if an application repeatedly opens and closes a particular pulseaudio connection, whether a volume setting remains... I think it does, but not sure. But I'm asking too much, having the capability to control the volume per application is something that was badly desired.
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
taskman
n00b
n00b


Joined: 29 Nov 2018
Posts: 37

PostPosted: Fri Mar 08, 2019 8:47 pm    Post subject: Reply with quote

I have pa runnig and pavucontrol I am using too.
But I haven't tested all jet.

I had already some problems with libcanbarra.
but after I enable all sound sources it worked.
Code:
[~] equery uses media-libs/libcanberra
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-libs/libcanberra-0.30-r5:
 U I
 - - abi_x86_32 : 32-bit (x86) libraries
 + + alsa       : Enables ALSA sound driver.
 - - gnome      : Add GNOME support
 + + gstreamer  : Enables gstreamer sound driver. Not useful when alsa or pulseaudio is available.
 - - gtk        : Enables building of gtk+ helper library, gtk+ runtime sound effects and the canberra-gtk-play utility. To enable the gtk+ sound effects add canberra-gtk-module to the colon separated list of modules in the GTK_MODULES environment variable.
 + + gtk3       : Enables building of gtk+3 helper library, gtk+3 runtime sound effects and the canberra-gtk-play utility. To enable the gtk+3 sound effects add canberra-gtk-module to the colon separated list of modules in the GTK_MODULES environment variable.
 - - oss        : Add support for OSS (Open Sound System)
 + + pulseaudio : Enables PulseAudio sound driver that should be able to support positional event sounds. This is the preferred choice for best sound events experience and picked by default if compiled in and possible to use at runtime.
 + + sound      : Install x11-themes/sound-theme-freedesktop to get sounds on Gnome and Xfce.
 - - tdb        : Enables Trivial Database support for caching purposes.
 + + udev       : Enable virtual/udev integration (device discovery, power and storage device support, etc)

It works for now, but the desciption stated that I should not mix sound devices.
Missing one flag and my sound is gone (USE="alsa gstreamer pulseaudio sound udev").
udev depends on alsa, and www-client/surf depends on gstreamer.

I will see how things work out when adding headset, mic and qemu.
but for the moment it does its job.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum