Skip to content

[BUG]Glitches in beginning of playback via SRC pipe #1843

Closed

Description

@singalsu

Describe the bug
Especially with 48 kHz content playback to Media Playback device the first fraction of a second has discontinuities in output waveform. The effect can be heard when listening carefully.

Witht other sample rates like 32 kHz there's typically one glitch. 48 kHz has several (5).

To Reproduce
Playback of 48 kHz content to hw:0,4 device in UP^2 with default topology sof-apl-pcm512x.tplg.

Reproduction Rate
Always.

Expected behavior
Clean playback start.

Impact
It's an annoyance.

Environment

  1. Branch name and commit hash of 3 repositories: sof (firmware), linux (kernel driver) and soft (tools & topology).
  2. Name of the topology file
  3. Name of the platform(s) on which the bug is observed.
  4. Reproducibility Rate. If you can only reproduce it randomly, it’s useful to report how many times the bug has been reproduced vs. the number of attempts it’s taken to reproduce the bug.

Screenshots or console output
up2_hw04_48k_play
up2_hw04_32k_play

Activity

  1. added
    bugSomething isn't working as expected
    P3Low-impact bugs or features
    on Sep 19, 2019
  2. lgirdwood commented on Sep 30, 2019

    @lgirdwood
    Member

    @singalsu I assume SRC is reading ahead ? It could just be we need to zero all SRC source buffer before we start.

  3. tlauda commented on Oct 11, 2019

    @tlauda
    Contributor

    @singalsu On BYT it looks even worse with 48 kHz:

    image

  4. self-assigned this
    on Oct 24, 2019
  5. singalsu commented on Oct 24, 2019

    @singalsu
    CollaboratorAuthor

    My recording setup is now fixed (rt kernel, jack, from Ubuntu studio). I still get a glitch always into about 100 ms before UP2+Hifiberry playback stop with other than 48 kHz rates. FW is today's git master as well as default topology used sof-apl-pcm512x.tplg topology. This is gcc build.

    Screenshot from 2019-10-24 12-27-24

    Otherwise the playback looks clean. This was playback at 44.1 kHz rate and S24_LE format. The result is identical with S16_LE and S32_LE formats.

  6. singalsu commented on Oct 24, 2019

    @singalsu
    CollaboratorAuthor

    @singalsu I assume SRC is reading ahead ? It could just be we need to zero all SRC source buffer before we start.

    SRC is not exceeding what's available in source. There used to be a pre-fill in 1st copy() for conversions those cannot produce worth of 1 ms output (if that's the scheduling) in first copy() with 1 ms of input data. But it's no more used since with timer based scheduling the amounts to process are more fuzzy, can't compute in advance the need for pre-fill. Though adding some guessed pre-fill could be added if the component down-stream to SRC starves. But I don't think this is from it since this happens with easy conversions as well like 32 -> 48 kHz where SRC can output exactly the 48 frames per copy(). With easy conversions the internal block size is small so it can output e.g. 45, 48, or 51 frames while consuming 30, 32, or 34 frames (for 32 -> 48 kHz).

  7. singalsu commented on Oct 24, 2019

    @singalsu
    CollaboratorAuthor

    I think this bug should be closed (and a new one to be entered) if the playback on BYT has also become clean as it has been on APL.

    Concerning this glitch near playback end some notes.

    • The glitch is still near end when playing back much longer 30s clip, the reported clip was 1s. It confirms the issue is not 900 ms from beginning as it could have also been.

    • The same happens if I press ctrl-c during aplay for 30s clip after about 5s time. The glitch shows up near end of recorded sine burst (did once, it was 200 ms before end).

    • The simpler SRC pipeline in topology sof-apl-src-pcm512x.tpl does not have this issue. The tested pipeline with glitch issue is more complex with two volume components and one mixer.

    • In a similar test carried out by @tlauda with test pipeline host - vol - src - vol - dai, in use case 44.1 -> 48, s24 no glitches observed.

    • Also the captured sine wave bust is 1.1s long when the wav clip is 1.0s long. Maybe the last 100ms is a copy of old buffers?

  8. tlauda commented on Oct 25, 2019

    @tlauda
    Contributor

    @singalsu Yes, it's clean also on BYT. Closing this one. Please create new bug.

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

Metadata

Metadata

Assignees

Labels

P3Low-impact bugs or featuresbugSomething 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