Webcam Not Working When Listening to Audio in Loopback Module

Laptop: Thinkpad X1 Yoga 4th Gen
OS: Fedora 34 and 35
Relevant Hardware: Laptop Webcam, USB HDMI Capture Card
Relevant Apps: PipeWire (w/loopback module), OBS, Cheese, Discord, any webcam application

I’ve been having an issue where my webcam would no longer work on any app in my system when enabling the audio loopback module using either of:

  • pactl load-module module-loopback
  • pw-loopback

My setup when this happens is:

  • Use laptop webcam as a video source
  • USB HDMI Capture Card plugged in, capturing video and audio
  • Optional: Bluetooth Headset (audio sink), USB Antilion Mic (audio source), but I have the same issue without these
  • Enable loopback module

I stream/record games from my capture card, while also using the microphone and headset to talk to friends on Discord or in OBS. I want to be able to listen to the input audio of my Capture Card through my headphones, so that I can listen to game audio and a Discord call at the same time.

However, when I have my capture card and webcam connected, and enable the loopback module, my webcam is no longer available to apps to use as a video source. In apps like Discord and Cheese, it doesn’t even show up. All my audio inputs (including my webcam mic) are still functioning, but my webcam video no longer works. I’ve tried this without my headset or my mic plugged in, and just using my capture card and internal webcam/mic, and I still have the same issue.

My webcam continues to be unusable even if I disable the loopback module. However, if I unplug my capture card, then my webcam sometimes works again, but not always. A reboot without loading the loopback module will always fix it though.

I’ve tried this with both PipeWire and PulseAudio (by uninstalling PipeWire), and I get the same result in both, so it doesn’t look to be PipeWire specific. I find it strange that using an audio module will cause my webcam video to not work anymore.

Welcome to ask Fedora!

Do you have own config files in /etc/pipewire? If you not need them you should remove and use the standard in /usr/share/pipewire.

Do you know the pw- tools you can use in terminal? Type pw- and Tab twice to see all commands.

To start debug pw-top could be usefull.

/etc/pipewire doesn’t exist on my machine, so I imagine it’s just using the standard config files in /usr/share/pipewire.

I don’t know about the pw- tools, but I took a look and there’s a pw-loopback module. I don’t have any time to test it yet, but is there any benefit of using pw-loopback rather than the pactl loopback module?

There is a plusaudio module so, everything where is compatible with it should work. But if the service not works probably the loopback is also not working.

Please check the services as described here:
https://discussion.fedoraproject.org/t/dnf-upgrade-to-fedora-35-beta-no-sound-device/76693/2

Of course if you can use pipewire without the pulsaudio plugin, it should work better. Pipewire is in development and things are getting better than with Pulsaudio.

That was the objective to move on to pipewire. Audio on Professional level will be possible more and more :wink:

All the services seem to be active and running on a cold boot with no errors. I’ve tried running both the pactl loopback module, as well as the PipeWire pw-loopback, and both result in my webcam no longer working, even after the loopback module is disabled.

I also tried uninstalling PipeWire and installing PulseAudio instead, but my webcam still wouldn’t work with the loopback module. So it looks like it may not be a PipeWire issue. Also, I looked at the audio monitors and all my input devices, including my webcam mic, were still working. So it looks like the loopback module results in my webcam video being no longer functional.

I looked at the pipewire status after running the loopback module and saw these error logs:

Nov 04 18:00:11 lawrence-x1y4-fedora pipewire[1987]: spa.alsa: set_hw_params: No space left on device
Nov 04 18:00:11 lawrence-x1y4-fedora pipewire[1987]: pw.node: (alsa_input.usb-Antlion_Audio_Antlion_Wireless_Microphone-00.pro-input-0-49) suspended -> error (Start error: No space lef
t on device)
Nov 04 18:00:11 lawrence-x1y4-fedora pipewire[1987]: spa.alsa: set_hw_params: No space left on device
Nov 04 18:00:27 lawrence-x1y4-fedora pipewire[1987]: pw.link: 0x558a05baeac0: one of the nodes is in error out:error in:suspended

Not sure what to make of these, especially since my audio inputs were still working, it’s just my webcam video that isn’t working.

Do you have a memory card on your microphone?

I was also reading that the kernel has some bugs about USB. On which kernel are you?

Could you please give us more info about your hard and software?
inxi -Fzx in terminal would give a good overview of it.
Could you post that here?

Don’t think I have a memory card on my mic, it’s just a USB receiver. However, I just tried it without my bluetooth headset or my USB mic, using just my USB Capture Card, my webcam, and the loopback module playing audio from my capture card to my laptop speakers. It still results in my webcam video not working.

I’ve also updated my initial post to give better/specific details.

I’m using a Thinkpad X1 Yoga 4th Gen, with an i5-8265U and 16GB ram. I’m using Fedora 35 but I also had this problem recently on Fedora 34.

Output (Truncated):

System:
  Kernel: 5.14.14-300.fc35.x86_64 x86_64 bits: 64 compiler: gcc 
  v: 2.37-10.fc35 Desktop: GNOME 41.0 
  Distro: Fedora release 35 (Thirty Five) 
Machine:
  Type: Convertible System: LENOVO product: 20QF0014US 
  v: ThinkPad X1 Yoga 4th serial: <filter>

...

Audio:
  Device-1: Intel Cannon Point-LP High Definition Audio vendor: Lenovo 
  driver: sof-audio-pci-intel-cnl bus-ID: 00:1f.3 
  Sound Server-1: ALSA v: k5.14.14-300.fc35.x86_64 running: yes 
  Sound Server-2: PulseAudio v: 15.0 running: no 
  Sound Server-3: PipeWire v: 0.3.39 running: yes 

You truncated the output for posting. We did not get anything related to the webcam.
Please post the entire output so we can see all the potentially related pieces.

1 Like

Ah my bad, I didn’t want to make a huge post with a long log, I didn’t realize it would automatically make it scrollable. Here’s the full log of just my laptop with my capture card plugged in. I didn’t include my headset or my mic since the bug still persists without those plugged in.

System:
  Kernel: 5.14.15-300.fc35.x86_64 x86_64 bits: 64 compiler: gcc 
  v: 2.37-10.fc35 Desktop: GNOME 41.0 
  Distro: Fedora release 35 (Thirty Five) 
Machine:
  Type: Convertible System: LENOVO product: 20QF0014US 
  v: ThinkPad X1 Yoga 4th serial: <filter> 
  Mobo: LENOVO model: 20QF0014US v: SDK0K17763 WIN serial: <filter> 
  UEFI: LENOVO v: N2HET64W (1.47 ) date: 07/19/2021 
Battery:
  ID-1: BAT0 charge: 29.7 Wh (57.1%) condition: 52.0/51.0 Wh (101.9%) 
  volts: 15.2 min: 15.4 model: LGC 02DL004 status: Discharging 
CPU:
  Info: Quad Core model: Intel Core i5-8265U bits: 64 type: MT MCP 
  arch: Kaby Lake note: check rev: C cache: L2: 6 MiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx 
  bogomips: 28800 
  Speed: 700 MHz min/max: 400/3900 MHz Core speeds (MHz): 1: 700 2: 1561 
  3: 775 4: 1300 5: 700 6: 700 7: 700 8: 717 
Graphics:
  Device-1: Intel WhiskeyLake-U GT2 [UHD Graphics 620] vendor: Lenovo 
  driver: i915 v: kernel bus-ID: 00:02.0 
  Device-2: IMC Networks Integrated Camera type: USB driver: uvcvideo 
  bus-ID: 1-8:3 
  Device-3: Cubeternet Live Streaming USB Device type: USB 
  driver: snd-usb-audio,uvcvideo bus-ID: 2-4:2 
  Display: wayland server: X.Org 1.21.1.2 compositor: gnome-shell driver: 
  loaded: modesetting unloaded: fbdev,vesa resolution: 1456x819~60Hz 
  OpenGL: renderer: Mesa Intel UHD Graphics 620 (WHL GT2) v: 4.6 Mesa 21.2.5 
  direct render: Yes 
Audio:
  Device-1: Intel Cannon Point-LP High Definition Audio vendor: Lenovo 
  driver: sof-audio-pci-intel-cnl bus-ID: 00:1f.3 
  Device-2: Cubeternet Live Streaming USB Device type: USB 
  driver: snd-usb-audio,uvcvideo bus-ID: 2-4:2 
  Sound Server-1: ALSA v: k5.14.15-300.fc35.x86_64 running: yes 
  Sound Server-2: PulseAudio v: 15.0 running: no 
  Sound Server-3: PipeWire v: 0.3.39 running: yes 
Network:
  Device-1: Intel Cannon Point-LP CNVi [Wireless-AC] driver: iwlwifi 
  v: kernel port: 2000 bus-ID: 00:14.3 
  IF: wlp0s20f3 state: up mac: <filter> 
  Device-2: Intel Ethernet I219-V vendor: Lenovo driver: e1000e v: kernel 
  port: efa0 bus-ID: 00:1f.6 
  IF: enp0s31f6 state: down mac: <filter> 
Bluetooth:
  Device-1: Intel Bluetooth 9460/9560 Jefferson Peak (JfP) type: USB 
  driver: btusb v: 0.8 bus-ID: 1-10:5 
  Report: rfkill ID: hci0 rfk-id: 1 state: up address: see --recommends 
Drives:
  Local Storage: total: 476.94 GiB used: 120.39 GiB (25.2%) 
  ID-1: /dev/nvme0n1 vendor: Western Digital 
  model: PC SN730 SDBQNTY-512G-1001 size: 476.94 GiB temp: 30.9 C 
Partition:
  ID-1: / size: 377.7 GiB used: 120.09 GiB (31.8%) fs: btrfs 
  dev: /dev/nvme0n1p3 
  ID-2: /boot size: 975.9 MiB used: 241 MiB (24.7%) fs: ext4 
  dev: /dev/nvme0n1p2 
  ID-3: /boot/efi size: 598.8 MiB used: 66.7 MiB (11.1%) fs: vfat 
  dev: /dev/nvme0n1p1 
  ID-4: /home size: 377.7 GiB used: 120.09 GiB (31.8%) fs: btrfs 
  dev: /dev/nvme0n1p3 
Swap:
  ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) dev: /dev/zram0 
Sensors:
  System Temperatures: cpu: 40.0 C mobo: N/A 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 306 Uptime: 2h 33m Memory: 15.4 GiB used: 4.72 GiB (30.7%) 
  Init: systemd runlevel: 5 Compilers: gcc: 11.2.1 Packages: 50 
  note: see --pkg Shell: Bash v: 5.1.8 inxi: 3.3.06

Also, as a note, I have tried this again on a fresh live boot of Fedora 34 on this laptop, as well as clean installs of Fedora 35 and Pop OS 21.10 Beta on a different Lenovo Thinkpad 13 (i5-7500u). In all 3 cases, I was able to have loopback audio from my capture card while using my webcam in Cheese.

I’m wondering if something got messed up on my webcam config somewhere. I’m tempted to just reinstall Fedora 35 on this machine, but I want to see if there’s a way to fix this without doing that.

EDIT: Updated logs to include capture card info

Try creating a new user and check if everything works as expected when logged in as that user. If it does then something in your user config is interfering. If it still acts the same then we need to track down the actual cause outside of your user config.

1 Like

Just created a new user and plugged in my capture card, then loaded pw-loopback. I opened Cheese, and it gave the same error screen that says “There was an error playing video from your webcam.” So looks like it’s not just a user config thing.

I decided to try Fedora 35 on this laptop again (Thinkpad X1 Yoga 4th Gen)… I was having the same webcam issue when using the pw-loopback module. An old Fedora 34 iso (kernel 5.11.12-300), however, worked fine, and I was able to listen to capture card audio with loopback while viewing my webcam in Cheese.

I decided to try Fedora 34 and 35 on my Thinkpad 13 2nd Gen… and both of them worked fine. I don’t know if the webcam hardware differs, but I do know that the X1Y4 has a 4 mic arragement, while the 13 only has a 2 mic arrangement.

So looks like it’s an issue with the webcam hardware in my Thinkpad X1 Yoga 4th Gen, Maybe there was a regression introduced during a kernel update, since my older Fedora 34 iso still worked fine? I had this issue before updating to Fedora 35, so I don’t think it had to do with the update to 35.

I tried loading an older kernel from the Grub menu, but the only options available were two of the Fedora 35 kernels (5.14.14-300), and then a very recent Fedora 34 kernel (5.14.14-200) which resulted in the same error.

I tried filling out a bug report but was told that I should continue to get help from user report forums instead:
https://bugzilla.redhat.com/show_bug.cgi?id=2021361

Is there any other insight that might help me get this fixed for my machine? Since it didn’t work on a Fedora 35 live boot on my X1T4 (but DID work on a live boot of Fedora 34), but DID work on a Fedora 35 live boot on my Thinkpad 13 2nd Gen, I’m thinking it’s a bug that got introduced in an update that only applies to my hardware (and other X1 laptops with similar webcam/mic arrangements).