Sometime Fedora does not recognize Speakers but does after reboot

Problem

Even if speakers are plugged in, Sometimes Fedora does not recognize speakers.
Screenshot from 2023-06-11 01-49-56

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.
Screenshot from 2023-06-11 01-53-38

Question

Can it be fixed ?

Welcome to Fedora @arctrus

I think yes. We just need to know how your setup looks like.

Could you make us a inxy -Fzx and post the output here? Probably you have to install inxi.

Are the speakers connected over USB? Do you have a separate power source? Is the audio over a audio jack connected ?

Thanks! for your help @ilikelinux .
You meant inxi -Fzx

  • Currently Fedora has recognised the speakers. inxi -Fzx output is this:
┌───── arctrus 
│~ 
└─>  inxi -Fzx
12System:
  12Kernel 6.3.6-200.fc38.x86_64 12arch x86_64 12bits 64 12compiler gcc 12v 2.39-9.fc38 12Desktop GNOME 12v 44.2
    12Distro Fedora release 38 (Thirty Eight)
12Machine:
  12Type Desktop 12Mobo ASRock 12model B450M Steel Legend 12serial <superuser required>
    12UEFI American Megatrends 12v P3.60 12date 11/03/2020
12CPU:
  12Info dual core 12model AMD Athlon 3000G with Radeon Vega Graphics 12bits 64 12type MT MCP 12arch Zen
    12rev 0 12cache 12L1 192 KiB 12L2 1024 KiB 12L3 4 MiB
  12Speed (MHz) 12avg 1588 12high 1599 12min/max 1600/3500 12boost enabled 12cores 121 1582 122 1592 123 1582
    124 1599 12bogomips 27998
  12Flags avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
12Graphics:
  12Device-1 AMD Raven Ridge [Radeon Vega Series / Radeon Mobile Series] 12driver amdgpu 12v kernel
    12arch GCN-5 12bus-ID 06:00.0 12temp 54.0 C
  12Device-2 Lenovo FHD Webcam Audio 12driver snd-usb-audio,uvcvideo 12type USB 12bus-ID 3-3:2
  12Display wayland 12server X.Org 12v 22.1.9 12with Xwayland 12v 22.1.9 12compositor gnome-shell 12driver 12X
    12loaded amdgpu 12unloaded fbdev,modesetting,vesa 12dri radeonsi 12gpu amdgpu 12resolution 1920x1080~60Hz
  12API OpenGL 12v 4.6 Mesa 23.1.1 12renderer AMD Radeon Vega 3 Graphics (raven LLVM 16.0.4 DRM 3.52
    6.3.6-200.fc38.x86_64) 12direct-render Yes
12Audio:
  12Device-1 AMD Raven/Raven2/Fenghuang HDMI/DP Audio 12driver snd_hda_intel 12v kernel 12bus-ID 06:00.1
  12Device-2 AMD Family 17h/19h HD Audio 12vendor ASRock 12driver snd_hda_intel 12v kernel 12bus-ID 06:00.6
  12Device-3 Lenovo FHD Webcam Audio 12driver snd-usb-audio,uvcvideo 12type USB 12bus-ID 3-3:2
  12API ALSA 12v k6.3.6-200.fc38.x86_64 12status kernel-api
  12Server-1 PipeWire 12v 0.3.71 12status active
12Network:
  12Device-1 Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 12vendor ASRock 12driver r8169
    12v kernel 12port f000 12bus-ID 04:00.0
  12IF enp4s0 12state down 12mac <filter>
  12Device-2 Ralink MT7601U Wireless Adapter 12driver mt7601u 12type USB 12bus-ID 3-4:3
  12IF wlp6s0f3u4 12state up 12mac <filter>
  12IF-ID-1 ipv6leakintrf0 12state unknown 12speed N/A 12duplex N/A 12mac <filter>
12Drives:
  12Local Storage 12total 223.57 GiB 12used 85.9 GiB (38.4%)
  12ID-1 /dev/sda 12vendor Kingston 12model SA400M8240G 12size 223.57 GiB
12Partition:
  12ID-1 / 12size 184.1 GiB 12used 85.53 GiB (46.5%) 12fs btrfs 12dev /dev/sda3
  12ID-2 /boot 12size 973.4 MiB 12used 339.7 MiB (34.9%) 12fs ext4 12dev /dev/sda2
  12ID-3 /boot/efi 12size 598.8 MiB 12used 45.4 MiB (7.6%) 12fs vfat 12dev /dev/sda1
  12ID-4 /home 12size 184.1 GiB 12used 85.53 GiB (46.5%) 12fs btrfs 12dev /dev/sda3
12Swap:
  12ID-1 swap-1 12type zram 12size 8 GiB 12used 0 KiB (0.0%) 12dev /dev/zram0
12Sensors:
  12System Temperatures 12cpu 54.0 C 12mobo N/A 12gpu amdgpu 12temp 54.0 C
  12Fan Speeds (RPM) N/A
12Info:
  12Processes 332 12Uptime 56m 12Memory 12available 13.55 GiB 12used 3.37 GiB (24.9%) 12Init systemd
  12target graphical (5) 12Compilers 12gcc 13.1.1 12clang 16.0.4 12Packages 90 12note see --rpm 12Client Unknown
  Client: flatpak-session-helper 12inxi 3.3.27
  • Currently Fedora has not recognised the speakers. inxi -Fzx output is this:
┌───── arctrus 
│~ 
└─>  inxi -Fzx
12System:
  12Kernel 6.3.6-200.fc38.x86_64 12arch x86_64 12bits 64 12compiler gcc 12v 2.39-9.fc38 12Desktop GNOME 12v 44.2
    12Distro Fedora release 38 (Thirty Eight)
12Machine:
  12Type Desktop 12Mobo ASRock 12model B450M Steel Legend 12serial <superuser required>
    12UEFI American Megatrends 12v P3.60 12date 11/03/2020
12CPU:
  12Info dual core 12model AMD Athlon 3000G with Radeon Vega Graphics 12bits 64 12type MT MCP 12arch Zen
    12rev 0 12cache 12L1 192 KiB 12L2 1024 KiB 12L3 4 MiB
  12Speed (MHz) 12avg 2528 12high 3500 12min/max 1600/3500 12boost enabled 12cores 121 3500 122 1556 123 3500
    124 1557 12bogomips 28002
  12Flags avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
12Graphics:
  12Device-1 AMD Raven Ridge [Radeon Vega Series / Radeon Mobile Series] 12driver amdgpu 12v kernel
    12arch GCN-5 12bus-ID 06:00.0 12temp 63.0 C
  12Device-2 Lenovo FHD Webcam Audio 12driver snd-usb-audio,uvcvideo 12type USB 12bus-ID 3-3:2
  12Display wayland 12server X.Org 12v 22.1.9 12with Xwayland 12v 22.1.9 12compositor gnome-shell 12driver 12X
    12loaded amdgpu 12unloaded fbdev,modesetting,vesa 12dri radeonsi 12gpu amdgpu 12resolution 1920x1080~60Hz
  12API OpenGL 12v 4.6 Mesa 23.1.1 12renderer AMD Radeon Vega 3 Graphics (raven LLVM 16.0.4 DRM 3.52
    6.3.6-200.fc38.x86_64) 12direct-render Yes
12Audio:
  12Device-1 AMD Raven/Raven2/Fenghuang HDMI/DP Audio 12driver N/A 12bus-ID 06:00.1
  12Device-2 AMD Family 17h/19h HD Audio 12vendor ASRock 12driver N/A 12bus-ID 06:00.6
  12Device-3 Lenovo FHD Webcam Audio 12driver snd-usb-audio,uvcvideo 12type USB 12bus-ID 3-3:2
  12API ALSA 12v k6.3.6-200.fc38.x86_64 12status kernel-api
  12Server-1 PipeWire 12v 0.3.71 12status active
12Network:
  12Device-1 Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 12vendor ASRock 12driver r8169
    12v kernel 12port f000 12bus-ID 04:00.0
  12IF enp4s0 12state down 12mac <filter>
  12Device-2 Ralink MT7601U Wireless Adapter 12driver mt7601u 12type USB 12bus-ID 3-4:3
  12IF wlp6s0f3u4 12state up 12mac <filter>
  12IF-ID-1 ipv6leakintrf0 12state unknown 12speed N/A 12duplex N/A 12mac <filter>
12Drives:
  12Local Storage 12total 223.57 GiB 12used 85.89 GiB (38.4%)
  12ID-1 /dev/sda 12vendor Kingston 12model SA400M8240G 12size 223.57 GiB
12Partition:
  12ID-1 / 12size 184.1 GiB 12used 85.51 GiB (46.4%) 12fs btrfs 12dev /dev/sda3
  12ID-2 /boot 12size 973.4 MiB 12used 339.7 MiB (34.9%) 12fs ext4 12dev /dev/sda2
  12ID-3 /boot/efi 12size 598.8 MiB 12used 45.4 MiB (7.6%) 12fs vfat 12dev /dev/sda1
  12ID-4 /home 12size 184.1 GiB 12used 85.51 GiB (46.4%) 12fs btrfs 12dev /dev/sda3
12Swap:
  12ID-1 swap-1 12type zram 12size 8 GiB 12used 0 KiB (0.0%) 12dev /dev/zram0
12Sensors:
  12System Temperatures 12cpu 63.4 C 12mobo N/A 12gpu amdgpu 12temp 63.0 C
  12Fan Speeds (RPM) N/A
12Info:
  12Processes 322 12Uptime 0m 12Memory 12available 13.55 GiB 12used 1.7 GiB (12.5%) 12Init systemd
  12target graphical (5) 12Compilers 12gcc 13.1.1 12clang 16.0.4 12Packages 90 12note see --rpm 12Client Unknown
  Client: flatpak-session-helper 12inxi 3.3.27
  • Are the speakers connected over USB?
    → The Speakers are connected through a audio jack in the motherboard.

  • Do you have a separate power source?
    → You mean, the power supply inside my pc’s cabinet ?
    download

  • Is the audio over a audio jack connected ?
    → My speakers are always connected through the audio jack. (I also keep them clean :grinning:)

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.

1 Like

I viewed the report mentioned by @glb here.
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 ****
  • cat /etc/modprobe.d/alsa-base.conf
┌───── arctrus 
│~ 
└─>  cat /etc/modprobe.d/alsa-base.conf
options snd-hda-intel index=0 model=laptop-dmic
  • sudo inxi -A
┌───── arctrus 
│~ 
└─>  sudo inxi -A
[sudo] password for arctrus: 
12Audio:
  12Device-1 AMD Raven/Raven2/Fenghuang HDMI/DP Audio 12driver N/A
  12Device-2 AMD Family 17h/19h HD Audio 12driver N/A
  12Device-3 Lenovo FHD Webcam Audio 12driver snd-usb-audio,uvcvideo 12type USB
  12API ALSA 12v k6.3.6-200.fc38.x86_64 12status kernel-api

Now, I don’t understand what V1del and Randragon did after that.

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).

/etc/modprobe.d/alsa-base.conf

options snd cards_limit=3
options snd_hda_intel index=-1,-2
options snd_usb_audio index=-3

The above configuration is based on the output from inxi -Fzx that you provided earlier.

12Audio:
  12Device-1 AMD Raven/Raven2/Fenghuang HDMI/DP Audio 12driver snd_hda_intel 12v kernel 12bus-ID 06:00.1
  12Device-2 AMD Family 17h/19h HD Audio 12vendor ASRock 12driver snd_hda_intel 12v kernel 12bus-ID 06:00.6
  12Device-3 Lenovo FHD Webcam Audio 12driver snd-usb-audio,uvcvideo 12ty
1 Like

@glb These files contain configuration settings for sound drivers.

/etc/modprobe.d/alsa-base.conf:options snd-hda-intel index=0 model=laptop-dmic
/etc/modprobe.d/alsa.conf:options snd-intel-dspcfg dsp_driver=1

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.

@glb I did.

┌───── arctrus 
│~ 
└─>  cat /etc/modprobe.d/alsa-base.conf
options snd cards_limit=3
options snd_hda_intel index=-1,-2
options snd_usb_audio index=-3

Also, restarting the system also fixed the issue before.
I’m going to do multiple reboots, and check if I encounter the problem again.

I have done 5 reboots. And have not encountered the issue so far.
Thanks.

Also, you know what does this mean? They show up everytime I start fedora.

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.

1 Like

Is there a way to make it disappear ?

There likely is a way to silence that notice. But I don’t know how to do it off hand. I’d just ignore those.

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)

@glb I think the new alsa-base.conf did something wrong.

See, It happens whenever I login.

https://drive.google.com/file/d/1txKwtxEbWX-u9UIxahWutDuaExpCoE9X/view?usp=sharing

Even, if I close my music application the same behaviour happens again.

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.

I do this after every login, and sound starts coming for that session.
I don’t know how long would I have to do this.

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.

But it worked very well just a few weeks ago.

Do you know how to make a .sh script that would automatically switch the configuration on startup ?

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.