Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.