Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Volume control with different value for channels fails, gain ramp in second channel fails #8820

Closed
singalsu opened this issue Jan 30, 2024 · 6 comments
Assignees
Labels
bug Something isn't working as expected
Milestone

Comments

@singalsu
Copy link
Collaborator

singalsu commented Jan 30, 2024

Describe the bug
Non-symmetrical volume controls are not always working correctly. In this case one volume command got ignored.

Also in channel 2 the gain ramp seem to be omitted sometimes. In such case the gain jumps directly to new gain without normal soft transition.

To Reproduce
Prepare a script in DUT e.g. ~/bin/test_capture_volume.sh with content

#!/bin/bash

amixer -c0 cset name='DMIC Raw Capture Volume' 45
sleep 1
amixer -c0 cset name='DMIC Raw Capture Volume' 45,40
sleep 1
amixer -c0 cset name='DMIC Raw Capture Volume' 40,45
sleep 1
amixer -c0 cset name='DMIC Raw Capture Volume' 0
sleep 1
amixer -c0 cset name='DMIC Raw Capture Volume' 45,45
sleep 1
amixer -c0 cset name='DMIC Raw Capture Volume' 1,45
sleep 1
amixer -c0 cset name='DMIC Raw Capture Volume' 45,1
sleep 1
amixer -c0 cset name='DMIC Raw Capture Volume' 45
sleep 1

Open three shell windows to DUT. From one window other device play long enough steady sine wave from DUT speaker or other speaker to DUT microphones. E.g.
$ aplay -Dhw:0,0 sine.wav

Launch from two shell windows first capture command, and immediately after the gains adjust script.

$ arecord -Dhw:0,6 -f S32_LE -r 48000 -c 2 -d 10 rec.wav
$ test_capture_volume.sh

Steps to reproduce the behavior: (e.g. list commands or actions used to reproduce the bug)

Reproduction Rate
100%

Expected behavior
Audio signal envelope should follow follow volume commands and every volume transition should be soft.

Impact
Annoyance

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: {SHA} topic/sof-dev 21a82bd3df0a
    • SOF: {SHA} main 8bfb489
  2. Name of the topology file
    • Topology: {FILE} sof-hda-generic-2ch.tplg
  3. Name of the platform(s) on which the bug is observed.
    • Platform: {PLATFORM} TGL-H notebook

Screenshots or console output

Here in the highlighed part of the wav file the volume command "amixer -c0 cset name='DMIC Raw Capture Volume' 1,45" failed.
Screenshot from 2024-01-30 15-50-06

It can be also seen that the volume ramp is missing from channel 2 just after 8s time in the waveform.
gh_volume_fail_issue.wav.gz

@singalsu singalsu added the bug Something isn't working as expected label Jan 30, 2024
@lgirdwood lgirdwood added this to the v2.9 milestone Jan 31, 2024
@lgirdwood
Copy link
Member

@singalsu is this something you can self assign and fix (maybe via testbench or plugin if ready/faster ?)

@singalsu
Copy link
Collaborator Author

singalsu commented Feb 2, 2024

@singalsu is this something you can self assign and fix (maybe via testbench or plugin if ready/faster ?)

I'll check with @btian1 his findings, if no solution before CNY I can continue.

@singalsu singalsu self-assigned this Feb 2, 2024
@lgirdwood
Copy link
Member

@btian1 @singalsu any update ?

@singalsu
Copy link
Collaborator Author

The issue can be repeated in playback side with a simple control sequence:

amixer cset name='Post Mixer Analog Playback Volume' 45
sleep 1
amixer cset name='Post Mixer Analog Playback Volume' 1,45
sleep 1
amixer cset name='Post Mixer Analog Playback Volume' 45,1
sleep 1
amixer cset name='Post Mixer Analog Playback Volume' 45

Screenshot from 2024-03-14 16-05-55

Seems there's in 2nd channel (#1) some wrong gain in the highlighted area. I'll try debug that with added traces.

@singalsu
Copy link
Collaborator Author

Fix work in progress: #8950

@kv2019i kv2019i modified the milestones: v2.9, v2.10 Mar 27, 2024
@singalsu
Copy link
Collaborator Author

Fixed by #8950.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

3 participants