Results 1 to 7 of 7

Thread: Qt with pulseaudio - How to omit it?

  1. #1
    Join Date
    Nov 2011
    Location
    Poland
    Posts
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Qt with pulseaudio - How to omit it?

    It seems like new fashion to compile Qt libs with pulseaudio flag under Linux.
    When I'm using QAudio it hangs up if pulseaudio is not running.
    (running applicatins waits for it)
    It occurs f.e under Bodhi Linux - it has Qt with pulseaudio but pulseaudio is not installed by default.
    I understand - it is distibution problem but maybe I can avoid this.
    Is there any way to use this compiled pulse support in code?

  2. #2
    Join Date
    Nov 2011
    Location
    Poland
    Posts
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Qt with pulseaudio - How to omit it?

    I looked for some solutions and what I found:
    My application hangs in this place:
    Qt Code:
    1. QAudioDeviceInfo::availableDevices(QAudio::AudioOutput);
    To copy to clipboard, switch view to plain text mode 
    - when it tries to get devices list.
    Also I found that Qt pulseaudio support works by plug-in.
    QtMultimedia framework loads plug-in and it hangs when pa is not running.
    I tried to remove that plugin from Qt plugins dir and then my app started but it was deaf and muted - no audio devices were available.
    Maybe is there a way to unload that plugin from my app?
    Last edited by SeeLook; 15th February 2013 at 14:43.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt with pulseaudio - How to omit it?

    If you want audio to work without pulseaudio then you need another plugin that will take care of playback.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Nov 2011
    Location
    Poland
    Posts
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Qt with pulseaudio - How to omit it?

    You mean to write it myself?
    I didn't find any audio plugins under Arch Linux or Fedora.
    QtMultimedia and QAudioInput and QAudioOutput that I'm using just work out of the box.
    With and without pulseaudio.
    Problem exist under Ubuntu where Qt is compiled with pulseaudio as a plugin. As long as pulseaudio is running "QAudio" classes work but when naughty user turn it off....
    See above...

    Ubuntu derivatives goes forward. Bodhi Linux has ubuntish QtMultimedia with pulseaudio and no pulseaudio installed by default.
    KXStudio is pulseaudioless distro with JACK but it is based on Ubuntu and has Qtmultimedia with pulseaudio built-in.

    I have an idea how to detect Qt with pulseaudio plugin and check is pulse running - if not, to run my app without sound with some warnings for user.
    But I'm humble asking for some more user-frendly solution if any exist.

    To write my own plugin doesn't look good. If it is only way it will be better to switch to Portaudio instead of QtMultimedia.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt with pulseaudio - How to omit it?

    Quote Originally Posted by SeeLook View Post
    You mean to write it myself?
    No, I mean you have to have some means to play audio. If you can't use pulseaudio as the playback system then you need to have some other audio system (like alsa or whatever) if you want to have sound. If your Qt is built with a rule that "audio playback is provided by plugins" then without a working plugin it will not function properly.

    I have an idea how to detect Qt with pulseaudio plugin and check is pulse running - if not, to run my app without sound with some warnings for user.
    But I'm humble asking for some more user-frendly solution if any exist.
    I'd say you shouldn't try to be too smart. There are always cases you just can't forsee.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. The following user says thank you to wysota for this useful post:

    ChrisW67 (16th February 2013)

  7. #6
    Join Date
    Nov 2011
    Location
    Poland
    Posts
    17
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Qt with pulseaudio - How to omit it?

    If your Qt is built with a rule that "audio playback is provided by plugins" then without a working plugin it will not function properly.
    Thanks - this is very clear part but sometimes You speak riddles...


    So, is there some Ubuntu package that provides alternative for pulseaudio-qt-plugin?
    Pulseaudio plugin is part of qtmultimedia.deb package and I can't just remove it as pulseaudio package dependence but maybe I can add as a dependence of my app.deb some package that has such pugin?
    I know, this forum is not the best place to ask such question but everyone developer using QtMultimedia for/under Linux can has similar problem.

  8. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt with pulseaudio - How to omit it?

    Quote Originally Posted by SeeLook View Post
    So, is there some Ubuntu package that provides alternative for pulseaudio-qt-plugin?
    I have no idea. I'm using Kubuntu myself and I can't see any pulseaudio plugin for QtMultimedia in my system.

    Pulseaudio plugin is part of qtmultimedia.deb package and I can't just remove it as pulseaudio package dependence but maybe I can add as a dependence of my app.deb some package that has such pugin?
    I know, this forum is not the best place to ask such question but everyone developer using QtMultimedia for/under Linux can has similar problem.
    I think you should ask this to the Ubuntu Qt package maintainer. This seems strictly related to Ubuntu and not Qt itself.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. qmake: Omit Qt libraries from PRL file
    By chenz in forum Qt Programming
    Replies: 5
    Last Post: 6th June 2012, 11:15
  2. Qt multimedia on Linux (pulseaudio)
    By janK in forum Newbie
    Replies: 3
    Last Post: 15th May 2010, 20:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.