Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved [Solved] - How can I tell Qt5 to use Alsa instead of PulseAudio?

    General and Desktop
    sound alsa pulse audio
    2
    2
    484
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      RedMarsBlueMoon last edited by RedMarsBlueMoon

      Hi!

      I have a situation where Qt5 keeps trying to use PulseAudio when we want it to try to use Alsa first.
      Alsa is supported in the Qt build but Qt keeps trying to use Pulse and then not playing any sound when that doesn't work.

      We found that we can remove libqtmedia_pulse.so and then it will work and play sound but that's not a good solution.

      We also don't want to exclude Pulse from the Qt build as some people might be using it.

      How should we convince Qt to use Alsa instead?

      UPDATE: I solved this by iterating though the available devices and looking for the one I knew should work.
      I'm thinking we could add a popup menu with some of the available devices and the user can change to PulseAudio if they want.

      Cheers
      Fred

      1 Reply Last reply Reply Quote 1
      • P
        Puya last edited by

        @RedMarsBlueMoon How do you iterate through the available devices? Could you give a code snippet? We use QtQuick and use the Audio component to play audio. So nowhere in the code do we get a list of audio devices or iterate through them.

        1 Reply Last reply Reply Quote 1
        • First post
          Last post