Skip to contentSkip to conversation

sof-soundwire: es9356: default the DMIC gain to +12 dB

DISCUSSION GitHub pull_request - opened 1 participant 3 messages Nov 14 – Nov 26 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

alsa-project/alsa-ucm-conf pull request #914 was opened from kannoy2024:

Set a usable default for the internal DMIC capture gain.

### Problem

The ES9356 DMIC gain control (es9356 FU11 Capture Volume) resets to 0 dB. The control has four 6 dB steps (0/6/12/18 dB), so 0 dB leaves the recorded voice well below the noise floor: the internal microphone is unusable until the mixer is adjusted by hand, and users have no reason to know that the control exists.

### Change

Add an EnableSequence to the Mic device in sof-soundwire/es9356.conf that sets the gain to +12 dB. This follows the pattern used by other codecs (for example codecs/cs42l43-dmic.conf configures its inputs in the device EnableSequence). The control is still a normal mixer control, so the level can be changed at runtime.

| file | change |
|---|---|
| `ucm2/sof-soundwire/es9356.conf` | `Mic`: set `es9356 FU11 Capture Volume` to 2 (+12 dB) in `EnableSequence` |

### Testing

MECHREVO WUJIE 14SAH (AMD ACP6.3, ES9356 on SoundWire link 0). The gain was set to 0 dB by hand and PipeWire was then restarted:

- amixer -c 1 cset numid=10 0
- systemctl --user restart pipewire pipewire-pulse wireplumber
- amixer -c 1 cget numid=10 → : values=2 (the device came up at +12 dB)

wpctl status shows Speaker and Internal Microphone, and recording through the internal microphone is usable without touching the mixer.

Related: the matching dB scale fix for this control is
https://git.kernel.org/broonie/sound/c/412a061ebf8c

Request URL : https://github.com/alsa-project/alsa-ucm-conf/pull/914
Patch URL : https://github.com/alsa-project/alsa-ucm-conf/pull/914.patch
Repository URL: https://github.com/alsa-project/alsa-ucm-conf

#2 lore raw
In reply to a message not in the archive

alsa-project/alsa-ucm-conf pull request #914 was edited from kannoy2024:

Point the ES9356 internal microphone at its hardware capture gain.

### Problem

The ES9356 DMIC gain control (es9356 FU11 Capture Volume) has four 6 dB steps (0/6/12/18 dB) and is left at 0 dB, which is too quiet for normal
recordings: the recorded voice sits well below the noise floor, and the internal microphone is unusable until the mixer is adjusted by hand.

### Change

Add CaptureMixerElem to the Mic device in sof-soundwire/es9356.conf, so PipeWire can control the hardware capture gain directly instead of UCM writing a fixed value. This follows the pattern used by other codecs (for example codecs/cs42l43-dmic.conf uses CaptureMixerElem "cs42l43 Microphone").

| file | change |
|---|---|
| `ucm2/sof-soundwire/es9356.conf` | `Mic`: add `CaptureMixerElem "es9356 FU11"` |

### Testing

MECHREVO WUJIE 14SAH (AMD ACP6.3, ES9356 on SoundWire link 0), kernel 7.2.9:

- wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 1.00 → amixer -c 1 cget numid=10 → : values=3 (max gain)
- wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.30 → : values=0

So the hardware control follows the PipeWire volume. The coarse mapping right now is because this tree still has the old TLV step (0.06 dB instead of 6 dB); with 412a061ebf8c ("fix the capture gain dB scale", in 7.4 and queued for 7.3-stable) the percentages map proportionally. Recording still works.

Related: https://git.kernel.org/broonie/sound/c/412a061ebf8c

Request URL : https://github.com/alsa-project/alsa-ucm-conf/pull/914
Patch URL : https://github.com/alsa-project/alsa-ucm-conf/pull/914.patch
Repository URL: https://github.com/alsa-project/alsa-ucm-conf

#3 lore raw

sof-soundwire: es9356: expose the DMIC hardware gain

In reply to a message not in the archive

alsa-project/alsa-ucm-conf pull request #914 was edited from kannoy2024:

Point the ES9356 internal microphone at its hardware capture gain.

### Problem

The ES9356 DMIC gain control (es9356 FU11 Capture Volume) has four 6 dB steps (0/6/12/18 dB) and is left at 0 dB, which is too quiet for normal
recordings: the recorded voice sits well below the noise floor, and the internal microphone is unusable until the mixer is adjusted by hand.

### Change

Add CaptureMixerElem to the Mic device in sof-soundwire/es9356.conf, so PipeWire can control the hardware capture gain directly instead of UCM writing a fixed value. This follows the pattern used by other codecs (for example codecs/cs42l43-dmic.conf uses CaptureMixerElem "cs42l43 Microphone").

| file | change |
|---|---|
| `ucm2/sof-soundwire/es9356.conf` | `Mic`: add `CaptureMixerElem "es9356 FU11"` |

### Testing

MECHREVO WUJIE 14SAH (AMD ACP6.3, ES9356 on SoundWire link 0), kernel 7.2.9:

- wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 1.00 → amixer -c 1 cget numid=10 → : values=3 (max gain)
- wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.30 → : values=0

So the hardware control follows the PipeWire volume. The coarse mapping right now is because this tree still has the old TLV step (0.06 dB instead of 6 dB); with 412a061ebf8c ("fix the capture gain dB scale", in 7.4 and queued for 7.3-stable) the percentages map proportionally. Recording still works.

Related: https://git.kernel.org/broonie/sound/c/412a061ebf8c

Request URL : https://github.com/alsa-project/alsa-ucm-conf/pull/914
Patch URL : https://github.com/alsa-project/alsa-ucm-conf/pull/914.patch
Repository URL: https://github.com/alsa-project/alsa-ucm-conf