Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-128181

[macOS] QAudioSink chooses a default buffer size that's too small, causes buffer underruns

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P2: Important
    • None
    • 6.5.6, 6.7.2, 6.8.0 Beta3
    • Multimedia
    • macOS 13.5.2 (M1), Xcode 14.2
    • macOS
    • Multimedia wk 31-32, Multimedia wk 35-38, Multimedia wk 39-40, Multimedia wk 41-42

    Description

      In the attached project...

      1. The QAudioDecoder parses an MP3 file (source: https://samplelib.com/sample-mp3.html )
      2. The fully decoded file is stored in a QBuffer
      3. After that, a QAudioSink is initialized using the QAudioFormat that's calculated by the QAudioDecoder
      4. Finally, the QAudioSink is used to play the QBuffer data.

       

      Outcomes

      • On Windows, the QAudioSink's internal buffer is 176400 bytes, and playback is smooth.
      • On macOS, the QAudioSink's internal buffer is 8192 bytes, and playback stutters with frequent BufferUnderrun errors.

       

      Workaround
      Manually call QAudioSink::setBufferSize() to set a larger buffer

       

      Notes
      Interestingly, playback on macOS is smooth if the QGuiApplication is replaced with a QCoreApplication

      Attachments

        Issue Links

          For Gerrit Dashboard: QTBUG-128181
          # Subject Branch Project Status CR V

          Activity

            People

              tpochep Timur Pocheptsov
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes