Skip to content

[BUG] ASoC: cpu DAI prepare error on GLK #828

Closed

Description

@keqiaozhang

Describe the bug
ASoC: cpu DAI prepare error when loading tplg.

To Reproduce
This issue happens at boot stage.

Expected behavior
Tplg load successful.

Impact
backend prepare failed -22

Environment

  1. Kernel: origin/topic/sof-dev-46c2b852
    Firmware: origin/cml-003-drop-stable-4731a1
  2. tplg name:sof-glk-da7219.tplg
  3. GLK Chromebook.
  4. Reproducibility Rate:100%

Screenshots or console output

aplay -Dhw:0,5 -f dat -c 2 test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
aplay: set_params:1403: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 48000
PERIOD_TIME: 85000
PERIOD_SIZE: 4080
PERIOD_BYTES: 16320
PERIODS: (4 5)
BUFFER_TIME: 341000
BUFFER_SIZE: 16368
BUFFER_BYTES: 65472
TICK_TIME: 0

dmesg

[  472.091879] sof-audio-pci 0000:00:0e.0: pcm: stream dir 0, posn mailbox offset is 790528
[  472.091896] sof-audio-pci 0000:00:0e.0: ASoC: cpu DAI prepare error: -22
[  472.091900]  iDisp1: ASoC: backend prepare failed -22
[  472.092197] sof-audio-pci 0000:00:0e.0: pcm: free stream 5 dir 0

dmesg.log
trace.log

Activity

  1. added
    bugSomething isn't working
    P1Blocker bugs or important features
    GLKApplies to Gemini Lake
    on Apr 12, 2019
  2. xiulipan commented on Apr 12, 2019

    @xiulipan

    @ranj063
    I had a quick look and the -22 should be returned form following code, right?

    static int hda_link_pcm_prepare(struct snd_pcm_substream *substream,
    struct snd_soc_dai *dai)
    {
    struct snd_soc_pcm_runtime *rtd = substream->private_data;
    struct snd_sof_dev *sdev =
    snd_soc_component_get_drvdata(dai->component);
    struct snd_sof_pcm *spcm;
    int stream = substream->stream;
    spcm = snd_sof_find_spcm_dai(sdev, rtd);
    if (!spcm)
    return -EINVAL;

    @ranj063
    And any idea if we will need to find BE from snd_sof_find_spcm_dai?

    @xiulipan no, if you look at sof_load_dai(), we dont create spcm for a BE.

    Originally posted by @ranj063 in #816 (comment)

    If snd_sof_find_spcm_dai is not designed for find BE, why we are using it here?

  3. keqiaozhang commented on Apr 12, 2019

    @keqiaozhang
    Author

    Add more logs

    [  102.777150] sof-audio-pci 0000:00:0e.0: ipc tx succeeded: 0x60010000: GLB_STREAM_MSG: PCM_PARAMS
    [  102.777153] sof-audio-pci 0000:00:0e.0: pcm: stream dir 0, posn mailbox offset is 790528
    [  102.777170] sof-audio-pci 0000:00:0e.0: PXL: pcm id 7 | rtd id 3
    [  102.777172] sof-audio-pci 0000:00:0e.0: PXL: pcm id 6 | rtd id 3
    [  102.777174] sof-audio-pci 0000:00:0e.0: PXL: pcm id 5 | rtd id 3
    [  102.777176] sof-audio-pci 0000:00:0e.0: PXL: pcm id 99 | rtd id 3
    [  102.777177] sof-audio-pci 0000:00:0e.0: PXL: pcm id 1 | rtd id 3
    [  102.777179] sof-audio-pci 0000:00:0e.0: PXL: pcm id 0 | rtd id 3
    [  102.777181] sof-audio-pci 0000:00:0e.0: ASoC: cpu DAI prepare error: -22
    [  102.777183]  iDisp1: ASoC: backend prepare failed -22
    
    diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h
    index 35e78ffecce2..f3c7122b7474 100644
    --- a/sound/soc/sof/sof-priv.h
    +++ b/sound/soc/sof/sof-priv.h
    @@ -481,6 +481,7 @@ struct snd_sof_pcm *snd_sof_find_spcm_dai(struct snd_sof_dev *sdev,
            struct snd_sof_pcm *spcm = NULL;
    
            list_for_each_entry(spcm, &sdev->pcm_list, list) {
    +               dev_err(sdev->dev, "PXL: pcm id %zu | rtd id %zu\n",spcm->pcm.dai_id, rtd->dai_link->id);
                    if (le32_to_cpu(spcm->pcm.dai_id) == rtd->dai_link->id)
                            return spcm;
            }
  4. added
    WHLApplies to WhiskeyLake platform
    CMLApplies to Comet Lake platform
    HDAApplies to HD-Audio bus for codec connection
    on Apr 12, 2019
  5. ranj063 commented on Apr 12, 2019

    @ranj063
    Collaborator

    If snd_sof_find_spcm_dai is not designed for find BE, why we are using it here?

    @xiulipan ack. working on it. will get back asap.

  6. libinyang commented on Apr 13, 2019

    @libinyang

    it seems the regression of #795?

  7. mengdonglin commented on Apr 15, 2019

    @mengdonglin

    Can be fixed by PR #834, waiting for fixing CI error and getting merged.

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

Metadata

Metadata

Assignees

Labels

CMLApplies to Comet Lake platformGLKApplies to Gemini LakeHDAApplies to HD-Audio bus for codec connectionP1Blocker bugs or important featuresWHLApplies to WhiskeyLake platformbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions