Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH v4 0/2] ASoC: wm8731: interface activation order
@ 2026-11-30 20:17 Rafael Diniz
  2026-11-30 20:17 ` [PATCH v4 1/2] ASoC: wm8731: activate the interface after the inputs, before the outputs Rafael Diniz
  2026-11-30 20:17 ` [PATCH v4 2/2] ASoC: wm8731: use one sample width for both directions Rafael Diniz
  0 siblings, 2 replies; 5+ messages in thread
From: Rafael Diniz @ 2026-11-30 20:17 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood
  Cc: Rafael Diniz, Charles Keepax, Jaroslav Kysela, Takashi Iwai,
	patches, linux-sound

On a WM8731 that provides the clocks (96 kHz from a 12 MHz crystal, as
on the AudioInjector stereo card for the Raspberry Pi), about one
capture start in five came up deaf: DC offset and noise at their usual
levels, no signal, until the interface was deactivated and activated
again.  The trigger is the ADC powering up under an active interface,
which the driver's ACTIVE supply widget does on every capture start.

Patch 1 powers the ADC and DAC from one supply with the interface
inactive and sets ACTIVE at the last step before the outputs, as the
datasheet's power-up sequence has it.  Patch 2 makes both directions use
one sample width, as they already use one rate.

Changes in v4:
- ACTIVE now comes after the microphone and line inputs and just before
  OUTPD (Charles).  OUTPD moves from the output mixer to an output
  driver widget, which DAPM powers last.  The ADC sets ACTIVE for
  capture, the output driver for playback, and the DAC when the outputs
  are already up for the line bypass.  The converters' supply still
  clears it, after everything else has gone down.
- The ADC and DAC still power up together while either direction runs
  (Mark's point on power, discussed in the v3 thread).  Powering one up
  under an active interface would need ACTIVE cycled, and on this card,
  where the codec provides the clocks, a cycle with both streams running
  left the capture channels swapped in 38 of 52 trials.
- Patch 2 unchanged, with Charles's Reviewed-by.

v3: https://lore.kernel.org/linux-sound/20261128092306.1566199-1-rafael@riseup.net/

Rafael Diniz (2):
  ASoC: wm8731: activate the interface after the inputs, before the
    outputs
  ASoC: wm8731: use one sample width for both directions

 sound/soc/codecs/wm8731.c | 109 ++++++++++++++++++++++++++++++++++----
 sound/soc/codecs/wm8731.h |   8 +++
 2 files changed, 107 insertions(+), 10 deletions(-)


base-commit: 4405c18c95d2d0f99f6c581ef0ee8591a1aa6ccd
-- 
2.47.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-03 10:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 20:17 [PATCH v4 0/2] ASoC: wm8731: interface activation order Rafael Diniz
2026-11-30 20:17 ` [PATCH v4 1/2] ASoC: wm8731: activate the interface after the inputs, before the outputs Rafael Diniz
2026-12-03 10:55   ` Charles Keepax
2026-11-30 20:17 ` [PATCH v4 2/2] ASoC: wm8731: use one sample width for both directions Rafael Diniz
2026-12-01 12:00   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox