Skip to content

[BUG IMX] Playback and capture occasionally fails #3809

Closed

Description

@iuliana-prodan

Describe the bug
Playback and capture occasionally fails with Input/output error

To Reproduce
Run playback and capture simultaneously.
Or run the script below:

#!/bin/bash

test_aplay()
{
    while true
    do
        aplay -Dhw:1,0 -f S32_LE -c 2 -r 48000 -t raw test_play.wav
    done
}

test_arecord()
{
    while true
    do
        arecord  -Dhw:1,0 -f S32_LE -c 2 -r 48000 -d 5 test_record.pcm
    done
}

test_aplay &
test_arecord

Reproduction Rate
20%

Environment

  1. Branch name and commit hash of the 2 repositories: sof (firmware/topology) and linux (kernel driver).
    • Kernel: 5.10
    • SOF: master, imx-stable-v1.5, imx-stable-v1.6.
  2. Name of the topology file
    • Topology: sof-imx8qxp-wm8960.tplg, sof-imx8qxp-cs42888-mixer.tplg, sof-imx8mp-wm8960.tplg
  3. Name of the platform(s) on which the bug is observed.
    • Platform: i.MX8QXP/i.MX8QM/i.MX8MP

Screenshots or console output

root@imx8qmmek:~# audio_dsp_sof.sh -t 4 -c wm8960 -f p -n 50
DSP_SOF_PLAY_RECORD_WORK_TOGETHER    0  TINFO  :  test 4: DSP_SOF_PLAY_RECORD_WORK_TOGETHER 
TINFO  :  Do full hardware capacity test 
TINFO  :  Do full hardware capacity test 
TINFO  :  Start audio test, please check the HEADPHONE,hear if there is voice.
TINFO  :  Audio TEST: Total 3 combinations of formats. 
TINFO  :  No.[1] Now playing audio stream with format S16_LE, channel 2,sample rate 48000
TINFO  :  Test #1: ADC record test. Headphone is need to check the voice and quality of recording.
TINFO  :  Audio TEST: Total 3 combinations of formats. 
TINFO  :  No.[1] Now Recording audio stream with format S16_LE, channel 2,sample rate 48000
TINFO  :  No.[2] Now playing audio stream with format S24_LE, channel 2,sample rate 48000
TINFO  :  No.[3] Now playing audio stream with format S32_LE, channel 2,sample rate 48000
TINFO  :  No.[2] Now Recording audio stream with format S24_LE, channel 2,sample rate 48000
TINFO  :  Start audio test, please check the HEADPHONE,hear if there is voice.
TINFO  :  Audio TEST: Total 3 combinations of formats. 
TINFO  :  No.[4] Now playing audio stream with format S16_LE, channel 2,sample rate 48000
TINFO  :  No.[5] Now playing audio stream with format S24_LE, channel 2,sample rate 48000
TINFO  :  No.[3] Now Recording audio stream with format S32_LE, channel 2,sample rate 48000
TFAIL  :  ltpapicmd.c:188: Test #1: Playing back audio48k24b2c_sle.pcm Failed on hw:1,0
Playing raw data '/tmp/tmpfs/tmp.jWsafwNfuh/audio48k24b2c_sle.pcm' : Signed 24 bit Little Endian, Rate 48000 Hz, Stereo
aplay: pcm_write:2061: write error: Input/output error
TINFO  :  No.[6] Now playing audio stream with format S32_LE, channel 2,sample rate 48000
TINFO  :  Test #1: ADC record test. Headphone is need to check the voice and quality of recording.
TINFO  :  Audio TEST: Total 3 combinations of formats. 
TINFO  :  No.[4] Now Recording audio stream with format S16_LE, channel 2,sample rate 48000
TFAIL: Audio Playback test fails in loop time 2
TFAIL: Test Failed on below file: audio48k24b2c_sle.pcm 
TGE_LV_DAC2    1  TFAIL  :  ltpapicmd.c:188: Test FAIL
^CTFAIL: Test #1: Recording audio48k16b2c_sle.pcm Failed on hw:1,0
Recording raw data '/tmp/tmpfs/tmp.Nzsd3l5HpA/audio48k16b2c_sle.pcm' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Aborted by signal Interrupt...
^C^Caplay: no process found
arecord: no process found

root@imx8qmmek:~# ^C

Activity

  1. added 2 commits that reference this issue on Mar 15, 2021
    1fa1001
    f60adbb
  2. added 4 commits that reference this issue on Mar 15, 2021
    d8a4473
    4ef93fc
    cdf87b9
    ffc6eaf
  3. paulstelian97 commented on Mar 16, 2021

    @paulstelian97
    Collaborator

    Is this issue fixed?

  4. iuliana-prodan commented on Mar 16, 2021

    @iuliana-prodan
    ContributorAuthor

    Is this issue fixed?

    Yes, fixed by #3867.
    Another issue remains, after hundreds of playback/record we get:

    Playing raw data '16/j16.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    Playing raw data '16/j16.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    Recording WAVE 'test_record.pcm' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    [  582.814139] sof-audio-of 556e8000.dsp: error: ipc timed out for 0x60050000 size 12
    [  582.821802] sof-audio-of 556e8000.dsp: info: preventing DSP entering D3 state to preserve context
    [  582.830906] sof-audio-of 556e8000.dsp: invalid header size 0x2000200. FW oops is bogus
    [  582.838989] sof-audio-of 556e8000.dsp: error: unexpected fault 0x00000000 trace 0x00000000
    [  582.847530] sof-audio-of 556e8000.dsp: error: waking up any trace sleepers
    [  582.854601] sof-audio-of 556e8000.dsp: error: trace IO error
    [  582.861198] sof-audio-of 556e8000.dsp: ASoC: error at snd_soc_pcm_component_trigger on 556e8000.dsp: -110
    [  582.871466]  Port0: ASoC: trigger FE cmd: 0 failed: -110
    Playing raw data '16/j16.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    Recording WAVE 'test_record.pcm' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    aplay: pcm_write:2061: write error: Input/output error
    (null)      1  TFAIL  :  ltpapicmd.c:188: Test 420 Playback failed
    Recording WAVE 'test_record.pcm' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    Recording WAVE 'test_record.pcm' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
    

    But his will be handled in another issue.

  5. paulstelian97 commented on Mar 16, 2021

    @paulstelian97
    Collaborator

    Just checked, sometimes issues are accidentally closed by merging of pull requests on GH (the "fixes" keyword does that)

  6. lgirdwood commented on Mar 16, 2021

    @lgirdwood
    Member

    @iuliana-prodan is this working in v1.7 ? @keyonjie has created a PR pulling all the fixes ready for final release ? so please let me know if anything is missing ?

  7. iuliana-prodan commented on Mar 16, 2021

    @iuliana-prodan
    ContributorAuthor

    @lgirdwood yes, is working on v1.7. But these patches are not included in @keyonjie PR #3914
    Can I push these patches on #3914 or @keyonjie will update that PR?

  8. lgirdwood commented on Mar 16, 2021

    @lgirdwood
    Member

    @iuliana-prodan just send another PR with your patches for v1.7

  9. added 2 commits that reference this issue on Mar 18, 2021
    fb382d1
    6bd87a3
  10. added 2 commits that reference this issue on Mar 18, 2021
    c5178c3
    28436ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

IMXApplies to i.MX platformbugSomething isn't working as expected

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions