Skip to content

[DSM][TGL]: speaker L/R channel route in codec driver doesn't match with amixer kcontrol  #2045

Closed

Description

@keqiaozhang

Describe the bug
The behavior of speaker L/R channel is wrong when testing DSM on TGL Chromebook.
For example:
Use amixer to set speaker L channel "Left DAI Sel Mux" as 0 and run speaker-test, the left channel should be able to hear "Front Left", but only Front Right can be heard during speaker-test on both channels at the same time.
looks like the route of L/R channel is not set correctly in codec driver side. Need chrome team help to check.

To Reproduce

  1. use amixer to set L/R channel for speaker
    amixer cset name='Left DAI Sel Mux' 0
    amixer cset name='Right DAI Sel Mux' 1
  2. do speaker-test on hw:0,0
    speaker -Dhw:0,0 -t wav -c 2

Expected behavior
Hear Front Left and Front right separately

Environment
Kernel: https://github.com/thesofproject/linux/tree/topic/smart-amp
firmware:https://github.com/thesofproject/sof/tree/tgl-005-drop-stable
tplg: sof-tgl-max98373-rt5682.tplg

Activity

  1. added
    bugSomething isn't working
    ChromeRelated to Chrome integration
    codecCodec HW or driver restriction
    Smart AmpSmart Amp or DSM (Dynamic Speaker Management)
    P1Blocker bugs or important features
    TGLApplies to Tiger Lake platform
    on Apr 23, 2020
  2. keyonjie commented on Apr 29, 2020

    @keyonjie

    I think the comments in the code below is somewhat confused:

    struct snd_soc_dai_link_component max_98373_components[] = {
    	{  /* For Left */
    		.name = MAX_98373_DEV0_NAME,
    		.dai_name = MAX_98373_CODEC_DAI,
    	},
    	{  /* For Right */
    		.name = MAX_98373_DEV1_NAME,
    		.dai_name = MAX_98373_CODEC_DAI,
    	},
    };
    

    we followed Left--DEV0 and debugged for long time with:
    amixer cset name='Left DAI Sel Mux' Left
    amixer cset name='Right DAI Sel Mux' Right

    where the captured data was always incorrect.

    So I think only correct the comment message should be good enough.

    @RDharageswari FYI.

  3. RDharageswari commented on Apr 29, 2020

    @RDharageswari

    Sure..Thanks :)

  4. RDharageswari commented on May 29, 2020

    @RDharageswari

    Incorporated the fix in the following patch:
    24e5b26

  5. sinahuang commented on Jun 24, 2020

    @sinahuang

    Currently right speaker output left channel audio, left speaker output right channel audio with https://github.com/thesofproject/sof/tree/tgl-007-drop-stable on chrome book with codec 98373 in I2S mode.
    dmesg24.log
    amixer24.txt

  6. ClarexZhou commented on Jul 6, 2020

    @ClarexZhou

    only one Channle has audio output after run DSM command. Frequency: 5/10
    Steps:

    1. Boot up system
    2. speaker-test -Dhw:0,0 -t wav -c 2 -> both 2 channels has audio output, but L output R, R output L. amixer contents is here
      amixer_default.txt
    3. run DSM command aplay -Dhw:0,0 -f s16_le -c 2 -r 48000 sine_48k_16bit_10s_stereo_l5_r2.wav -d 5 & arecord -Dhw:0,0 -f s16_le -c 4 -r 48000 record.wav -d 5
    4. wait for about 3s.
    5. speaker-test -Dhw:0,0 -t wav -c 2 only one channel is output. amixer is here
      amixer_373change.txt
    
    ubuntu@TGL-Volteer-01:~$ diff amixer_default.txt amixer_373change.txt           186c186
    <   : values=0
    ---
    >   : values=183
    205c205
    <   : values=0
    ---
    >   : values=49
    
    

    dmesg_373amixerchange.txt
    sof-trace_373amixerchange.txt

  7. ClarexZhou commented on Jul 16, 2020

    @ClarexZhou

    Error not seen , previous connected speaker issue. Close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ChromeRelated to Chrome integrationI2SP1Blocker bugs or important featuresSmart AmpSmart Amp or DSM (Dynamic Speaker Management)TGLApplies to Tiger Lake platformbugSomething isn't workingcodecCodec HW or driver restriction

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions