ALSA: Difference between revisions
No edit summary |
m Cleaned up tone somewhat, however this page likely could do with a cleanup and reformating Tags: Mobile edit Mobile web edit Advanced mobile edit Visual edit |
||
| Line 7: | Line 7: | ||
In order to save the sound card state on shutdown sound must be enabled in <code>configuration.nix</code> | In order to save the sound card state on shutdown sound must be enabled in <code>configuration.nix</code> | ||
< | <syntaxhighlight lang="nix"> | ||
hardware.alsa.enablePersistence = true; | |||
</ | </syntaxhighlight> | ||
==Troubleshooting ALSA== | ==Troubleshooting ALSA== | ||
* on a console | * on a console launch [[wikipedia:Alsamixer|alsamixer]]. | ||
alsamixer | alsamixer | ||
* you see plenty of vertical bars | * If you see plenty of vertical bars: | ||
** | ** You should be okay | ||
* you see very few vertical bars and the sound card (top-left) is | * If you see very few vertical bars and the sound card (top-left) is "PC Speaker" or similar: | ||
** | ** Hit the 'S' key, you should be able to switch to the "real" audio card (if not your audio card is likely to not being supported yet). | ||
** | ** When the real audio card is selected you should be viewing the "plenty vertical bars" thing. | ||
*** | *** First thing to do is to disable PC speaker (kernel module "snd-pcsp", see below. | ||
=== Make your audio card the default ALSA card === | === Make your audio card the default ALSA card === | ||
Occasionally the PC-speaker is the default audio card for ALSA. You can make your real sound card default instead. For example, if your sound card is "hda-intel" then you would add the following to your configuration. | |||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
boot.extraModprobeConfig = '' | boot.extraModprobeConfig = '' | ||
options snd slots=snd-hda-intel | options snd slots=snd-hda-intel | ||
''; | ''; | ||
</syntaxHighlight> | </syntaxHighlight>At times, you may wish to disable one of multiple Intel cards. Here is how to disable the first card, but enable a second one. | ||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
boot.extraModprobeConfig = '' | boot.extraModprobeConfig = '' | ||
| Line 42: | Line 38: | ||
''; | ''; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
=== Disable PC Speaker "audio card" === | === Disable PC Speaker "audio card" === | ||
Add "snd_pcsp" to the <code>boot.blacklistedKernelModules</code> option: | |||
<syntaxHighlight lang="nix"> | <syntaxHighlight lang="nix"> | ||
| Line 57: | Line 51: | ||
=== Other hardware specific problems === | === Other hardware specific problems === | ||
Some hardware specific problems can be resolved by adjusting the options for the sound module. For example, the microphone may be stuck on | Some hardware specific problems can be resolved by adjusting the options for the sound module. For example, the microphone may be stuck on a very low volume. First you should be sure that you have already checked the settings in alsamixer to make sure nothing is muted, and also any physical buttons on your computer. | ||
You should be able to look up the available options for | You should be able to look up the available options for model in [https://www.kernel.org/doc/Documentation/sound/hd-audio/models.rst models.rst]. You can try them out interactively as follows: | ||
# Close any applications using the sound card | # Close any applications using the sound card | ||
## See if any applications are using the sound card | ## See if any applications are using the sound card | ||
##: $ lsof /dev/snd/* | ##: {{Code|$ lsof /dev/snd/* | ||
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME | |||
pulseaudi 14080 goibhniu 30u CHR 116,7 0t0 5169 /dev/snd/controlC0 | |||
## Kill | pulseaudi 14080 goibhniu 37u CHR 116,7 0t0 5169 /dev/snd/controlC0|lang=console|line=no}} | ||
## Kill any processes | |||
##: for any process apart from pulseaudio you could just do: | ##: for any process apart from pulseaudio you could just do: | ||
##: $ kill -9 14080 | ##: $ kill -9 14080 | ||
| Line 92: | Line 87: | ||
''; | ''; | ||
</syntaxHighlight> | </syntaxHighlight> | ||
[[Category:Audio]] | [[Category:Audio]] | ||