Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linuxaudio [2015/05/20 01:35]
slackermedia
linuxaudio [2021/06/03 19:48] (current)
Line 1: Line 1:
-[[{arrowp.png|border:​0;​background:​none;​width:​0;​display:​inline-block;​position:​absolute;​top:​0;​left:​0;​}user|]] 
  
-[[{arrown.png|border:​0;​background:​none;​width:​0;​display:​inline-block;​position:​absolute;​top:​0;​margin-left:​2.5em;​}pkg|]] 
  
  
  
 ====== Understanding Linux Audio ====== ====== Understanding Linux Audio ======
 +
 +<WRAP info>
 +**TL;DR** \\
 +  -Identify Physical Devices
 +  -Identify Sound Cards
 +  -Map Sound Devices to their Controls
 +  -Set Up Kmix
 +</​WRAP>​
  
 Traditional Linux (such as Slackware, and as opposed to something more progressive like [[http://​redhat.com|Red Hat]] and [[http://​getfedora.org|Fedora]]) deals with audio in its own unique way. This can be confusing to new users, or to experienced users who have never thought about it. It confuses people because almost no where in the audio schema is there a one-to-one mapping; you must think of audio processing in the computer as a series of rivers or streams, flowing from one or two sources internally, branching off one other for adjustment, and then re-joining at the end to deliver sound in the physical world. Traditional Linux (such as Slackware, and as opposed to something more progressive like [[http://​redhat.com|Red Hat]] and [[http://​getfedora.org|Fedora]]) deals with audio in its own unique way. This can be confusing to new users, or to experienced users who have never thought about it. It confuses people because almost no where in the audio schema is there a one-to-one mapping; you must think of audio processing in the computer as a series of rivers or streams, flowing from one or two sources internally, branching off one other for adjustment, and then re-joining at the end to deliver sound in the physical world.
Line 108: Line 114:
 type plug type plug
 slave.pcm "​dmix"​ slave.pcm "​dmix"​
 +}
 </​code>​ </​code>​
  
Line 121: Line 128:
 The reason for this, again, is that there is no 1:1 map between sound ports and the software that uses them. For example, one headphone and one stereo speaker output affords the opportunity to control //at least// (1) the headphone volume, (2) the speaker volume, and (3) all output (both the headphone and speaker) together: three controls for two physical outputs (that'​s without considering users who want left and right channels on separate controls). Take that example and apply it to a surround sound setup, and you begin to see the complexity of what is offered to a user. The reason for this, again, is that there is no 1:1 map between sound ports and the software that uses them. For example, one headphone and one stereo speaker output affords the opportunity to control //at least// (1) the headphone volume, (2) the speaker volume, and (3) all output (both the headphone and speaker) together: three controls for two physical outputs (that'​s without considering users who want left and right channels on separate controls). Take that example and apply it to a surround sound setup, and you begin to see the complexity of what is offered to a user.
  
-Since Slackermedia cannot know your requirements,​ it's up to you to determine your ideal control scheme, but the first step is to understand which volume slider controls which sound port. The most efficient way to investigate this is ''​alsamixer''​+Since Slackermedia cannot know your requirements,​ it's up to you to determine your ideal control scheme, but the first step is to understand which volume slider controls which sound port. The most efficient way to investigate this is ''​alsamixer''​, which, unlike ''​Kmix''​ displays, for better or for worse (and for this use, it's better) every possible volume slider all in one screen.
  
 +{{ :​alsamixer.png?​direct&​666 |}}
  
 +To begin, set up your speakers as you intend to use them, and have headphones (or something with a 1/8" (3.5mm) audio jack) on hand. Press ''​F6''​ on your keyboard to select the audio card you want to control and select the appropriate card.
  
 +{{ :​alsamixerselect.png?​direct&​666 |}}
  
 +Launch ''​System Settings''​ from the ''​K-Menu''​ and navigate to the ''​Multimedia''​ panel. In the ''​Multimedia''​ panel, promote the card that you want to use as default to the top of the list on the right, and click the ''​Test''​ button at the bottom of the panel. The ''​Test''​ button plays a sound that should be audible when you raise the volume of the appropriate device.
  
 +{{ multimediaav.png }}
  
-## launch alsamixer 
-Select appropriate card... 
-Your goal is to find the valid sound outputs. Select an output, play the test sound. Repeat until you cycle through them all. 
-When you find a good one, leave its volume high. When you find one that does nothing, lower its volume. 
-Once finished, you have a map of known useful sound outputs and apparently-useless sound outputs. 
  
 +<WRAP important>​
 +If you are not sure what device to promote to the top, check the output of ''​aplay -l''​ again. In this example, notice that the default analog ''​card0''​ listed by ''​aplay -l''​ is  ''​ALC887-VD Analog'',​ and the port promoted in the ''​Multimedia''​ panel is the same.
 +</​WRAP>​
  
-## Set Sound Preferences +Using the ''​left'' ​and ''​right''​ arrow keys to navigate to each control, the ''​up''​ and ''​down''​ arrow keys to raise or lower the volumeand the ''​m''​ key to mute or unmute the device, see which volume slider effects which device
-Now let KDE know about your preferences. Go to KDE System Settings > Multimedia > Audio and Video Settings +
-There are many backend optionsbut MPlayer is probably ​the best. After you set ittest your sound again to make sure this backend works as expected.+
  
 +==== Goal ====
  
-## Finally go to KMix and open it. +Your goal is to determine what volume slider (by name) affects each sound output that you intend to use on a regular basisas well as what volume slider controls //groups// of devices (ie, unless you are a DJ, you may never have a need for separate volume control for speakers and headphones).
-Filter out all of the sound outputs ​you don't need. More or lessthey useful ones should match the names in alsamixer.+
  
-The PCM device ​is an umbrella over all the sound on the card. So if you want ONE volume ​control to control BOTH speaker and headphonethen it's PCM that you are looking for. Set PCM as the volume ​control in Settings ​ > Select Master Channel. Confusinglythis is different from the channel called MASTER that many cards have. Really ​it's selecting the CONTROL channel.+<WRAP alert> 
 +It seems obvious, but is easily forgotten in the moment: when you find a volume ​slider that affects a deviceleave the volume ​**up**or else you will have lowered ​the sound stream and it will seem like no other slider works. 
 +</​WRAP>​
  
-If you want control over headphone and speaker volume separatelythen leave in separate ​controls ​in KMix.+Press the ''​F4''​ key to switch from Playback (output) to Capture (input)and repeat the same process to determine ​controls ​for your input devices (microphones).
  
-If you have more than just a few speakers, then leave lots of controls in Kmix. It's all up to you. 
  
 +==== Combined Port Exceptions ====
  
 +If you found, when you were assessing the physical ports, an audio port that served both as an output and input ports, you must pay special attention to the mute status of the capture device; if the capture device is **muted**, then the audio port will **not** work as a capture device but it //will// work as a playback device. If it only is muted as a playback device, then it will not work for output, but the input will work. In other words, you will //think// that you have unmuted the port, but you will forget that you have unmuted it for one purpose and not the other.
  
 +===== 4. Set Up Kmix =====
  
 +At this point, you have identified the ports-to-controls on your system, so you could potentially stop here. However, ''​alsamixer''​ may not be convenient for you, so if you prefer total desktop integration,​ configure the ''​Kmix''​ application in your system tray.
  
 +{{ kmixsystray.jpg }}
  
-[[{arrown.png|border:​0;​background:​none;​width:​0;​display:​inline-block;​float:​right;}pkg|]][[{arrowp.png|border:​0;​background:​none;​width:​0;​float:​right;​}user|]]+To configure ''​Kmix'',​ click the speaker icon in your system tray and then click the ''​Mixer''​ button at the bottom of the drop down panel. 
 + 
 +{kmixexample.png }}  
 + 
 +When the default configuration of Kmix appears, click the spanner button in the lower right corner of the window.  
 + 
 +{{ kmixlist.png ​}
 + 
 +In the list of available devices that appears, move over any controls (the names should match those from ''​alsamixer''​) to which you want quick access. Verify that they work as expected. 
 + 
 +To select what control you want to use as the systemwide master volume level, click on the **Settings** menu and select the **Select Master Channel** option. Set the master channel to whatever volume slider it is (usually it is labeled ''​Master''​ or ''​PCM''​) that controls all devices, or if you have other needs, then set it to whatever device you want immediate, default control over. 
 + 
 +{{ kmixfinal.png }} 
 + 
 +If you only want one volume slider to control you entire system'​s sound, then use only the **Master** channel slider in the ''​Kmix''​ interface. Doing this does not mean you have no control over other devices, it only means that you will have instant access to the master channel control. 
 + 
 +==== Capture ==== 
 + 
 +If you use the microphone on your system frequently, then add the appropriate Capture channel to ''​Kmix''​ as well. 
 + 
 +<WRAP alert> 
 +Take care not to leave the capture device in an unmuted state; many recordings have been compromised because a user has left both their inbuilt microphone and their outboard microphone active. 
 +</​WRAP>​ 
 + 
 +==== Hijack ==== 
 + 
 +If you want to record everything you hear from your computer speakers from a system-wide perspective,​ refer to [[parecord|parecord]] 
 + 
 +===== Outboard Gear ===== 
 + 
 +You now have a configured system, and hopefully you understand your computer'​s sound system better than ever. If you use outboard gear, like a sound interface or a USB microphone, then those will just appear in ''​Kmix''​ as additional streams to control. From ''​Kmix'',​ you'll be able to mute, add and lower levels, and the presence of the devices will be fairly obvious since they are additional peripherals to the self-contained system that you have just analysed. 
 + 
 +The KDE desktop itself will warn you when outboard devices cannot be found. These warnings are safe to ignore, or to deactivate. Outboard gear is dynamically handled, 
 + 
 + 
 + 
 +<WRAP centeralign>​ 
 +<wrap fa>[[user|R]]</​wrap>​ <wrap fa>​[[start|S]]</​wrap>​ <wrap fa>​[[audiotrouble|Q]]</​wrap>​ 
 +</​WRAP>​