LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-04-2011, 03:02 PM   #1
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293

Rep: Reputation: 41
pavucontrol and alsamixer


What is the relationship between alsamixer and pavucontrol (the pulseaudio volume control)? The settings in one seem to affect the other, but I haven't been able to figure out what the pattern is. (I'm running both alsa and pulseaudio.) I've also noticed that something I'm doing is setting the alsamixer front volume to zero quite often, but I don't know what. I know I'm not doing that directly.
 
Old 05-04-2011, 09:32 PM   #2
go_tux_yourself
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Rep: Reputation: 1
The best way that I can describe the difference between the two is that alsamixer is a hardware audio device mixer control, which sits on top the alsa library and communicates with hardware through kernel modules. Pulseaudio, on the other hand, is a sound system. It is used to capture sound input from various sources and redirect them to one or more sinks. Pulseaudio sits in between the kernel and library layers as illustrated by this diagram: http://en.wikipedia.org/wiki/File:Pu...io-diagram.svg

Pulseaudio is a great tool to learn (so is ALSA). Currently I use pavucontrol to record my sound output for select applications.
 
Old 05-05-2011, 10:06 PM   #3
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293

Original Poster
Rep: Reputation: 41
Some specific examples

I'm having some difficulty in applying the general model to some particular questions:

1. alsamixer lets you set the input source to internal, mic, or stereo mix. pavucontrol lets you set the source to front microphone, internal microphone, or analog microphone. So they each have three choices, which overlap but are not identical. I'm guessing that internal is the same as internal microphone and that stereo mix is the same as analog microphone. But what does it mean to set alsamixer to internal and pavucontrol to front microphone, say? Nothing prevents you from doing that.

2. On the output side, alsamixer provides headphone and front with an additional option for independent HP, while pavucontrol provides analog output and headphone output. Again, there sees to be no constraint that they match.

Addendum: A more general question is this: which level does the choice of input source belong: application layer, library layer, or pulse layer? Or is the very question somehow ill-defined?

Last edited by pwabrahams; 05-06-2011 at 03:50 PM.
 
Old 05-09-2011, 04:25 AM   #4
go_tux_yourself
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Rep: Reputation: 1
Thumbs up

The question isn't ill-defined, but it is not very easy to answer and I am not a sound system programmer. Nevertheless, I will try to shed some light on the subject from my limited experience. So excuse me if I am wrong. First thing I think it is important to realize is that Pulseaudio sits in between the library and kernel level of ALSA. Pulseaudio can use ALSA input sources (among others), but can also create virtual input/output sources and interconnect them. So there is really no indiscretion that the input sources between ALSA and Pulseaudio may not match up exactly, Pulse can create audio sources not directly available to ALSA and may not use all of the ALSA sources itself. Conversely, ALSA is a standalone audio system and does not necessarily rely on Pulseaudio to function, but has modules built into it to interconnect and function with Pulseaudio.

As for the specific examples you gave:

Remember that ALSA modules control hardware so the input sources from alsamixer are implemented in hardware.

INPUT
internal - built-in microphone (usually built in laptop mic)
mic - mini 1/8 stereo jack
stereo mix - is a recording source that uses stereo output as it input
Note: stereomix is not implemented on my laptop audio hardware so I use Pulseaudio instead
OUTPUT
front - front speakers
headphone - OK you get the point

On the Pulseaudio side you are looking at virtual input sources and mixing devices that interconnect and control the hardware sources through modules that interconnect it with ALSA

INPUT
internal microphone -> internal
front microphone -> mic
analog microphone - Probably is the equivalent of stereo mix, but I am a little unclear as this is not implemented by my hardware. Since the Pulseaudio modules communicate with ALSA you should be able to tell by adjusting the level in pavucontrol and is if the change is affected in alsamixer. I use a virtual device called [Monitor of Internal Audio Analog Stereo] to achieve stereo mixing. If you have the option, between the two I would recommend using the hardware implemented stereo mix vs the software implemented version in Pulseaudio. It should be faster, sound better and consume fewer CPU cycles.

As for my response to your last question, "Which level does the choice of input source belong: application layer, library layer, or pulse layer?". This depends on the linking and configuration of an application, and also where I get to say that the Linux sound system is a bit of a mess. There reason for this is that there many different applications/sound servers, that are linked to different libraries, that can access sound resources in different ways. For most modern systems that are configured to use Pulseaudio, requests made to ALSA are configured to be routed through Pulseaudio. This is illustrated in the diagram previously provided. Although it is possible to configure ALSA to bypass Pulseaudio and access the ALSA modules directly (as was the case before Pulseaudio was even around). Moreover, Pulseaudio can function without ALSA. It can sink with other audio sources such as OSS, RTP streams, and applications/libraries can directly access Pulseaudio (bypassing libalsa) but then ultimately be output using an ALSA module. This is also illustrated in the diagram (libao, Esound emulation).

If you are interested these are the modules responsible for the interoperation between Pulseaudio and ALSA on my system:

/usr/lib/alsa-lib/libasound_module_conf_pulse.so
/usr/lib/alsa-lib/libasound_module_ctl_pulse.so
/usr/lib/alsa-lib/libasound_module_pcm_pulse.so
/usr/lib/pulse-0.9.19/modules/libalsa-util.so
/usr/lib/pulse-0.9.19/modules/module-alsa-card.so
/usr/lib/pulse-0.9.19/modules/module-alsa-sink.so
/usr/lib/pulse-0.9.19/modules/module-alsa-source.so
 
1 members found this post helpful.
Old 05-09-2011, 01:02 PM   #5
pwabrahams
Member
 
Registered: Nov 2005
Location: Deerfield MA
Distribution: OpenSuSE, Kubuntu
Posts: 293

Original Poster
Rep: Reputation: 41
Thanks

Thanks so much for your lengthy and useful response. Your description of the relationship between pulseaudio and ALSA implies that the relationship is pretty chaotic, with a lot of overlap of function and with pulseaudio modules and ALSA modules often providing the same services. The level model in the diagram you supplied is often bypassed. So at least I know what I'm up against.

I had been looking for the information you so clearly and helpfully provided about what the internal mic is versus the unqualified mic. So for both input and output, "internal" means "built-in, without using external devices".

An extra complication is that some of this stuff is hardware-dependent, but most users (including me, unfortunately) don't know all that much about the parameters or even the identity of the hardware on their computers. This is particularly true for laptops. It's not just laziness; the laptop manufacturers don't make it easy to find that information.

The main audio-related programs I'm using are amarok, skype, audacity, alsamixer, pavucontrol, and phonon. For hardware, I have an external headphone (powered speakers, actually) and sometimes an external microphone, but I prefer to use the internal one. I also sometimes have a USB turntable connected.

I'll mention some of the things that still puzzle me:

1. The volume on Front in alsamixer is frequently pushed down to zero by some other program, but I don't know which one or why.

2. The internal microphone still seems to pick up a signal even when I only have "mic" unmuted.

3. kde sometimes tells me that audio devices are not in use and asks if I want to remove them, possibly permanently. I don't know how to answer those questions. Why would I want to remove the devices permanently? And what happens if I reconnect them? I see this with the HDA Intel: VT1708S Analog family of drivers as well as the USB Audio Codec, which appears (though usually not right away) after I connect the USB turntable.

4. phonon -- another of those "friends" who sit down to dinner at my house uninvited -- offers on the input side several choices about VT1708S analog input: hardware device with all software conversions, direct hardware device with no software conversions, or default (nothing said about the hardware device)? How can I choose intelligently?

5. alsamixer has two input controls, Capture and Capture 1, but I don't know how they relate to the other input controls in alsamixer, let alone all the other input controls floating around.

And of course all this stuff is obscurely documented or not documented at all. There are lots of audio howtos around, but they don't seem to address questions on this level.
 
  


Reply

Tags
pavucontrol, pulseaudio



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pavucontrol connection refused johnh10000 Linux - Newbie 3 04-24-2011 02:11 PM
Alsamixer puskas Linux - Hardware 11 08-06-2009 03:46 AM
alsamixer rcmayfld Linux - Software 1 03-21-2006 01:41 PM
no alsamixer chstani Linux - Laptop and Netbook 9 09-08-2005 05:08 PM
alsamixer tgkspike Linux - Software 2 05-23-2004 06:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration