Bug 219567

Summary: Yamaha THR5 popping sounds during playback
Product: Drivers Reporter: Jaakko Salo (jaakkos)
Component: Sound(ALSA)Assignee: Jaroslav Kysela (perex)
Status: RESOLVED CODE_FIX    
Severity: normal CC: tiwai
Priority: P3    
Hardware: AMD   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:
Attachments: alsa-info output with stock Ubuntu 24.04.1 kernel
alsa-info output with Ubuntu 24.04.1 + linux-sound 6.12.0-rc7 + patch
Patch to add implicit FB quirk for Yamaha THR5

Description Jaakko Salo 2024-12-06 03:36:34 UTC
When Yamaha THR5 is used as a USB audio interface, playback produces a popping sound every few seconds. Here is an example capture with a 100 Hz tone playing in the background: https://drive.google.com/file/d/1ZVatviBvHuarDIGIy8AoJiYbwEpOedn4/view?usp=drive_link

A workaround is to force implicit feedback mode with 'snd-usb-audio.implicit_fb=1'. I have tested that recording still works with this option enabled. Without 'implicit_fb', the device lacks a feedback source.

I wrote a patch to snd-usb-audio quirks to enable implicit FB for the THR5. I have attached the following outputs from 'alsa-info':
- alsa-info.txt - Stock Ubuntu 24.04.1 system
- alsa-info-implicit-fb.txt - Ubuntu 24.04.1 + linux-sound 6.12.0-rc7 + implicit FB patch applied for THR5

This problem only seems to reproduce on certain hardware combinations.

Affected host system:
- Motherboard: ASRock B650i Lightning Wifi
- CPU: AMD Ryzen 7950X3D
- Memory: 64 GB DDR5 6000 MHz
- OS: Ubuntu 24.04.1 / kernel 6.8.0-49-generic

Additionally, the following systems were tested (stock kernel unless noted):
- Buggy:
  - ASRock B650i Lightning Wifi + Ubuntu 24.04.1 linux-sound 6.12.0-rc7 + Yamaha THR5
  - ASRock B650i Lightning Wifi + Ubuntu 20.04.6 + Yamaha THR5

- Working:
  - ThinkPad X1 Carbon Gen7 + Ubuntu 24.04.1 + Yamaha THR5
  - ASUS VivoPC X Intel® Core™ i5 7300HQ + Ubuntu 24.04.1 + Yamaha THR5
  - ASRock B650i Lightning Wifi + Windows 11 + Yamaha THR5
  - ASRock B650i Lightning Wifi + Ubuntu 24.04.1 + Boss Katana Air

The tests were conducted using 'aplay' with a 100 Hz tone @ 44.1 kHz with no other workload running except the Ubuntu desktop. I have not spotted any errors or warnings in system or user journal, or 'aplay' output, during playback. I used the following configuration to increase logging verbosity:
- 'echo "file sound/* +p" > /sys/kernel/debug/dynamic_debug/control'
- 'echo 8 > /proc/sys/kernel/printk'
- Enable CONFIG_SND_DEBUG + CONFIG_SND_PCM_XRUN_DEBUG + /proc/asound/card*/pcm*/xrun_debug

Troubleshooting attempts (unsuccessful):
- Increase Pipewire quantum settings
- Disable Pipewire and use ALSA directly, incl. with large 'buffer_size' in ALSA config
- Try all quirk flags in snd-usb-audio (the implicit FB flag ofc. helps)
- Try the Performance / Balanced / Power Save profile settings in Ubuntu

I believe some other Yamaha THR series devices may be affected as well, eg. the THR10: see https://linuxmusicians.com/viewtopic.php?p=164262
Comment 1 Jaakko Salo 2024-12-06 03:38:02 UTC
Created attachment 307325 [details]
alsa-info output with stock Ubuntu 24.04.1 kernel
Comment 2 Jaakko Salo 2024-12-06 03:39:28 UTC
Created attachment 307326 [details]
alsa-info output with Ubuntu 24.04.1 + linux-sound 6.12.0-rc7 + patch
Comment 3 Jaakko Salo 2024-12-06 03:42:34 UTC
Created attachment 307327 [details]
Patch to add implicit FB quirk for Yamaha THR5
Comment 4 Takashi Iwai 2024-12-06 08:31:22 UTC
The patch looks good.  Could you submit it to ML (linux-sound@vger.kernel.org) with Cc to me?  Then we'll review and merge to the upstream.  TIA!
Comment 5 Takashi Iwai 2024-12-07 13:06:05 UTC
The fix patch got merged to sound git tree, to be included in 6.13-rc3.