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

[WinRT] WASAPI plugin regression

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.8.0 Beta
    • 5.8.0 Alpha
    • Multimedia
    • None
    • WinRT
    • WinRT
    • 36db73a319a45f5aab579fd9d7031c5ab09f2757

    Description

      Regression caused by Change-Id: I8ace78858976fe7c60a2c4a117ef15c4e1bb177f

      This change adds a new QWasapiUtils::defaultDevice(...) that by-passes QWasapiUtils::availableDevices(...), but unfortunately availableDevices has couple of side effects that are not triggered.

      Namely it fills these global mappings

          QList<QByteArray> &deviceNames = mode == QAudio::AudioInput ? gMapping->inputDeviceNames : gMapping->outputDeviceNames;
          QList<QString> &deviceIds = mode == QAudio::AudioInput ? gMapping->inputDeviceIds : gMapping->outputDeviceIds;
      

      While enumerating devices. Later on when QWasapiUtils::createOrGetInterface is called it will always fail/assert when is called either in:

      Q_ASSERT((mode == QAudio::AudioInput ? gMapping->inputDeviceNames.indexOf(dev) : gMapping->outputDeviceNames.indexOf(dev)) != -1);
      

      Or crash/fail few lines below in:

      QString id = mode == QAudio::AudioInput ? gMapping->inputDeviceIds.at(gMapping->inputDeviceNames.indexOf(dev)) :
                                                        gMapping->outputDeviceIds.at(gMapping->outputDeviceNames.indexOf(dev));
      

      Secondly even if QAudioDeviceInfo::availableDevices(...) is called to force population of theses list it will still fail because the dev parameter that is being passed is no longer device name, but the actual id (did not analyze futher).

      Workaround, never invoke QAudioDeviceInfo::defaultInputDevice() / QAudioDeviceInfo::defaultOutputDevice() under WinRT. Just enumerate manually using QAudioDeviceInfo::availableDevices(...), but hopefully fixed before 5.8 release.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            mkalinow Maurice Kalinowski
            kristjanbb Kristján Birgisson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes