Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[BUG] Non-symmetrical per channel volume controls cause wrong gain #3455

@singalsu

Description

@singalsu

Describe the bug
The volume unmute and level change ramp stops when one of the channels reach the target gain. The channels reach the target gain at different times due to constant linear gain slope vs. time. As result only one of the channel has the correct gain.

To Reproduce

Run this script

#!/bin/bash

ARECORD="arecord -Dhw:0,1 -f S32_LE -c 4 -r 48000"
SLEEP="sleep 1"

cset_nom () { amixer cset 'name=Dmic0 Capture Volume' 70%; }
cset_max () { amixer cset 'name=Dmic0 Capture Volume' 100%; }
cset_min () { amixer cset 'name=Dmic0 Capture Volume' 0%; }
cset_diff1 () { amixer cset 'name=Dmic0 Capture Volume' 90%,80%,50%,10%; }
cset_diff2 () { amixer cset 'name=Dmic0 Capture Volume' 10%,50%,80%,90%; }
cset_mute () { amixer cset 'name=Dmic0 Capture Switch' off; }
cset_unmute () { amixer cset 'name=Dmic0 Capture Switch' on; }

# Test 1
# Prepare, set vol to 100%, unmute, record in background

cset_max
cset_unmute
$SLEEP
$ARECORD -d 10 vol_test_1.wav &
$SLEEP

# Set different gains
cset_diff1
$SLEEP

# Set nominal gain
cset_nom
$SLEEP

# Mute
cset_mute
$SLEEP

# Set umute
cset_unmute
$SLEEP

# Mute
cset_mute
$SLEEP

# Set max gain
cset_max
$SLEEP

# Set umute
cset_unmute
$SLEEP

# Set different gains
cset_diff2
$SLEEP

Reproduction Rate
Always. The incorrect gains look like this:

Screenshot from 2020-09-23 13-48-04

Expected behavior
The different and correct gains need to be observed in the recording. This was ran with PR #3450 .

Screenshot from 2020-09-23 13-36-47

Impact
Showstopper if different channel gains are needed. Usually they are not. It is also recommended to use EQ to adjust to tune e.g. non-symmetrical speakers to sound similar.

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: {SHA}
    • SOF: {SHA}
  2. Name of the topology file
    • Topology: {FILE}
  3. Name of the platform(s) on which the bug is observed.
    • Platform: {PLATFORM}

Screenshots or console output
If applicable, add a screenshot (drag-and-drop an image), or console logs
(cut-and-paste text and put a code fence (```) before and after, to help
explain the issue.

Please also include the relevant sections from the firmware log and kernel log in the report (and attach the full logs for complete reference). Kernel log is taken from dmesg and firmware log from sof-logger. See https://thesofproject.github.io/latest/developer_guides/debugability/logger/index.html

Metadata

Metadata

Assignees

Labels

P2Critical bugs or normal featuresbugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions