edit Getting ALSA to work
alsamixer
edit Make your audio card the default ALSA cardSometimes 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 add
boot.extraModprobeConfig = ''
options snd slots=snd-hda-intel
'';
to your /etc/nixos/configuration.nix. Alternatively you can ... edit Disable PC Speaker "audio card"edit /etc/nixos/configuration.nix and add "snd_pcsp" to boot.blacklistedKernelModules option: boot.blacklistedKernelModules = [ "snd_pcsp" ]; Now reboot and retry from the beginning (i.e. check that your real card is shown by alsamixer without using the 'S' key). edit Other hardware specific problemsSome hardware specific problems can be resolved by adjusting the options for the sound module. For example, the microphone may be stuck on an unusably 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 (I have twice overlooked the mute button on laptops!). You should be able to look up the available options for model in HD-Audio-Models.txt. You can try them out interactively as follows:
Once you have found a setting that works, you can add it to your configuration file:
boot.extraModprobeConfig = ''
options snd-hda-intel model=YOUR_MODEL
'';
Much of this is taken from https://help.ubuntu.com/community/HdaIntelSoundHowto which also has additional tips. edit Fixing sound in KDE (is this now obsolete? 2011/08)'(alsamixer shows my audio card by default, but i get no sound in KDE)
After this step you should be seeing xine and gstreamer backends in the systemsettings / Computer Administration / Multimedia 's Backends tab.
$ rm -rf ~/.pulse/* $ killall5 -9 pulseaudio
Now you should be able to select your audio card, default hw0,0 etc as your audio device in systemsettings / Computer Administration / Multimedia Test the audio and enjoy the relaxing KDE's arpeggio. edit Enabling PulseAudioIn your config file: hardware.pulseaudio.enable = true You can check if everything works by using pavucontrol to see the audio streams and to make sure that PulseAudio detects your audio hardware. You may need to add your users to the audio group: $usermod -a -G audio myusername If a user is not a member the audio group only a dummy device will appear in pavucontrol. The following command should only show that pulseaudio (and nothing else) is using the sound devices, if you see something like "plugin-container" in the COMMAND column then something is definitely not right, perhaps you have a local ~/.asoundrc which overrides the global alsa settings?. $ 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 pulseaudi 14080 goibhniu 37u CHR 116,7 0t0 5169 /dev/snd/controlC0 edit Using JACK with PulseAudioJack Audio Connection Kit is used by most of the serious audio applications on Linux. It provides real-time, low latency connections for both audio and MIDI data between applications that implement its API. NixOS uses the dbus version of JACK2 (jackdbus). This can be used together with pulseaudio with a little configuration. The result is that you don't have to manually hunt down applications which are using the sound device and kill them before starting JACK. You can also continue to use non-JACK aware applications (e.g. flash) at the same time as using JACK applications (e.g. Ardour).
You should now be able to start JACK with QjackCtl, you will notice a new playback and capture device in your sound mixer along with your normal devices. edit Troubleshooting JACK and PulseAudio$ pactl load-module module-jack-sink channels=2 Failure: Module initalization failed Check if you have previous settings in ~/.config/jack/conf.xml. Try renaming this file and running the pactl command again. Otherwise, you may get further info by disabling PulseAudio respawning (see above) and starting it in verbose mode: $ pulseaudio -vvv |