On my NixOS system, I can get audio through my headphones, but not through my speakers.
Basic checks:
- Speakers work on another machine
- Speakers are plugged in and turned on
- Headphones are unplugged when using speakers
# nix-channel --list | grep nixos
nixos https://nixos.org/channels/nixos-20.03
Sound is enabled.
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
My user account is in the audio
group.
users.users.amy = {
isNormalUser = true;
home = "/home/amy";
description = "Amy de Buitleir";
extraGroups = [ "wheel" "networkmanager" "vboxsf" "docker" "audio" ];
uid = 1000;
};
$ cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version k5.4.67.
$ cat /proc/asound/cards
0 [Generic ]: HDA-Intel - HD-Audio Generic
HD-Audio Generic at 0xfa200000 irq 113
1 [Headphone ]: USB-Audio - Aorus Master Front Headphone
Gigabyte-Aorus-Master-Front-Headphone
2 [Generic_1 ]: HDA-Intel - HD-Audio Generic
HD-Audio Generic at 0xe1ca0000 irq 115
3 [Audio ]: USB-Audio - Aorus Master Main Audio
Gigabyte-Aorus-Master-Main-Audio
$ lsmod | grep snd
snd_hda_codec_hdmi 69632 1
snd_usb_audio 262144 5
snd_hda_intel 49152 2
snd_intel_nhlt 20480 1 snd_hda_intel
snd_usbmidi_lib 32768 1 snd_usb_audio
snd_rawmidi 40960 1 snd_usbmidi_lib
snd_seq_device 16384 1 snd_rawmidi
snd_hda_codec 135168 2 snd_hda_codec_hdmi,snd_hda_intel
mc 49152 1 snd_usb_audio
snd_hda_core 86016 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_hwdep 16384 2 snd_usb_audio,snd_hda_codec
snd_pcm_oss 65536 0
snd_mixer_oss 28672 1 snd_pcm_oss
snd_pcm 106496 7 snd_hda_codec_hdmi,snd_hda_intel,snd_usb_audio,snd_hda_codec,snd_pcm_oss,snd_hda_core
snd_timer 36864 1 snd_pcm
snd 86016 25 snd_seq_device,snd_hda_codec_hdmi,snd_hwdep,snd_hda_intel,snd_usb_audio,snd_usbmidi_lib,snd_hda_codec,snd_timer,snd_pcm_oss,snd_pcm,snd_rawmidi,snd_mixer_oss
soundcore 16384 1 snd
usbcore 270336 6 xhci_hcd,snd_usb_audio,usbhid,snd_usbmidi_lib,btusb,xhci_pci
aplay
reports no errors, but I don’t hear anything unless I have the headphones plugged in.
$ aplay -vv test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 11025 Hz, Mono
ALSA <-> PulseAudio PCM I/O Plugin
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 1
rate : 11025
exact rate : 11025 (11025/1)
msbits : 16
buffer_size : 5513
period_size : 1378
period_time : 125000
tstamp_mode : NONE
tstamp_type : GETTIMEOFDAY
period_step : 1
avail_min : 1378
period_event : 0
start_threshold : 5513
stop_threshold : 5513
silence_threshold: 0
silence_size : 0
boundary : 6207086186423386112
### + | 72%^C
Aborted by signal Interrupt...
Likewise, speaker-test
reports no errors, but I don’t hear anything unless I have the headphones plugged in.
$ speaker-test -twav
speaker-test 1.2.1
Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 192 to 2097152
Period size range from 64 to 699051
Using max buffer size 2097152
Periods = 4
was set period_size = 524288
was set buffer_size = 2097152
0 - Front Left
Time per period = 1.481250
0 - Front Left
Time per period = 1.483892
0 - Front Left
Time per period = 1.484287
0 - Front Left
^CTime per period = 1.482327