Skip to content

pcm_read error occurs when capturing with nocodec DMIC #275

Closed

Description

@markyang

Summary:
pcm_read error occurs when capturing with nocodec DMIC.

Test steps:

  1. arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: sofnocodec [sof-nocodec], device 0: Port0 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 1: Port1 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 2: Port2 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 3: Port3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 4: Port4 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 5: Port5 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: sofnocodec [sof-nocodec], device 6: DMIC01 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

--
2. arecord -Dhw:0,6 -fS32_LE -c2 -r 48000 -vv -i /dev/null

Recording WAVE '/dev/null' : Signed 32 bit Little Endian, Rate 48000 Hz, Stereo
Hardware PCM card 0 'sof-nocodec' device 6 subdevice 0
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 8064
  period_size  : 1920
  period_time  : 40000
  tstamp_mode  : NONE
  tstamp_type  : MONOTONIC
  period_step  : 1
  avail_min    : 1920
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 8064
  silence_threshold: 0
  silence_size : 0
  boundary     : 9079256848778919936
  appl_ptr     : 0
  hw_ptr       : 0
arecord: pcm_read:2103: read error: Input/output error

Test env:
sof master: 5838f71,73475e3f
sof tool: 2cd668c
kernel sof-dev: 9b81e16,165b34de
tplg: sof-apl-nocodec.tplg-2cd668c

Log:
dmesg-apl-dmic.log
logger-apl-dmic.log
logger-apl-t-dmic.log

Activity

  1. added
    bugSomething isn't working
    P2Critical bugs or normal features
    APLApplies to ApolloLake platform
    on Nov 13, 2018
  2. ranj063 commented on Nov 13, 2018

    @ranj063
    Collaborator

    @keyonjie @plbossart this is due to the added reserved bytes in struct sof_ipc_dai_dmic_params.

    Removing the reserved bytes fixes the issue but I cant understand why it would fail in the first place.

  3. ranj063 commented on Nov 13, 2018

    @ranj063
    Collaborator

    @mengdonglin @libinyang I already have a fix for this. I will submit a PR soon.

  4. ranj063 commented on Nov 13, 2018

    @ranj063
    Collaborator

    @plbossart the issue is because of the bug in the incorrect dai_config during link_load() while parsing topology

  5. plbossart commented on Nov 13, 2018

    @plbossart
    Member

    @ranj063 sorry, what "incorrect dai_config" bug are you referring to?

  6. ranj063 commented on Nov 13, 2018

    @ranj063
    Collaborator

    @plbossart this issue is specific to DMIC dai_config. But after sending the ipc to set the dai config in link_load(), the last step is to save the config for all dai's so it can be restored upon resuming from runtime suspend. At the moment only sizeof(struct sof_ipc_dai_config) bytes get copied. In the case of dmic, there are variable number of pdm controller configs making it larger than this size. I am still working on the PR to fix it. I will submit it soon.

  7. plbossart commented on Nov 14, 2018

    @plbossart
    Member

    please test and check PR283 fixes the issue.

  8. plbossart commented on Nov 17, 2018

    @plbossart
    Member

    @markyang can you please close this issue unless you still see a problem?

  9. markyang commented on Nov 19, 2018

    @markyang
    Author

    Summary:
    The issue cannot be reproduced any more.

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 platformP2Critical bugs or normal featuresbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions