Even if speakers are plugged in, Sometimes Fedora does not recognize speakers.
My approach
When it does not recognize speakers dmesg errors are these:
┌───── arctrus
│~
└─> dmesg --level=err
[ 5.901755] kfd kfd: amdgpu: Failed to resume IOMMU for device 1002:15dd
[ 5.902111] kfd kfd: amdgpu: device 1002:15dd NOT added due to errors
[ 9.379206] usb 3-3: 3:1: cannot get freq at ep 0x84
[ 9.388945] snd_hda_intel 0000:06:00.1: cannot find the slot for index 0 (range 0-0), error: -16
[ 9.388952] snd_hda_intel 0000:06:00.1: Error creating card!
[ 9.389019] snd_hda_intel 0000:06:00.6: cannot find the slot for index 0 (range 0-0), error: -16
[ 9.389022] snd_hda_intel 0000:06:00.6: Error creating card!
[ 22.452381] usb 3-3: 3:1: cannot get freq at ep 0x84
[ 22.523003] usb 3-3: 3:1: cannot get freq at ep 0x84
When it does recognize speakers dmesg errors are these:
┌───── arctrus
│~
└─> dmesg --level=err
[ 5.858706] kfd kfd: amdgpu: Failed to resume IOMMU for device 1002:15dd
[ 5.859062] kfd kfd: amdgpu: device 1002:15dd NOT added due to errors
[ 9.269910] usb 3-3: 3:1: cannot get freq at ep 0x84
[ 21.751053] usb 3-3: 3:1: cannot get freq at ep 0x84
[ 21.789304] usb 3-3: 3:1: cannot get freq at ep 0x84
Temporary Solution
I reboot fedora as many times it takes to get fedora to recognise the speakers.
I mean, Sometimes it works after a single reboot , but sometimes it takes multiple reboots.
And when it does, I start using my pc.
FWIW, there appears to be a similar report here where a mix of sound devices using snd-usb-audio (a webcam) and internal sound devices using the snd_hda_intel driver results in the correct sound device not being detected.
I viewed the report mentioned by @glbhere.
I ran the same investigations which Randragon ran: During these commands, Fedora does not recognise the speakers.
sudo dmesg | grep snd
┌───── arctrus
│~
└─> sudo dmesg | grep snd
[sudo] password for arctrus:
[ 8.985846] snd_hda_intel 0000:06:00.1: cannot find the slot for index 0 (range 0-0), error: -16
[ 8.985854] snd_hda_intel 0000:06:00.1: Error creating card!
[ 8.985902] snd_hda_intel: probe of 0000:06:00.1 failed with error -16
[ 8.985914] snd_hda_intel 0000:06:00.6: cannot find the slot for index 0 (range 0-0), error: -16
[ 8.985916] snd_hda_intel 0000:06:00.6: Error creating card!
[ 8.985918] snd_hda_intel: probe of 0000:06:00.6 failed with error -16
[ 8.999304] usbcore: registered new interface driver snd-usb-audio
aplay -lL
┌───── arctrus
│~
└─> aplay -lL
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault
Default Audio Device
pipewire
PipeWire Sound Server
default
Default ALSA Output (currently PipeWire Media Server)
**** List of PLAYBACK Hardware Devices ****
Is that /etc/modprobe.d/alsa-base.conf file something you added at some point? If so, you might try removing it. It may be that that setting was required for a previous version of the Linux kernel but it is no longer required for the current kernel.
(Actually, on closer inspection, it looks like that file is broken in such a way that it probably isn’t doing anything anyway.)
Run the following command to see if any other files contain configuration settings for sound drivers.
grep '\bsnd' /etc/modprobe.d/*
If there aren’t any other files containing conflicting settings, the following file might help (based on that earlier link where someone reported that giving index hints for the driver would help to resolve this problem).
Are you telling me to edit alsa-base.conf and erase whatever’s in there and put options snd cards_limit=3 options snd_hda_intel index=-1,-2 options snd_usb_audio index=-3 in there ?
Yes. You can also remove /etc/modprobe.d/alsa.conf. I do not believe either of those existing files were actually doing anything because the options are being applied to snd-intel-{intel,dspcfg} (the driver names should have _, not -).
Edit: Also, it is important that each options ... setting be on its own line.
There is not really enough context to say exactly what that notice means. But “irq” stands for interrupt request and a handler is a bit of computer code that would respond to such a request. The different devices in your PC “run” independently of your computer’s CPU and, when they have some new information to be copied to system memory (e.g. a bit of sound that has been detected on the microphone line), the device raises an “interrupt” line (on older computers it was a separate wire for each device that was connected to the CPU). When the CPU sees that a device has new data to be transferred somewhere, it temporarily pauses whatever else it is doing and switches to the task of copying the data. That notice isn’t necessarily important. It essentially means that there is a “wire” that isn’t connected to anything. But the wire might not be an important one.
Today, I got a Over-the-ear headphone with mic attached to it. In Windows, the headphones was auto-configured at a volume level below 100, So I pushed it up to 100. I also feel like it is auto-configured to be below 100 in fedora too. Is there a way to do it fedora also ?
(I don’t understand alsamixer 's interface)
I think the line that is most likely to cause a problem would be the first line – options snd cards_limit=3. I’d remove that line and reboot to see if that fixes it. Otherwise, I don’t know.
At last, I removed both alsa files.
Now, to fix the issue, I change the configuration of the sound device.
Switching to any configuration fixes the issue and sound starts coming.
Since the problem appears to be in the hardware drivers (snd_hda_intel and snd_usb_audio), potential fixes will come with new versions of the “kernel” packages. Other than that, some hardware works better than others. Ideally, you want to purchase a PC that is certified by the hardware vendor to work well with Linux. As a last resort, some people will buy cheap (~$7) usb audio cards that are known to work with Linux (e.g. I have one of these Sabrent external stereo sound adapters and it works well with Fedora Linux).
P.S. If you can disconnect or disable your webcam in your PC’s firmware/bios, that might help.
If it worked correctly recently, it may be that a recent kernel update is the cause of the problem. In that case, you might be able to get it working again simply by selecting the older kernel when you boot your PC. (I think you have to hold the shift key while booting to get the menu with the list of installed kernels to come up.)
You might be able put something like pactl set-default-sink alsa_output.pci-0000_00... in a .sh file. But that would be a bad hack. Going back to a previous kernel would definitely be a better solution if that works.