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

masOS audio deadlock with AudioOutputUnitStart / AudioOutputUnitStop

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.2, 6.5, 6.6
    • 5.15.12, 5.9, 6.2.6
    • Multimedia
    • None
    • macOS 13.0, 13.1, 13.2
    • macOS
    • 919b3d308 (dev), ff5d7e0c1 (6.5), a16dd3377 (6.5.0), 03a44e5a6 (6.4), 83f646723 (tqtc/lts-6.2), d2b4d94ae (dev), f7b737610 (6.5), 202c64edc (6.6)

    Description

      Our application has been freezing for some users on macOS 13.

      I was able to get the user to grab a process sample, which I will attach.

      It shows the main thread calling CoreAudioOuput::start, which calls AudioOutputUnitStart, and is stuck holding a lock.

      You can also see the "com.apple.audio.IOThread.client" thread has called AudioOutputUnitStop from the renderCallback, and it is holding a different lock.

      I was able to duplicate this across three versions of Qt.

      In this use case, our application starts and stops audio playback frequently. However, we've never had reports of this hang until recently.

      It is supposed to be that if you call AudioOutputUnitStop from the I/O callback, the I/O callback should not be called again until it is restarted. However, I think that macOS 13 has broken this.

      In any case, the issue can be fixed by ensuring that AudioOutputUnitStart and AudioOutputUnitStop cannot be called at the same time.

      I added a sample application that demonstrates the issue.

      Attachments

        1. audio-hang.txt
          148 kB
        2. macos_audio_hang2.diff
          1.0 kB
        3. QTBUG-111567.zip
          5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lars.sutterud Lars Sutterud
            dzedsystems Dyami Caliri
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes