Public bug reported:

### Description

On Ubuntu 26.04.1 with kernel 7.0.0-38-generic, audio played over HDMI is
severely corrupted: it constantly stutters and sounds "robotic", while the
same machine's analog output (internal speakers) plays the same stream
perfectly. The same cable and display give clear audio under Windows on this
machine, so neither the cable nor the display is at fault.

The ALSA PCM for the HDMI controller enters a permanent XRUN/recovery loop:
PipeWire reports `snd_pcm_avail after recover: EPIPE` and the PCM is
re-triggered 8-10 times per second. The DMA position pointer used by
snd_hda_intel appears to be read incorrectly.

#### Steps to reproduce

1. Connect any HDMI display (tested: "40S310RMX", [email protected]).
2. Select the HDMI output ("Audio Interno Estéreo digital (HDMI)").
3. Play any audio (also reproduced with a plain WAV tone):
   `pw-play --target alsa_output.pci-0000_00_03.0.hdmi-stereo tono441.wav`
4. Observe the audio stuttering/robotic, or watch the PCM restart:
   `watch -n0.2 'grep -E "state:|trigger_time" 
/proc/asound/card1/pcm3p/sub0/status'`
   (`trigger_time` changes several times per second; states cycle
   RUNNING → XRUN → SETUP).

Raw ALSA playback does not work at all on this PCM:
`aplay -D hw:1,3 -f S16_LE -r 48000 -c 2 tono440.wav`
→ `aplay: pcm_write:2191: error de escritura: Error de entrada/salida` (EIO)
on the very first write (appl_ptr=0, hw_ptr=0).

#### Expected behavior

Continuous audio, no XRUN loop, as in previous kernels / Windows /
analog output.

#### Actual behavior

- PipeWire log (LC: es; "Tubería rota" = EPIPE):
  `spa.alsa: hdmi:1p: (2 suppressed) snd_pcm_avail after recover: Tubería rota`
- pw-top shows ~860 ERR increments on the HDMI sink during 10 s of playback
  (analog sink: 0).
- 38 distinct `trigger_time` values within 4 s of a single 10 s tone
  (i.e. ~8-10 PCM restarts/s). Analog sink: `trigger_time` never changes.

#### Measurements pointing at the position/DMA handling

Sampled `/proc/asound/card1/pcm3p/sub0/status` every ~0.5 ms while playing a
48 kHz tone:

- hw_params programmed: `MMAP_INTERLEAVED, S32_LE, 48000 Hz, period_size=1024,
  buffer_size=32768`.
- hw_ptr in practice never exceeds ~10248 and jumps *backwards* to ~40-96
  about 15 times in 2 s (e.g. 8232 → 48, 10248 → 56), i.e. as if the DMA
  restarted/wrapped around ~8192 instead of the programmed 32768.
- Median pointer rate is correct (≈48.3 kHz), but 113 abnormal jumps and 140
  stalls were observed in 2 s (~126 anomalies/s), matching the ERR rate seen
  by pw-top.
- The analog controller (00:1b.0, same driver) with identical hw_params shows
  0 backwards jumps, 0 restarts, 0 errors.

#### Environment

- Ubuntu 26.04.1 LTS (noble-based development release)
- linux-image-7.0.0-38-generic (7.0.0-38.38); also installed: 7.0.0-34-generic
- Machine: Lenovo ThinkPad X240, BIOS GIET99WW (2.49), Haswell-ULT
- HDMI audio: `00:03.0 Audio device [0403]: Intel Corporation Haswell-ULT HD
  Audio Controller [8086:0a0c] (rev 0b)`, codec "Intel Haswell HDMI"
- Analog audio: `00:1b.0 ... 8 Series HD Audio Controller [8086:9c20]`,
  codec ALC3232 — works perfectly
- DRM: HDMI-A-1 connected, [email protected]; eDP-1 [email protected] (dual head)
- pipewire 1.6.2-1ubuntu1.2, wireplumber 0.5.13-1ubuntu1.1
- Power management ruled out: `power_save=0`, `power_save_controller=N`,
  PCI runtime_status=active, runtime_suspend_time=0 for 00:03.0
- ELD stable during the issue (`monitor_present=1`, `eld_valid=1`,
  LPCM 2ch 32/44.1/48 kHz, 16/20/24 bit); no hotplug/azx kernel messages at all
- Not related to resampling: errors occur identically for 48 kHz and
  44.1 kHz sources (~860 ERR / 10 s either way)

#### Workarounds tried (none helped)

- `clock.quantum` 1024 → 4096 (runtime): same restart rate (~7-8/s)
- `power_save=0 power_save_controller=N` already set in
  /etc/modprobe.d/audio-hdmi-no-powersave.conf

#### Kernel comparison (tested 2026-10-20)

Test method: `~/audio_hdmi/testar.sh` plays a 10 s tone over HDMI and counts
distinct `trigger_time` values (PCM restarts) during the first 4 s.

- **7.0.0-38-generic**: consistently broken — 30-38 PCM restarts per 4 s on
  every run (3/3 runs), ~860 pw-top ERR increments per 10 s of playback.
- **7.0.0-34-generic**: intermittently broken — 3 of 6 runs showed 10-26
  restarts per 4 s (the other 3 runs were clean), ~343 ERR increments per 10 s.

Conclusion: NOT a regression introduced between -34 and -38; the bug is already
present in -34, but noticeably milder there (~2.5x fewer error increments in
-38, and failures in -38 are 100% reproducible instead of intermittent).

#### Workaround found (tested 2026-10-20): snd_hda_intel snoop=0

`/etc/modprobe.d/hda-hdmi-snoop-fix.conf`:
    options snd_hda_intel snoop=0
(reboot required)

Measured on 7.0.0-38-generic, same methodology as above:

| Metric | Default (snooped reads) | snoop=0 (uncached) |
| --- | --- | --- |
| pw-top ERR, 10 s tone | ~860 (day 1) / ~120 (day 2) | 62 |
| PCM restarts per 4 s | 30-38 (100% of runs) | 0-6 (mostly clean) |
| `snd_pcm_avail after recover` log lines / 5 min | constant | 0 |

The XRUN/recovery loop disappears completely and error counts drop ~14x.
This points at the snooped (cached) reads of the DMA position buffer as the
trigger for the corrupt position values. The workaround is not applied
upstream; it can be shipped to users as an interim mitigation.

#### Not yet tested

- `position_fix=1|6` module options (in case residual errors matter).

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: alsa-base 1.0.25+dfsg-0ubuntu9
ProcVersionSignature: Ubuntu 7.0.0-38.38-generic 7.0.14
Uname: Linux 7.0.0-38-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Tue Oct 20 15:19:10 2026
InstallationDate: Installed on 2026-09-25 (26 days ago)
InstallationMedia: Ubuntu 26.04.1 LTS "Resolute Raccoon" - Release amd64 
(20260826)
MachineType: LENOVO 20AMS19100
PackageArchitecture: all
ProcEnviron:
 LANG=es_ES.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: alsa-driver
Symptom: audio
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 03/17/2020
dmi.bios.release: 2.49
dmi.bios.vendor: LENOVO
dmi.bios.version: GIET99WW (2.49 )
dmi.board.asset.tag: Not Available
dmi.board.name: 20AMS19100
dmi.board.vendor: LENOVO
dmi.board.version: 0B98401 PRO
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.ec.firmware.release: 1.17
dmi.modalias: 
dmi:bvnLENOVO:bvrGIET99WW(2.49):bd03/17/2020:br2.49:efr1.17:svnLENOVO:pn20AMS19100:pvrThinkPadX240:rvnLENOVO:rn20AMS19100:rvr0B98401PRO:cvnLENOVO:ct10:cvrNotAvailable:skuLENOVO_MT_20AM_BU_Think_FM_ThinkPadX240:pfaThinkPadX240:
dmi.product.family: ThinkPad X240
dmi.product.name: 20AMS19100
dmi.product.sku: LENOVO_MT_20AM_BU_Think_FM_ThinkPad X240
dmi.product.version: ThinkPad X240
dmi.sys.vendor: LENOVO

** Affects: alsa-driver (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute wayland-session

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2171553

Title:
   HDMI audio stutters continuously (XRUN loop) due to unstable DMA
  position reads in snd_hda_intel — ThinkPad X240 / Haswell / kernel
  7.0.0-38

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/2171553/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to