Genlocked alsa loopback problem with Wolfram wm8731 on 6.6.40

Open
#6,294 45 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
c, linux, raspberry-pi

Research direction

Start with the snd_aloop timer_source configuration and compare behavior between kernels 6.6.31 and 6.6.40 or later on the listed Raspberry Pi devices. Inspect the wm8731 and DMA-related logs while reproducing an application opening the ALSA loopback devices. Done means the loopback remains usable without repeated timer errors or subsequent DMA and soundcard failures.

Written by the indexing model from the issue text.

Description

Describe the bug

After upgrading to kernel 6.6.40 from 6.6.31 (same problem with 6.6.42), I can not use the alsa loopback devices genlocked to the Wolfram 8731 sound device.

Steps to reproduce the behaviour

Just update kernel and run an application which opens the alsa loopback devices.

Device (s)

Raspberry Pi 5, Raspberry Pi 4

System

cat /etc/rpi-issue

Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 2acf7afcba7d11500313a7b93bb55a2aae20b2d6, stage2

vcgencmd version

2024/07/30 15:25:46
Copyright (c) 2012 Broadcom
version 790da7ef (release) (embedded)

uname -a

Linux gateway.hermes.radio 6.6.42-v8+ #1787 SMP PREEMPT Thu Jul 25 17:44:41 BST 2024 aarch64 GNU/Linux

Logs

Initial dmesh output. Nothing suspicious to me.

(...)
[ 4.826923] wm8731 1-001a: Assuming static MCLK
[ 4.826953] wm8731 1-001a: supply AVDD not found, using dummy regulator
[ 4.827050] wm8731 1-001a: supply HPVDD not found, using dummy regulator
[ 4.827074] wm8731 1-001a: supply DCVDD not found, using dummy regulator
[ 4.827101] wm8731 1-001a: supply DBVDD not found, using dummy regulator
[ 4.831445] audioinjector-stereo soc🔉 ASoC: driver name too long 'audioinjector-pi-soundcard' -> 'audioinjector-p'
[ 4.868650] audioinjector-stereo soc🔉 successfully loaded
(...)

After opening the alsa loopback, thousands per second of:
[ 242.922102] snd_aloop snd_aloop.1: snd_timer_start(0,0,0) failed with -22
[ 242.922117] snd_aloop snd_aloop.1: snd_timer_stop(0,0,0) failed with -16
[ 242.922152] snd_aloop snd_aloop.1: snd_timer_start(0,0,0) failed with -22
[ 242.922157] snd_aloop snd_aloop.1: snd_timer_stop(0,0,0) failed with -16
[ 242.922178] snd_aloop snd_aloop.1: snd_timer_start(0,0,0) failed with -22
[ 242.922182] snd_aloop snd_aloop.1: snd_timer_stop(0,0,0) failed with -16
[ 242.922203] snd_aloop snd_aloop.1: snd_timer_start(0,0,0) failed with -22
[ 242.922207] snd_aloop snd_aloop.1: snd_timer_stop(0,0,0) failed with -16

Then the soundcard itself starts to misbehave (crazy sounds heard):
[ 614.169627] dma dma2chan0: BUG: dma2chan0, IRQ with no descriptors
[ 629.590104] dma dma2chan0: BUG: dma2chan0, IRQ with no descriptors
[ 662.121953] dma dma2chan0: BUG: dma2chan0, IRQ with no descriptors
[ 675.205707] dma dma2chan0: BUG: dma2chan0, IRQ with no descriptors

snd-aloop module parameters:
options snd-aloop enable=1,1,1 index=1,2,3 timer_source=hw:0,0

Additional context

No response

Dominant language
C
Stars
13.2k
Forks
5.5k
Avg merge
2d 21h
Merged PRs (30d)
21

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from raspberrypi/linux

All issues in raspberrypi/linux

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.