Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] byt media pipeline produces distortion with 44.1kHz to 48kHz conversion #1482

Closed
juimonen opened this issue May 28, 2019 · 13 comments · Fixed by #1722
Closed

[BUG] byt media pipeline produces distortion with 44.1kHz to 48kHz conversion #1482

juimonen opened this issue May 28, 2019 · 13 comments · Fixed by #1722
Assignees
Labels
bug Something isn't working as expected BYT Applies to Baytrail platform

Comments

@juimonen
Copy link

Describe the bug
playback of 44.1kHz files to byt media pipe (hw:0,1) produces distortion. SRC in this case reads/writes with alternating frame count. Not observable in apl, so suspect dw-dma, even more copy_one_shot in host.c.

To Reproduce
playback 44.1kHz file to byt media pipe. You might need to change byt media pipe params in topology to same as in apl media pipe topology. Without this change you will get 8x speed from media pipe (which should be also debugged).

Reproduction Rate
Always.

Expected behavior
Clean sound

Impact
showstopper

Environment

  1. kernel:latest, fw:latest
  2. topology: sof-byt-rt5682.tplg
  3. platform:byt
  4. Reproducibility Rate. Always

Screenshots or console output
We have gaps in about every 1000-1200 samples
byt

@juimonen juimonen added the bug Something isn't working as expected label May 28, 2019
@lgirdwood
Copy link
Member

@juimonen can you confirm compiler used. Iirc SRC will use HiFi2EP intrinsics on BYT whilst it uses HIFI3 on APL.

@juimonen
Copy link
Author

@lgirdwood I'm using gcc here. this really seems like a buffer wrap issue etc. to me the discontinuity seems to coincide quite nicely with host split dma transfer but can't be sure. I think SRC calculation issue would produce much worse results...

@singalsu
Copy link
Collaborator

@lgirdwood Good point, need the information.

There's the thing that the SRC with HiFiEP intrinsics is not yet fixed for timer based scheduling (at that time no xtensa built testbench, no device to test it a while ago - now I can at least test with device again so I should do it).

SRC on BYT should work with gcc build but not with xt-xcc build. I updated only the HiFi3 intrinsincs version with previous update.

@singalsu
Copy link
Collaborator

@juimonen Thanks, then it's not the non-updated HiFiEP intrinsics issue.

@juimonen
Copy link
Author

btw there's little bit similar issue @singalsu found on 0,0 device:
#1487

@juimonen
Copy link
Author

you need #1489 even to try this in byt

@juimonen
Copy link
Author

@tlauda you have any "quick" cure for this? I'm not sure I'm interpreting correctly but is this like "dma_copy_one_shot" always copying the same fixed amount of data and not taking into account the actual needed data size?

@tlauda
Copy link
Contributor

tlauda commented May 31, 2019

@juimonen Yes, but it was always like this. The question is, if this has ever worked for BYT?

@juimonen
Copy link
Author

@tlauda hmm I'm quite new with byt, so not sure. It was also only recently that the SRC coefficients we're "downscaled" to be able to run without xruns with gcc compilation. Can't we just set the transfer size and start position in copy_one_shot? I think the dma callback at least should handle buffer wraps etc.

@tlauda
Copy link
Contributor

tlauda commented May 31, 2019

@juimonen It's not so easy to do, but of course can be accomplished. I haven't touched it, since I don't have any BYT platforms.

@juimonen
Copy link
Author

@singalsu so has this ever worked for youin byt? I think you we're using xt-xcc compilation and running src?

@singalsu
Copy link
Collaborator

singalsu commented May 31, 2019

@juimonen The media pipeline worked a long time ago in BYT but it suffered from same regular glitches as the low latency pipe prior to SOF 1.1. So, it's very long time ago since it last worked. It stopped to work in SOF 1.1 I recall.

I've kept the SRC relaxed always for gcc so both versions have executed in real-time in BYT. I'm myself building & testing stuff nearly always with gcc.

@juimonen
Copy link
Author

@singalsu @tlauda so am I interpreting this correctly that this has never worked correctly in byt with dw-dma?

@tlauda tlauda added the BYT Applies to Baytrail platform label Jun 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as expected BYT Applies to Baytrail platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants