Skip to content

[BUG]Output very loud at the beginning when aplay via headset(0,0) or media playback(0,4) from Runtime PM status suspend mode #1463

Closed

Description

@Liviali155

Describe the bug
Output very loud at the beginning when aplay via headset(0,0) or media playback(0,4) from Runtime PM status suspend mode

To Reproduce
1.sudo reboot
2.cat "/sys/bus/pci/devices/0000:lspci | grep -i audio | cut -d ' ' -f 1/power/runtime_status"
suspend
3.aplay -Dhw:0,4 -r48000 -c2 -fs16_le wav/sine_48k_stereo_440.wav -vv -i or
aplay -Dhw:0,0 -r48000 -c2 -fs16_le wav/sine_48k_stereo_440.wav -vv -i

Reproduction Rate
Tried 10times can reproduce 10times

Expected behavior
The sound at the beginning should not become so loud

Impact
The sound at the beginning become very loud suddenly and strident

Tested on 20190929,issue can also be reproduced,details as below
Firmware: 8528d93 https://github.com/thesofproject/sof/commits/master
Kernel: f1c5cf5 https://github.com/thesofproject/linux/commits/topic/sof-dev

Capture

Capture1

Environment
Platform: APL UP2 with I2S PCM512x
Firmware: fb068e6 https://github.com/thesofproject/sof/commits/master
Kernel: 4425a3e https://github.com/thesofproject/linux/commits/topic/sof-dev
Topology: file: tools/topology/sof-apl-pcm512x.tplg same as firmware

sof error trace

CORE  LEVEL      COMP_ID                TIMESTAMP            DELTA                FILE_NAME	CONTENT
    0      1           SA          49214787.135417  49214788.000000      src/lib/agent.c:55  	validate(), ll drift detected, delta = 22690

sine_48k_stereo_440.zip

dmesgnoise.log
sof-errortrace.log
softrace.log

Activity

  1. changed the title [-][BUG][APL-UP2][I2S]When aplay sine_48k_stereo_440.wav use media play/headset,it has noise at the beginning[/-] [+][BUG][APL-UP2][I2S]When aplay sine_48k_stereo_440.wav using media play/headset,it has noise at the beginning[/+] on Nov 11, 2019
  2. added
    APLApplies to ApolloLake platform
    bugSomething isn't working
    on Nov 11, 2019
  3. changed the title [-][BUG][APL-UP2][I2S]When aplay sine_48k_stereo_440.wav using media play/headset,it has noise at the beginning[/-] [+][BUG][APL-UP2][I2S]Aplay via media playback/headset,noise occurred at the beginning[/+] on Nov 11, 2019
  4. changed the title [-][BUG][APL-UP2][I2S]Aplay via media playback/headset,noise occurred at the beginning[/-] [+][BUG][APL-UP2][I2S]Changing aplay between media playback/headset,noise occurred at the beginning[/+] on Nov 12, 2019
  5. changed the title [-][BUG][APL-UP2][I2S]Changing aplay between media playback/headset,noise occurred at the beginning[/-] [+][BUG][APL-UP2][I2S]The sound become louder suddenly at the beginning when changing aplay between media playback and headset[/+] on Nov 12, 2019
  6. sinahuang commented on Nov 12, 2019

    @sinahuang

    Issue still can be reproduced on TGL RVP with onboard ACL711 in SDW mod and ALC1308 in I2S mode.

    scenario1: aplay -Dhw:0,0 -r48000 -c2 -fs16_le cut.wav -vv -i-->the audio become louder at the beginning.

    scenario2:aplay -Dhw:0,0 -r48000 -c2 -fs16_le cut.wav -vv -i-->s3-->wake up-->the audio become louder at the beginning.

    Test recipe

    Kernel:https://github.com/thesofproject/linux/commits/integration/soundwire-latest commit: 2933f73
    FW: https://github.com/thesofproject/sof/commits/master commit: d1dcdfe
    Tplg: Same with TGL FW branch commit: sof-tgl-rt711-rt1308-nohdmi.tplg rename to sof-tgl-rt711-rt1308.tplg
    Platform:TGL RVP with onboard ACL711 in SDW mod and ALC1308 in I2S mode.

    demsg.log
    sof_error_trace.log
    sof_trace.log

  7. dengyangchao commented on Nov 12, 2019

    @dengyangchao

    Issue can not reproduce on:
    CFL-S RVP with onborad codec ALC700 in HDA mode
    ICL RVP with onborad codec ALC700 in HDA mode
    GLK Chrome with onbord codec DA7219 in I2S mode
    APL UP2 nocodec
    BYT MB nocodec
    BYT MB rt5682 in I2S mode

    Issue can reproduce on:
    APL UP2 with codec PCM512X in I2S mode
    TGL RVP with onboard ALC711 in SDW mod and ALC1308 in I2S mode
    CML SDW Laptop with ALC711+ ALC1308+ ALC715

  8. plbossart commented on Nov 12, 2019

    @plbossart
    Member

    @dengyangchao I don't understand your results and the description of the bug.

    On APL Up2, there is a single output, so we cannot change between media and headset. The bug description is misleading, I have no idea what to look for.

    On SDW platforms, you did you clarify on which output the sound is 'too loud'? Is this a problem with the speaker outputs? with the headset? both?
    And btw the headset and speakers are completely independent, so when you switch from one to the other, it's equivalent to waiting for the same output to go through a pm_runtime suspend/resume cycles (typically need 5s of idle).

    Please clarify what the problem really is and how you observe it, thanks.

  9. dengyangchao commented on Nov 13, 2019

    @dengyangchao

    @plbossart
    1.For APL UP2 change aplay between media(hw0,4) and headset(hw0,0) actual is hw 0,4 <=>hw0,0.
    2.For TGL RVP with onboard ALC711 in SDW mod and ALC1308 in I2S mode, hw0,0 is headset, and TGL can reproduce the issue in 2 scenarios, when pm_runtime from idle to active or wake up from S3 during aplay headset(hw0,0).

  10. Liviali155 commented on Nov 13, 2019

    @Liviali155
    Author

    I retested on APL UP2 with codec PCM512X in I2S mode,the problem is
    Output very loud at the beginning when aplay via (0,0) or media playback(0,4) from Runtime PM status suspend mode

  11. changed the title [-][BUG][APL-UP2][I2S]The sound become louder suddenly at the beginning when changing aplay between media playback and headset[/-] [+][BUG][APL-UP2][I2S]Output very loud at the beginning when aplay via headset(0,0) or media playback(0,4) from Runtime PM status suspend mode[/+] on Nov 13, 2019
  12. plbossart commented on Nov 13, 2019

    @plbossart
    Member

    Sorry, I don't get the issue. Your wording combines changes to the output as well as suspend/resume, that's two separate cases which can be tested separately

    I think you should first focus on suspend-resume and describe the issue there.

    The change from outputs does not happen usually at the alsa hardware device level.

  13. Liviali155 commented on Nov 14, 2019

    @Liviali155
    Author

    Sorry, I don't get the issue. Your wording combines changes to the output as well as suspend/resume, that's two separate cases which can be tested separately

    I think you should first focus on suspend-resume and describe the issue there.

    The change from outputs does not happen usually at the alsa hardware device level.

    1.sudo reboot
    2. wait the runtime_status is suspend,then aplay via (0,0) or (0,4)media playback can reproduce this issue
    if the runtime_status is still active ,then you aplay via (0,0) or (0,4) media play back,can not reproduce this issue

  14. 10 remaining items

  15. Liviali155 commented on Nov 19, 2019

    @Liviali155
    Author

    @Liviali155 Why put this issue in Linux? I through this would be FW issue.

    @tlauda Please take a look here.

    Test with Logic Analysis and got some result: (above is capture with external USB card, below is raw data from LA result from SSP5 from UP2)
    12.txt
    image

    I think something wrong with the volume and PM is make chaos here. If I start 2 playback with very short delay. It seems the second playback will not have such issue.
    image

    @Liviali155 @ClarexZhou Please try :

    1. with runtime PM disabled.
    2. with volume change with nocodec.

    1.with runtime PM disabled
    after disabled PM , error not seen
    2. with volume change with nocodec.
    tested with nocodec with aplay -Dhw:0,5 -r48000 -c2 -fs16_le sine_48k_stereo_440.wav & arecord -Dhw:0,5 -c2 -r48000 -fs32 t1st.wav -vv -i,error can reproduce,at the beginning the volume is very loud,but when change volume during aplay can not reproduce this issue

    Capture

  16. singalsu commented on Nov 19, 2019

    @singalsu
    Collaborator

    @singalsu I think so.

    Here is my question, if we find we are restore a volume change, do we still need to make the ramp up/down? For this case, we should make the volume start as the restore volume right?

    It would be better if the volume would ramp in playback start would be from mute/min to actual. Do you know why does suspending impact this (apparently this does not happen always)? I feel this is a driver issue even if initializing to mute instead of 0 dB in volume new() might help in this case.

  17. dengyangchao commented on Dec 9, 2019

    @dengyangchao

    GLK speaker pipeline(HW:0,0) can reproduce the issue.
    below two scenarios can reproduce:

    1. PM runtime suspend ->playback via speaker
    2. Playback via speaker -> suspend&resume

    Platform: GLK Chrome with onboard codec DA7219 in I2S mode
    Firmware: 65de27d https://github.com/thesofproject/sof/commits/master
    Kernel: 7c7cc04 https://github.com/thesofproject/linux/commits/topic/sof-dev
    Topology: file: tools/topology/sof-glk-da7219.tplg same as firmware

    dmesg.log
    logger.log

  18. changed the title [-][BUG][APL-UP2][I2S]Output very loud at the beginning when aplay via headset(0,0) or media playback(0,4) from Runtime PM status suspend mode[/-] [+][BUG]Output very loud at the beginning when aplay via headset(0,0) or media playback(0,4) from Runtime PM status suspend mode[/+] on Dec 9, 2019
  19. singalsu commented on Dec 17, 2019

    @singalsu
    Collaborator

    @dengyangchao Could you test if SOF PR thesofproject/sof#2109 helps with this issue. The PR is for capture but the part of PR that forces volume component to start with ramp from mute even if the driver does not request it should impact this issue as well.

  20. Liviali155 commented on Dec 19, 2019

    @Liviali155
    Author

    @dengyangchao Could you test if SOF PR thesofproject/sof#2109 helps with this issue. The PR is for capture but the part of PR that forces volume component to start with ramp from mute even if the driver does not request it should impact this issue as well.

    Tried with thesofproject/sof#2109,error not seen on below platforms:
    APL UP2 with codec PCM512X in I2S mode
    GLK Chrome with onboard codec DA7219 in I2S mode

    Capture

    Capture1

  21. sinahuang commented on Dec 20, 2019

    @sinahuang

    Verified this issue with thesofproject/sof#2109 on below platform, issue can not be reproduced.
    TGL-U RVP with codec ALC711 in SDW mode and RT1308 in I2S mode
    CML-H Laptop with codec ALC711, 2 x RT1308, RT715 in SDW mode

  22. Liviali155 commented on Jan 17, 2020

    @Liviali155
    Author

    closed it , PR #2109 merged

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

Metadata

Metadata

Assignees

Labels

APLApplies to ApolloLake platformCMLApplies to Comet Lake platformGLKApplies to Gemini LakeP2Critical bugs or normal featuresTGLApplies to Tiger Lake platformbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions