QAudioDeviceInfo::availableDevices does not work in my build of Qt 5.3.2 on Ubuntu Linux 12
I built Qt 5.3.2 and programmed a C++ multimedia application, which detects my camera OK, but QAudioDdeviceInfo::availableDevices returns zero audio input and output devices, whereas the Ubuntu system settings for sound shows two of each audio device type. I have read that this problem is something to do with plugins. Is that correct?
Here are my command lines options for configure, which was followed by a make then a make install:
./configure -prefix /home/username/QtSDK/5.3.2/debug -debug -opensource -shared
-platform linux-g++ -rpath -no-c++11 -nomake tests -make tools -make libs -make examples
I don't see any options in the Qt Linux configure for audio plugins, apart form -pulseaudio and -alsa, which it says are default choices. Where would these plugins be built and installed to? I don't see them under the plugins directory. Or, could I be missing a required library? Or could I fix this by installing a later version of Ubuntu?
Hi and welcome to devnet,
Does it also happen if you use one of the pre-built package ?
Thank you. That's a good question. I will try what you suggest.
It leads me to further question, as I haven't distributed a Linux application based on Qt before. In general should I be installing my build of Qt along with my application binaries or should I be asking the user to run the official pre-built Qt installer, before installing my application?
It depend on how you will deploy your application (through Linux distributions package manager, by hand etc.)
I found that the pre-built install has an "audio" directory under "plugins", whereas my build did not. I thought audio plugins were a default option for the build. Next time I will add them explicitly. Copying the audio plugins directory to my build directories solved the problem. Thank you for your suggestion to try the pre-built libraries.
I have been using a script to install the libraries to a subdirectory of /usr/local/lib, adding a conf file and calling ldconfig, but this requires sudo. I understand that a simpler install would involve a command file that temporarily sets LD_LIBRARY_PATH to a subdirectory of the user's home, then runs the application.
That's pretty strange, the make install step should have copied them in the right place.
How are you installing Qt exactly ? Looks like your not following the standard procedure
I have just completed a make and make install of Qt 5.3.2 on OSX 10.8, and I see it has created audio plugins, so I don't know what went wrong with my Linux build. Anyway, I know what to look for if the problem happens again.
The install procedure I referred to in my previous post is the one I use to install Qt for my application on a user's machine, rather than on my development machine. Is there a standard way this should be done?
Look for the "deployment guides" for the platform you target. Also on linux, depending on how you would like to distribute your application you could also provide packages for the targeted distributions.