Editor's Note: Tip Top Tips is a monthly column in The PCLinuxOS Magazine. Each month, we will feature -- and possibly even expand upon -- one tip from the PCLinuxOS forum. The magazine will not accept independent tip submissions specifically intended for inclusion in the Tip Top Tips column. Rather, if you have a tip, share it in the PCLinuxOS forum's "Tips & Tricks" section. Your tip just may be selected for publication in The PCLinuxOS Magazine.
This month's tip comes from PCLinuxOS forum member Bertha 1885.
This is a back to basics instruction for Linux Newbies who are having difficulty getting sound to work in their new install. (Editor's Note: BUT, this systematic information is sound for anyone having difficulties in setting up their sound on their new install.)
There are a large number of reasons as to why help at this very basic level has become necessary, but while that is outside the scope of this article, I consider it helpful to briefly explain a general scenario so that the reason for presenting this basic instruction in getting sound to your speakers is better understood.
When I first started dabbling with Linux and the many distros available, it soon became clear that those which worked 'out of the box' were the ones of most interest, and PCLinuxOS stood out as being the most complete and easily understood system. I had never regretted that choice until I installed the KDE 64bit version on my HP desktop machine, whereupon I had no sound to my two desktop speakers.
However, an oldish Dell laptop with the same 64bit OS installed at the same time, did have sound.
Then followed many frustrating months of reading, searching, asking and the more research I did, the more complicated and frustrating the situation became. Everything I came across was seemingly written for audiophiles or software developers or geeks who do everything in a Terminal.
The situation is further compounded by the fact that the process of getting sound from that music file on your hard drive to your speakers is controlled not by one program, but by no less that four programs that are all intertwined and interdependent upon each other. That subject alone could fill a book, but all we want is to get some sound from our speakers! The complexity of the four programs can, with complete confidence, be left to your Linux OS, that being its mission in life. The simplest way for a newbie to know what the programs are and how to use them is by seeing them in action, hence this pictorial presentation.
Thus far, I have used a general term "Sound." Now we need to be more specific, because it is the Program "PulseAudio" which is used in the majority of Linux Distros and (if you use a KDE desktop), this is the program that links the other three -- Alsamixer, Phonon and KMix -- which together, deliver sound to your speakers.
Here are the four programs opened on the KDE desktop.
KMix: The only program with a task-bar icon is KMix, opened by clicking the speaker icon (bottom right) and the lower right window is showing KDE Mixer -- Playback Devices.
Phonon: Right click on that same speaker icon and select Audio Setup, and you are presented with the Phonon Settings window (lower left) labeled KDE Control Module. (NB: opening KMix from the menu only shows KDE Mixer).
Alsamixer: Is opened by entering alsamixer in a (User) Terminal window, which then shows the Alsamixer GUI seen top left.
PulseAudio: This is opened by going to Menu -- Sound -- Pulseaudio Volume Control which then shows the window at top right which is showing Playback.
You will immediately see three of these windows have volume controls. Which to use!? Which indeed!
But let's not worry about such detail at this stage.
You will also see that all four programs are showing the sound card, which on this computer, is a SB Audigy 2 ZS. Since it is the only sound card in the machine, one should be able to assume that the system has recognized and will use the card. However, that is not necessarily the case.
The all important program here is Alsamixer, where we must check that the sound card is selected.
Fortunately all the alsamixer instructions are listed on the screen and items controlled by means of the arrow keys on your keyboard (it also helps if you are not colour blind).
To select the required Sound Card in Alsamixer, press F6, which then shows a list of your sound cards which can be selected by the use of the arrow keys and the Enter key. When you press enter, the screen may, or may not, change to show you all the inputs/outputs, etc.
However, the fact that you have selected your required sound card does not mean that Alsamixer will remember your choice over a reboot. To ensure that it does, we have to go to PulseAudio Volume Control and open the Output Devices window.
At the top of the window is listed the card, SB Audigy, and over to the right at the same level, the last button has a green centre with a checkmark. Hover the mouse pointer over this button and a drop down menu says Set as Fallback. Now on both my machines there is no indication that anything has happened when you toggle this switch. So the only way to know if your settings have been retained over a reboot is to -- reboot and check.
The next important setting is the Configuration Tab in PulseAudio Volume Control (seen above), where you select your required 'profile' to match your soundcard and speakers.
At the right hand side of the line showing the Profile is a small arrow. Click, and a drop down menu lists all the available profiles, click on that required and the menu closes automatically.
If, as in my case, you select the wrong profile (you might select Analog Out, whereas your speakers are physically plugged into Digital Out on the card), then PulseAudio will likely crash.
Never fear, it is easy to get it back by deleting the contents of two hidden folders in the user account.
Open your File Manager, check that it is set to show Hidden File, and delete the contents of /home/user/.pulse/ and /home/user/.config/pulse/. Now, even that is not so straightforward as it may seem. On my own two computers, I have to arrive at those hidden files in a different way, because for some reason I have not yet figured out, my desktop has user listed as being above Home! But, if PulseAudio Volume Control runs, the files will be there.
When you restart PulseAudio Volume Control, the files will be re-generated and the program will open.
Now open alsamixer again. Ignore the window that comes up and press F6, to again show the list of Sound Cards, and again select your card because alsamixer will likely highlight the Default. Once selected, the window will change to reveal all of your speakers and their volume controls, and it is in this window that you need to select the volume levels required.
Once set in this window, the levels will be repeated in all other windows showing volume controls.
You will likely now want to do a Speaker Placement and Testing check. This is found by righ clicking on the KMix speaker icon in your desktop taskbar and selecting Audio Setup/Audio Hardware Setup, whereupon you will be presented with this screen.
Having got this far and having seen all of the programs involved in getting sound to your speakers, you can now have endless fun configuring Sound in PCLinuxOS.
To learn more or to become much more confused read the following:
PulseAudio the Default Sound System
PulseAudio is the default sound system in many modern Linux desktop distributions, such as Ubuntu.
In PulseAudio, programs that play sound create playback streams (also known as input streams). For example, you might have VLC playing a video, and it's sound would be a playback stream.
To actually hear the sound, a sink (also known as output device) such as a speaker or headphones are needed. For example, you might hear the sound of your video from your laptop speakers.
The above is an extract from an article by Tero Karvinen and is of value because for over 70 years I thought that a sink was something to be used while washing! But more to the point is the fact that while searching the web for information it is essential to use the correct terms if you want to get meaningful focused answers. http://terokarvinen.com/2015/volume-control-with-pulseaudio-command-line-tools
The next article of considerable interest is from TuxRadar magazine (2010) -- but do read all of it, especially the comments by Anonymous Penguin. As I see it, the problems are not the complexity of the programs, but the way they are presented to the beginner, who, at first, is only interested in getting some sound out of the speakers. http://tuxradar.com/content/how-it-works-linux-audio-explained
Askubuntu has lots of information, if you are already very familiar with the command line, which is probably unlikely for many new converts to Linux.
There is a comprehensive PulseAudio Troubleshooting Guide on Arch Linux, which is of value once you have reached a level of familiarity with the program.
Another troubleshooting guide with some practical and sensible suggestions, but again, the author presumes that the reader has fluency with use of the command line.