Closed Fredrum closed 3 years ago
I'll start doing something for this. Does anyone know what other computers' defaults are? I could just expose the full availableDevices() but there's a lot of non intuitive entries there.
I would recommend exposing them all. Someone who needs a particular device would be frustrated if it was left intentionally unlisted.
Added a pull request Adding audio device selection #377, @thestr4ng3r
Environment
Describe the bug Qt is not able to find the correct Audio output device on its own. Also Qt is not able to pick the right Audio plugin when both Alsa and PulseAudio are present. This results in no sound on Raspbian. My previous Qt5.12 fix was a red herring, the reason it worked was that it didn't have the Pulse Qt plugin, only the Alsa plugin, so qt had to default to Alsa.
To Reproduce Steps to reproduce the behavior:
Expected behavior Alsa should be available without special Qt hacks. Audio should work by default.
Additional context @tomblind discovered that if he removed the /usr/lib/arm-linux-gnueabihf/qt5/plugins/audio/libqtmedia_pulse.so file then Qt defaulted to Alsa and he could hear the sound even with the regular Qt5.
Based on that I went back to the code and now have it working with the regular Qt5 install. No 5.12 version needed.
In streamsession.cpp: (just to show what does work)
then further down we need to add this device info,
audio_output = new QAudioOutput(audio_device_info, audio_format, this);
I suggest that we add a popup menu in the settings gui where we cross match a premade list of audiodevices maybe even just "default" and "pulse", with what comes up when doing availableDevices(). The intersection would populate the popup menu.
"default" should be chosen as default if present.
That would enable Alsa sound straight away without user having to do anything and people who want to set up with PulseAudio can still do that.
And I could remove Qt5.12 from the install process for Raspian!
Cheers Fred