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

[macOS] Invalid preferredFormat is returned for iMac's built-in audio device

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.10.1, 6.11.0 Beta3
    • 6.9.3, 6.10.0
    • Multimedia
    • None
    • iMac, Retina 4k, 21.5-inch 2019
      3 Ghz, 6-core Intel Core i5
      Radeon Pro 560X 4 GB

      macOS 13.7.8 and 14.8.1
    • macOS
    • f3bfdb1c9 (dev), 474a7398d (6.10)
    • QtMM w44 - ....

      Invalid preferredFormat is returned for iMac's built-in audio device, see
      Environment section for full device specification.

      It seems doesn't depend on macOS version, reproduced on macOS 13.7.8 and 14.8.1 (tested on 2 machines with the same HW)

      I.e. it triggers an assertion in the next code, and any related functionality, e.g. QAudioSource::start() also does not work, when using a built-in device.

          const auto device = QMediaDevices::defaultAudioInput();
          const auto format = device.preferredFormat();
          Q_ASSERT(format.isValid());
      

      After some debugging, it was discovered that the root cause for the problem is that the sampleFormat parameter has the Unknown value for some reason.

      So, "preferred" format looks like:

      sampleRate = 44100, sampleFormat = Unknown, channelCount = 2
      

        1. screenshot-1.png
          343 kB
          Vladimir Belyavsky
        2. test_audio_config.log
          23 kB
          Vladimir Belyavsky
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            timblechmann tim blechmann
            studiosus Vladimir Belyavsky
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes