Adding streams with different fetch time may cause underrun |
|||
Issue descriptionThat is because the new stream will be fetched at the same time of the first stream next fetch. There is the example below(Attachment). 1. Add stream 1 with 1024 stream buffer size. We have a common hardware level. 2. Add stream 2 with 567 stream buffer size. We have a common hardware level with two streams. 3. Add stream 3 with 1024 stream buffer size. Because the first fetch time of stream 3 is set as the next fetch time of stream 1, we can not mix and write any frames during this time (There are no data in stream 3 buffer). It causes hardware level decrease. 4. Remove stream 2 and stream 1. We will get stream 3 with lower hardware level. 5. Take stream 3 as stream 1 and repeat these steps. We can easily trigger underrun. This bug happens when we play in youtube and in built-in player at the same time. Youtube open new stream when the video changing so it will easily happen if we play them for a long time.
,
Jul 19
Maybe we can choose the nearest fetch time to instead. I'm trying to fix it.
,
Jul 25
The following revision refers to this bug: https://chromium.googlesource.com/chromiumos/third_party/adhd/+/c10d1394cab788d93432ceb045545b0d1dde99d0 commit c10d1394cab788d93432ceb045545b0d1dde99d0 Author: Yu-hsuan Hsu <yuhsuan@google.com> Date: Wed Jul 25 07:14:46 2018 CRAS: audio_thread - modify initial callback time for new streams Using next callback time of first stream may cause underrun. We need to use earliest instead. BUG= chromium:865338 TEST=I wrote a script to create new streams with different buffer size. It causes underrun in previous version. The bug is fixed in this change. Change-Id: Iad5f1d492a6043ef993ffbe98ae575065d1ffefa Reviewed-on: https://chromium-review.googlesource.com/1143165 Commit-Ready: Yu-Hsuan Hsu <yuhsuan@chromium.org> Tested-by: Yu-Hsuan Hsu <yuhsuan@chromium.org> Reviewed-by: Dylan Reid <dgreid@chromium.org> [modify] https://crrev.com/c10d1394cab788d93432ceb045545b0d1dde99d0/cras/src/server/audio_thread.c
,
Aug 2
|
|||
►
Sign in to add a comment |
|||
Comment 1 by yuhsuan@chromium.org
, Jul 19