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

qalsaaudiooutput.cpp/open: really need to check for availableDevices()?

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • Not Evaluated
    • 5.10.0
    • None
    • Multimedia
    • None
    • Linux, especially embedded on a not-state-of-the-art hardware.

    Description

      QAlsaAudioDeviceInfo::availableDevices(...) in QAlsaAudioOutput::open() takes a non-negligible time to complete, especially on an embedded system. Do we really need to check if the opened device is listed in it, or could we just trust the caller and / or the fact that the subsequent calls to snd_pcm_open() will fail (although it will try 5 times)?

      I raise this issue / suggestion because, for example, the SoundEffect QML object opens the device each time it plays a sound, and this delay could increase the response time, mostly when there are more than one sound playing at the same time. Moreover, this delay sits in the main / gfx thread, and that slows down graphics (re-) drawing.

      The fix one immediately thinks of is the most obvious: comment or remove the lines testing for this (lines 319 / 320 of the file).

      Attachments

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

        Activity

          People

            valentyn.doroshchuk Valentyn Doroshchuk
            midnite Alexandre Jousset
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes