summaryrefslogtreecommitdiffstats
path: root/src/plugins/pulseaudio
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.11' into ↵v5.15.11-lts-lgplTarja Sundqvist2023-06-091-2/+6
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I3279e8339e4fadcc6d5aaafa01e4b15a92168a6c
| * QPulseAudioSource: fix UB (memcpy() called with nullptr dest) in read()Marc Mutz2022-05-261-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | deviceReady() calls read(nullptr, 0), but calling memcpy() with a nullpt destination is UB, even if the length is simulateneously zero. Ditto applyVolume() (called from read()). Fix by guarding the memcpy() calls. Add assertions to indicate that for these functions, nullptr is valid input iff length is zero. Found by clangsa's core.NonNullParamChecker. Change-Id: I9006b0e933e196a7a212e0ebe2bd27f6b9552518 Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io> (cherry picked from commit 8df415d5bcf23462bedb4cb7601b909851ee15dd)
* | Merge remote-tracking branch 'origin/tqtc/lts-5.15.10' into ↵v5.15.10-lts-lgplTarja Sundqvist2023-04-241-18/+18
|\| | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I8b7432f3108105699006c375f90bfe3ad0e5748c
| * Fix chunk sizing in QPulseAudioSinkAxel Spoerl2022-05-121-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QPulseAudioSink:write() takes a length parameter which is set to the qMin of itself and the return value of pa_stream_writable_size(). This method returns the number of bytes requested by the server, but not yet written. Unless data is buffered, the value is 0. That leads to length being set to 0 and no data being sent. In PulseOutputPrivate::writeData(), a loop was implemented calling QPulseAudioSink::write() up to 10 times for each data chunk. That forced data buffering and subsequently the return value of pa_stream_writable_size() to be > 0. This patch replaces the query of pa_stream_writable_size() with the nbytes value modified by pa_stream_begin_write(). It represents the maximum amount of bytes the pulseaudio server is ready to accept. The patch also removes the loop calling write up to 10 times as it becomes unnecessary. Fixes: QTBUG-60575 Change-Id: I316a5ac610c8540ab8f7fff4a3b0b1ee3d7e7ad5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit f1829a24d4c9a393f95d55c415daa80275a90b93) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* | Revert "Update commercial license headers"v5.15.3-lts-lgplTarja Sundqvist2021-03-2512-249/+249
|/ | | | | | | | | | | This reverts commit 80d46e3a5f64ff2456c40bdba63b6d5c69a32cdd. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I5c64ffa120f916711e5cf01c828774f8456dec06 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Update commercial license headersTarja Sundqvist2021-01-2712-249/+249
| | | | | | | | | | | | | | | | Updated header.COMM to files in tqtc-qtmultimedia. Examples, tests or documentation files are not updated. The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reaso for this is that some autotests use hard coded line numbers and a change in the line count causes failures in tests. Task-number: QTQAINFRA-4171 Change-Id: I86ebf7c3653b55983cefff246c0cb019cbcda8c4 Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
* Add missing overrideAlexander Volkov2020-06-104-63/+63
| | | | | | | Change-Id: I0ec719a26ad6c146e44f8e9e41b186a53cb254a9 Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io> (cherry picked from commit 121c0c4028d6deceded8e600959f10c364986634) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-131-3/+3
| | | | | | | | It was deprecated by qtbase/ed99a591a83a399458f12341d0a1c0b3152f247a. Change-Id: I87bf219c05a62e1deeb9d3df558e5084318a2a69 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* Make QPulseAudioOutput::elapsedUSecs prone to OS time changeTomasz Olszak2019-01-292-5/+4
| | | | | | | | | | | Pulseaudio implementation of QAudioOutput used QTime as time counter. Hence when output was started and timezone or time has changed the QAudioOutput::elapsedUSecs() returned faulty values. It happened because QTime::elapsed is undefined after system clock update. Using QElapsedTimer instead of QTime seems safer. Change-Id: I1f0c27deea550f249e2ccad0fc716b95a32608ae Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
* PulseAudio: Introduce QT_PA_CHANNEL_MAP for QAudioOutputVaL Doroshchuk2018-12-031-1/+28
| | | | | | | | | | | | | | | | | | Introduced QT_PA_CHANNEL_MAP env var to define one of channel mapping definitions: ALSA = PA_CHANNEL_MAP_ALSA AUX = PA_CHANNEL_MAP_AUX WAVEEX = PA_CHANNEL_MAP_WAVEEX OSS = PA_CHANNEL_MAP_OSS and PA_CHANNEL_MAP_DEFAULT as default Usage QT_PA_CHANNEL_MAP=AUX ./app Also fixed a crash when the number of the channels is too high. Task-number: QTBUG-71710 Change-Id: I45f7f7499cb7db218d5dc7d2eb7764c835abf8f7 Reviewed-by: Otto Ryynänen <otto.ryynanen@qt.io> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Pulse: Fix crash when stop() is called while reading buffersVaL Doroshchuk2018-09-131-1/+1
| | | | | | | | | | | | Since reading from QIODevice can be reimplemented on user side, it can call QAudioOutput::stop() which will free resources. This will produce a crash in QPulseAudioOutput::userFeed() when it will attempt to write buffers. Task-number: QTBUG-69734 Change-Id: Ifa43ba52bb01bb40939730461615a9d182ffcc9b Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* PulseAudioOutput: Emit QAudio::StoppedState on QAudio::OpenErrorv5.11.0-beta4VaL Doroshchuk2018-04-121-0/+3
| | | | | | | | | If a problem occurs in open() the stateChanged() signal should be explicitly emitted regardless that current state has not been changed since QAudio::StoppedState. Task-number: QTBUG-49569 Change-Id: I6f4e235fa4b6b3bbf0dc3946dfe1f983ac10f356 Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-10-191-23/+16
|\ | | | | | | | | | | | | Conflicts: src/plugins/qnx/mediaplayer/mmreventmediaplayercontrol.h Change-Id: Ic6e27742ef6d1af0532ad05902a1431ebd5f449d
| * PulseAudio: Reject unsupported audio formatsVaL Doroshchuk2017-09-261-23/+16
| | | | | | | | | | | | | | | | | | | | | | Based on https://freedesktop.org/software/pulseaudio/doxygen/sample.html Applied a fix to allow only supported combinations sample type/sample size/byte order. If the combination has not been found PA_SAMPLE_INVALID is returned. Task-number: QTBUG-62621 Change-Id: I14c3d3828a0527aef0a5afa753fb640ead0cc18d Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | Replace Q_NULLPTR with nullptrKevin Funk2017-09-272-2/+2
|/ | | | | Change-Id: I3b7601b4a97f8a2b1d2da6ef134f1577846ba713 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Move qtmultimedia over to the new config systemLars Knoll2016-11-141-2/+1
| | | | | | | | | | | | Use the new configuration system to define external libraries, configure tests and features. Don't use pkg-config outside of the configuration step. And move all command line options over from qtbase, so that we can remove them from there in a second step. Change-Id: I1aa4b557a6aee17eeceb00602005a2d28b426a26 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* Merge remote-tracking branch 'origin/5.7' into 5.8Yoann Lopes2016-09-231-17/+48
|\ | | | | | | Change-Id: I96aca24df935d51b40380c727b6c5002432a6be6
| * Merge remote-tracking branch 'origin/5.6' into 5.7Yoann Lopes2016-09-221-17/+48
| |\ | | | | | | | | | Change-Id: I5bce2843ac62bb97efc1ccaaa9c671c4adf10640
| | * PulseAudio: make code more robustYoann Lopes2016-09-211-17/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some asynchronous operations return a pa_operation pointer, which can be null if the operation fails. In some cases we were not checking that the returned object was non null, leading to some asserts being raised in pa_operation_unref. Change-Id: Iff1cc67b7f79b758fa81d79e658debb1d737b29f Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-07-212-16/+103
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/directshow/player/directshowiosource.cpp One side disintermediated filling a vector; the other reduced it to one entry. src/plugins/directshow/player/directshowiosource.h One side renamed a member, the other added another adjacent to it. src/plugins/pulseaudio/qpulseaudioengine.h One side added a header, the other replaced the next with a different header. Change-Id: I3a031975f5af43ca39cca571f215c612f640b7d6
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-302-24/+103
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Blacklisted a few functions in tst_QAudioInput. Conflicts: .qmake.conf src/plugins/avfoundation/camera/avfcameracontrol.mm src/plugins/avfoundation/camera/avfcameraservice.h src/plugins/avfoundation/camera/avfcameraservice.mm src/plugins/avfoundation/camera/avfcamerasession.h src/plugins/avfoundation/camera/avfcamerasession.mm src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.h src/plugins/avfoundation/camera/avfcameraviewfindersettingscontrol.mm src/plugins/avfoundation/camera/avfimagecapturecontrol.mm src/plugins/avfoundation/camera/avfimageencodercontrol.mm src/plugins/avfoundation/camera/avfmediarecordercontrol.h src/plugins/avfoundation/camera/avfmediarecordercontrol.mm tests/auto/integration/qaudioinput/BLACKLIST Task-number: QTBUG-54459 Task-number: QTBUG-49736 Change-Id: I3a1fe8cef50b44d5c2785aaf4cf69fe3f16728e6
| | * PulseAudio: keep device list up to date.Yoann Lopes2016-06-202-24/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The list of devices was cached on startup and was never updated when a device was plugged, unplugged or if the default device changed. We now use the event subscription mechanism in PulseAudio to get notified of these changes and update the list accordingly. Change-Id: I5fe1c81494702aa9d38b91009621629dc9606323 Reviewed-by: Karim Pinter <karim.pinter@theqtcompany.com> Reviewed-by: Christian Stromme <christian.stromme@qt.io>
* | | Improve QAudioDeviceInfo::defaultDevice().Christian Stromme2016-05-204-11/+17
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation of QAudioDeviceInfo::defaultXDevice() would always report the first available device as the "default" one, making the order, in which devices were listed, a hidden requirement when implementing audio plugins. To make it easier and more reliable to retrieve the default device, all new plugins should implement the new QAudioSystemPluginExtension interface as well as the QAudioSystemPlugin. Devices will be chosen in the following order (first match wins): default plugin -> default device -> first available device plugins -> default device -> first available device Task-number: QTBUG-51292 Change-Id: I8ace78858976fe7c60a2c4a117ef15c4e1bb177f Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-214-137/+56
|\| | | | | | | Change-Id: Ieb1a3081907093e31e8c8b7f95993bb3b2173672
| * PulseAudio: change the way volume is applied.Yoann Lopes2016-03-164-137/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to change the PulseAudio sink input volume. Doing so had some potential unwanted side effects depending on the PulseAudio server configuration. When flat volumes were enabled, it would affect the global system volume. It could also affect the volume of other streams having the same audio role. Volumes in Qt Multimedia are supposed to be relative to the application volume and should not affect anything else than the object on which it was changed. To guarantee that, PulseAudio volume APIs are not used anymore. Instead, software-based volume attenuation is applied on the audio samples before being passed to PulseAudio. Applies to QSoundEffect, QAudioOutput and QAudioInput. Task-number: QTBUG-40823 Task-number: QTBUG-49461 Change-Id: I690716976bda8fe666969ca2cbdf6d8d0b419733 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-072-11/+36
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/avfoundation/mediaplayer/mediaplayer.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin1/mockserviceplugin1.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin2/mockserviceplugin2.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin3/mockserviceplugin3.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin4/mockserviceplugin4.pro tests/auto/unit/qmediaserviceprovider/mockserviceplugin5/mockserviceplugin5.pro Change-Id: I5742596230dc510ba2a09eba624429bb67179194
| * PulseAudio: remove debug warning of UnderrunDyami Caliri2016-03-011-1/+0
| | | | | | | | | | | | | | | | The QAudio::UnderrunError is a normal error and is already reported to the user. Change-Id: I0ee5d827666fb08b5eb199255b3b3c5610f743c2 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
| * PulseAudio: fix playback for short streams in pull modeDyami Caliri2016-02-261-6/+32
| | | | | | | | | | | | | | | | | | If the provided stream's length is shorter than the stream prebuf attribute, the stream will never play. We adjust the prebuf attribute in this case. Change-Id: Ia397ac967ad2fa357a7aba137fbb78de272440ed Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
| * consistently put {qt,qml}_{module,plugin} at the end of project filesOswald Buddenhagen2016-02-251-4/+4
| | | | | | | | | | | | | | | | this fixes static builds by ensuring that all dependencies are exported. Task-number: QTBUG-51071 Change-Id: I8e1554b648327ea2fb342b882ce8e439bd6f271d Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-01-261-1/+1
|\| | | | | | | Change-Id: I2e4e9cca01d63ed0d1e7f71c7a58322390696036
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-211-1/+1
| |\ | | | | | | | | | Change-Id: I6d88b17f44479a522d181374023648dd007112bd
| | * PulseAudio: fix QAudioOutput state after resume().Yoann Lopes2016-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | In push mode, the state must be IdleState after resume(), and only change to ActiveState once it receives some data. Change-Id: I8caff011f517e91629abf45af51580f24136bcea Task-number: QTBUG-50390 Reviewed-by: Pasi Petäjäjärvi <pasi.petajajarvi@theqtcompany.com>
* | | Updated license headersAntti Kokko2016-01-1912-168/+240
|/ / | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I324f65c61171f36641472964d095d72e452afb3a Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into 5.6Yoann Lopes2015-11-202-1/+5
|\| | | | | | | Change-Id: I8e0f222f110cc23b426f2d68416f5cc3982e30f2
| * Don't initialize volume on pulse audio input by default.Morten Minde Neergaard2015-11-192-1/+5
| | | | | | | | | | | | Task-number: QTBUG-49461 Change-Id: I32b707e19091ab8344175b2dc0cdd1747f1186b3 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* | pulseaudio: Remove unused static member variableSergio Martins2015-06-011-2/+0
|/ | | | | Change-Id: I79f8ce318d4fb72ddbd9d4e5c030df01c36084fa Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Update copyright headersAntti Kokko2015-02-1212-84/+84
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I1c6faa4f59f8eca54f01ef20941fa60161dd7872 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.4' into devYoann Lopes2015-01-194-18/+18
|\ | | | | | | | | | | | | | | Conflicts: .qmake.conf src/plugins/gstreamer/camerabin/camerabinsession.cpp Change-Id: I66a6f3efc5391013934b6b321073c31f25e1de26
| * Fix: static linking on Linux with both PulseAudio and Alsa pluginsGabriel Hege2014-12-224-18/+18
| | | | | | | | | | | | | | | | | | | | | | Fixed multiply defined symbols when linking statically with both PulseAudio and Alsa plugins enabled: The private classes In/OutputPrivate had identical names and have been renamed. Change-Id: I9415beeeed9fb0e14ead3f0ab906f343b3934341 Task-number: QTBUG-43514 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
* | Add missing includes for QDataStream/QIODevice.Friedemann Kleint2015-01-072-0/+2
|/ | | | | | | | After qtbase/90e7cc172a7521396bb2d49720ee4ceb9a9390b3, QStringList no longer includes QDataStream. Change-Id: Ibe3e1e6542e1b592adaabe3f8ffd3268efaf289b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge remote-tracking branch 'origin/5.3' into 5.4Sergio Ahumada2014-09-262-2/+2
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Iad73368a22c6d4662188e6f357a265d0c26756d0
| * Fix integer overflow in several audio plugins.Yoann Lopes2014-09-092-2/+2
| | | | | | | | | | | | Task-number: QTBUG-40804 Change-Id: If006cb7db319bb6fda4ce7eb4f907e897b5d9efa Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* | Update license headers and add new license filesAntti Kokko2014-08-2412-222/+126
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: Ied06887225df341064c12bcc14c259ae74116f2e Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* | Only call pa_cvolme set on stream creation if volume explicitly set.Robin Burchell2014-08-042-7/+22
|/ | | | | | | | | | | Streams without a custom volume set use suitable volume selected by the PulseAudio server. This is usually the correct choice, since then stream-restore module can apply old volume to the stream. Also with Sailfish explicitly setting the volume to streams breaks system volume. Change-Id: I75f5bf4e7aaafb4bd55510f5ac4ddf03767d494b Done-with: Juho Hämäläinen <juho.hamalainen@tieto.com> Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* PulseAudio: make plugin more robust.Yoann Lopes2014-07-106-253/+347
| | | | | | | | | | | | | Handle more thoroughly error cases, such as when the PulseAudio daemon does not respond or terminates while QAudioInput/QAudioOutput is active, in which cases it used to crash or hang. We now correctly emit the error signal and change the state when errors occur. Task-number: QTBUG-29742 Change-Id: I173d35aece60d96e578785e1522cf78b24dcb8b8 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* QAudioOutput: Don't guess media role if one has not been provided in ↵Robin Burchell2014-02-071-10/+2
| | | | | | | | | | | | | setCategory. Trying to heuristically guess this kind of thing is almost always a bad idea. Expect the creator of the output to explicitly tell us the category instead of guessing. This fixes QAudioOutput not respecting system volume on Sailfish. Change-Id: If1d05192f513eb54fdfbd1df217286f329b2bfe8 Reviewed-by: Yoann Lopes <yoann.lopes@digia.com>
* PulseaudioInput: Remove unused membersTobias Hunger2013-09-021-2/+0
| | | | | | | Clang warns about them. Change-Id: I8fb2e9bc30f35ec9540b09a34bf23bf9eb671b9c Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
* Fix warnings in qtmultimediaThiago Macieira2013-04-031-0/+1
| | | | | | | | | /camerabinresourcepolicy.cpp:100:42: error: unused variable 'oldSet' [-Werror=unused-variable] camerabincontrol.cpp:167:54: error: 'resourceSet' may be used uninitialized in this function [-Werror=maybe-uninitialized] qaudiooutput_pulse.cpp:416:20: error: unused variable 'bytesWritten' [-Werror=unused-variable] Change-Id: Idafd85b7985673f1f22d868b5f1b1e46a60ada4a Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1012-12/+12
| | | | | | Change-Id: Ia8c1c38aba1544603fada8c414cc856f365fd15b Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Add PLUGIN_CLASS_NAME to qtmultimedia pluginsMiikka Heikkinen2012-12-101-0/+1
| | | | | | | | Needed for automating static plugin loading. Task-number: QTBUG-28131 Change-Id: Ia392b112fc46dedd34c9ffdbd6e874dbbfeaef83 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>