Commit Graph

5002 Commits

Author SHA1 Message Date
Lartza
0b8c530ce3 fix build without Opus 2019-11-12 19:06:16 +02:00
John Mckay
8674a3e7cd JackAudio: remove locks from realtime callbacks, various improvements
According to the JACK specification the process callback cannot have anything that could block.
JACK can also kill the process thread while it is holding the lock which can cause a deadlock.
This prevents both deadlocks in Mumble and xruns in the JACK processes.

There have also been some changes to the order in which the JACK clients get activated.
This is to make sure that they are fully set up before the activate function is called.
This prevents graph errors from showing up in the JACK logs.
2019-11-11 05:06:58 +01:00
Davide Beatrici
cf50fffae7 GlobalShortcutWin: fix build without XboxInput
The code accessed a variable ("nxboxinput") even when not existent, resulting in compiler errors.

This commit fixes the issue by adding the missing checks.
2019-11-10 03:50:55 +01:00
Davide Beatrici
8cdc8f4bd9
Merge PR #3876: JackAudio: load symbols at runtime 2019-11-04 04:33:27 +01:00
Felix Becker
2faf905167 Try to fix channel limit override by subchan delete
Try to remove the ability to join a full channel by
creating a temporary sub channel then joining it
and removing it (discovered by @Natenom).

Check isChannelFull in addition to existing
hasPermissions ChanACL::Enter check.
2019-11-04 00:52:56 +01:00
Davide Beatrici
2e1d3f112f JackAudio: load symbols at runtime
We check for the following libraries:

- Windows: "libjack64.dll" and "libjack32.dll". Those are the libraries that are shipped with the official installer, which copies them in "C:\Windows".
- macOS: "libjack.dylib" and "libjack.0.dylib".
- Everything else: "libjack.so" and "libjack.so.0".

This commit also:

- Adds a debug message so that a user knows which library was loaded and its version.
- Renames "inputBuffer" to "outputBuffer" in JackAudioOutput::process(), the previous name was only correct from the perspective of the JACK port.
- Renames "input" to "inputBuffer" in JackAudioInput::process(), the previous name was unclear.
2019-10-31 09:24:33 +01:00
Davide Beatrici
10b3562fe1 mumble.pro: don't link to JACK library, add "3rdparty/jack-src" as include path
This guarantees no dependency.
2019-10-31 09:12:15 +01:00
MumbleTransifexBot
6d3d27e2dc Transifex translation update
Mode: default
Minimum percent translated: 0
Matched 44 languages
2019-10-29 19:52:46 +00:00
Stefan Hacker
7c8655d5a4 Translation update
Updating 'mumble_en.ts'...
    Found 1721 source text(s) (14 new and 1707 already existing)
    Removed 10 obsolete entries
2019-10-28 23:34:58 +01:00
Stefan Hacker
0f58796e8e Fix typo in DBus on Windows code-path lupdate complains about
I guess we do not compile this code-path in any of our
regular builds so it has started to rot.
2019-10-28 22:21:36 +01:00
Davide Beatrici
61aeab85b8
Merge PR #3868: Use QDateTime to avoid time underflow 2019-10-28 02:30:17 +01:00
Mikko Rantanen
d50a20fc53
Use QDateTime to avoid time underflow 2019-10-28 02:50:12 +02:00
Davide Beatrici
986c52806c
Merge PR #3867: Make client more robust against inconsistent state 2019-10-27 22:05:12 +01:00
Stefan Hacker
58a63964ec Make client more robust against inconsistent state
If during message handling we somehow end up in a situation
where no ClientUser is registered or g.uiSession is not set
we end up with pSelf as a null pointer. Dereferncing that
crashes the application.

Similar to other objects we retrieve for message processing
this patch modified the macro to log and bail if we encounter
this situation instead of crashing.

One drawback of this patch is that it might make state
corruption caused by client bugs less visible to us because
we no longer receive crash reports on them while the client
functionality could still be degraded severly.
2019-10-27 11:27:21 +01:00
Davide Beatrici
7dbe4353fb
Merge PR #3866: Disconnect if server does not send clients user before sync 2019-10-27 03:15:10 +01:00
Stefan Hacker
5e153a1a56 Disconnect if server does not send clients user before sync
The protocol requires that a server sends all client information
before sending the sync message that indicates state is matching.
Before this patch violating this condition could bring the client
into a bad state where a connection was established but the client's
user object not existing. Now the client disconnects itself if
such an issue occurs.
2019-10-27 02:40:57 +01:00
Stefan Hacker
1ca73d8e71 Make client robust against server dropping occupied channel
While this should not occur the client did not properly
consider what would happen if a server sent a ChannelRemove
without first moving all users out. Allowing this operation
to happen will bring our UserModel into an undefined state
where users (even ourselves) might have been dropped while
the server still considers them.

With this patch we now detect that case and disconnect ourselves
from the broken server instead of breaking our state.
2019-10-27 01:42:26 +02:00
Davide Beatrici
5a027ddea8
Merge PR #3864: Fixed posting of empty clipboards to channel on Global Shortcut input 2019-10-26 10:11:01 +02:00
Ryan Thomas
1450f0d344 Fixed unexpected behavior: Pressing a specified global shortcut for pasting clipboard content to channel would result in empty messages being posted if user's clipboard is empty.\nNew behavior: pressing the global shortcut for pasting clipboard content to channel when clipboard is empty does not post a message to channel 2019-10-26 03:07:58 -04:00
Jan Klass
856eefa9ba
Merge PR #2045: Remove CELT 0.11.0 2019-10-22 14:36:03 +02:00
Davide Beatrici
5c68335a18
Merge PR #3853: Log: change message names to have consistent capitalization (first word only) 2019-10-17 07:19:07 +02:00
Ryan Thomas
047bd20476 Changed message names to have consistent capitalization (First word only) in response to issue #3788. 2019-10-16 21:28:02 -04:00
Davide Beatrici
9e1a5604d2 Remove CELT 0.11.0
CELT 0.11.0 provides better quality in comparison to CELT 0.7.0, but the two versions of the codecs are not compatible, which is why we provided both of them.

Opus was introduced in Mumble 1.2.4 (7586a61226), thus we expect that most (if not all) users are using it.

By removing CELT 0.11.0 we don't break backwards compatibility, because it's provided by CELT 0.7.0.

The main reason for removing the codec is the fact that its discontinued (in favor of Opus).

Also, CELT 0.11.0 was removed from the Debian package back in 2012: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=682010
2019-10-15 03:50:24 +02:00
Davide Beatrici
5f42e0eb0c TaskList.cpp: fix compilation error with MinGW when PCH is disabled
Fixes the following error:

TaskList.cpp:77:20: error: 'SHARD_LINK' was not declared in this scope
  SHAddToRecentDocs(SHARD_LINK, link);
                    ^

"SHARD_LINK" is only defined when "NTDDI_VERSION" is at least "NTDDI_WIN7" (0x06010000).

We handle the logic for MinGW in "win.h", this commit fixes the error by including it.
2019-10-13 23:25:41 +02:00
Davide Beatrici
de8a92ea53
Merge PR #3842: Fix deprecated QSslSocket::setDefaultCaCertificates 2019-10-12 10:41:23 +02:00
Robert Adam
4e051fc0c9 removed redundant workaround for https://bugreports.qt.io/browse/QTBUG-6504 in debug-mode 2019-10-12 09:14:43 +02:00
Davide Beatrici
cf998824b0 Add setting to toggle 24-hour time format for the chat
By default QTime uses the 24-hour time format when converting to a string.

This commit adds a setting (a checkbox) which allows users to toggle the format.

The setting only applies for new messages, the already shown ones will retain the previous time format.
2019-10-11 08:38:37 +02:00
Davide Beatrici
909896d084
Merge PR #3826: Revamp JackAudio implementation 2019-10-10 06:33:40 +02:00
Davide Beatrici
7835c57083 MurmurGRPCImpl.cpp: remove QAtomicInt compatibility layer
I accidentally left it in 062fe2661d.
2019-10-10 04:35:02 +02:00
Davide Beatrici
1ac534915c Remove remaining Qt 4 stuff
For reference: https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5
2019-10-10 03:14:38 +02:00
Davide Beatrici
a50e572e2d Remove Qt 4 includes 2019-10-10 03:13:18 +02:00
Davide Beatrici
eea435d780 Remove Qt::escape() -> QString::toHtmlEscaped() compatibility layer
https://wiki.qt.io/Transition_from_Qt_4.x_to_Qt5#Qt::escape_is_deprecated
2019-10-10 03:09:39 +02:00
Davide Beatrici
062fe2661d Remove QAtomicInt compatibility layer
Qt 4: https://doc.qt.io/archives/qt-4.8/qatomicint.html
Qt 5: https://doc.qt.io/qt-5/qatomicint.html
2019-10-10 03:09:08 +02:00
Davide Beatrici
080015b842 Remove ServerResolver implementation for Qt 4
Qt 4 used a different implementation because QDnsLookup was introduced in Qt 5.

Unlike the complete implementation, the Qt 4 compatible one only supported simple lookups (e.g. hostname -> IP address).
2019-10-10 02:18:01 +02:00
Davide Beatrici
2f967b7ea4 qmake: remove Qt 4 logic 2019-10-10 02:17:51 +02:00
Davide Beatrici
57a8f3e48b Overlay: replace deprecated GetFrontProcess() and GetProcessPID()
Both deprecated in macOS 10.9.

https://developer.apple.com/documentation/applicationservices/1501050-getfrontprocess
https://developer.apple.com/documentation/applicationservices/1500992-getprocesspid
2019-10-09 23:35:47 +02:00
Davide Beatrici
796eabaf17 GlobalShortcuts_macx.mm: replace deprecated GetProcessForPID() and CopyProcessName()
Both deprecated in macOS 10.9.

https://developer.apple.com/documentation/applicationservices/1501069-getprocessforpid
https://developer.apple.com/documentation/applicationservices/1501067-copyprocessname
2019-10-09 23:35:47 +02:00
Davide Beatrici
523d40c2b6
Merge PR #3828: Remove DirectSound implementation 2019-10-08 22:11:32 +02:00
Davide Beatrici
83a88847f9 Murmur.ice: add missing value to UserInfo
Mumble.com kindly reported that the getRegistration() Ice method fails with an "enumerator out of range" error, due to a missing value in the "UserInfo" enum.

The value was added to Murmur in 813aceb854 and then renamed and moved in 5131d9e303.
2019-10-08 19:22:10 +02:00
Davide Beatrici
01b097d6ee Revamp JackAudio implementation
Some users were encountering issues such as the client taking ~8 seconds to start when "jackd" could not be run, due to the library attempting many times to connect to the JACK server (https://bugs.debian.org/941455).

While working on a fix I corrected the many warnings emitted by Clang-Tidy and I realized that there were many things that could be improved.

This commit almost entirely rewrites the implementation, but here are some of the changes:

- Mutexes are used everywhere, race conditions should not be possible anymore.
- The JACK client is not opened until it's required (i.e. "JackAudioInput" and/or "JackAudioOutput" start running). The initialization code has been moved to a dedicated function, the constructor doesn't execute it anymore. This is what fixes the issue mentioned above.
- The JACK client is deactivated and closed automatically when both "JackAudioInput" and "JackAudioOutput" are not running.
- Code specific to audio input or audio output has been moved from "JackAudioSystem" to the corresponding section ("JackAudioInput" or "JackAudioOutput").
- Some variables in "JackAudioSystem" have been replaced with functions which retrieve the corresponding value from the JACK server.
- Removed all instances of "delete", raw pointers have been replaced with "std::unique_ptr<>()".
- Replaced "NULL" with "nullptr".
2019-10-08 03:09:22 +02:00
Davide Beatrici
efb3c83512 Fix dangling else warning in Server::msgACL()
This commit fixes a warning encountered today on FreeBSD, probably because Clang was updated and now `-Wdangling-else` is enabled by default.

Messages.cpp:1330:5: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
                                foreach(int id, pg->members()) {
                                ^
2019-10-07 08:49:47 +02:00
Davide Beatrici
90c93fa7a5 Replace deprecated qSort() with std::sort()
5957f245c6

I accidentally forgot to search for "qSort" in files when I created 3132f993d8.

This commit replaces the qSort() instances I missed.
2019-10-07 06:27:52 +02:00
Robert Adam
ff1591b64d Replace QPalette::Background with QPalette::Window in AudioNoiseWidget::paintEvent()
I just had a FreeBSD build fail because AudioStats.cpp is using QPalette::Background, which apparently has been declared deprecated.

AudioStats.cpp:213:45: error: 'Background' is deprecated: Use QPalette::Window instead [-Werror,-Wdeprecated-declarations]
        paint.fillRect(rect(), pal.color(QPalette::Background));
                                                   ^

The Qt docs advise to use QPalette::Window instead (see https://doc.qt.io/qt-5/qpalette.html), so I went ahead and changed the code accordingly.
2019-10-06 20:27:59 +02:00
Davide Beatrici
0893c6c361 Fix dangling else warning in ConnectDialog::OnSortChanged()
This commit fixes a warning encountered today on FreeBSD, probably because Clang was updated and now '-Wdangling-else' is enabled by default.

ConnectDialog.cpp:1178:3: error: add explicit braces to avoid dangling else [-Werror,-Wdangling-else]
                foreach(ServerItem *si, qlItems)
                ^
2019-10-06 18:19:37 +02:00
Davide Beatrici
2a3e5f9317 Translation update
Updating 'mumble_en.ts'...
    Found 1717 source text(s) (14 new and 1703 already existing)
    Removed 15 obsolete entries
2019-10-05 08:10:58 +02:00
Davide Beatrici
66dd17bcf4 Settings: remove DirectSound stuff 2019-10-05 08:10:58 +02:00
Davide Beatrici
ad42a468d7 ASIOInput.cpp: remove reference to DirectSound 2019-10-05 08:10:58 +02:00
Davide Beatrici
26f3de467c main.cpp: remove reference to DirectSound 2019-10-05 08:10:58 +02:00
Davide Beatrici
7042572235 Remove references to DirectSound in UI
The suggestion to use DirectSound was valid only for Windows versions prior to Vista, because WASAPI was introduced with it.

Fortunately DirectSound didn't appear in the UI as an option in case WASAPI was detected, hopefully we didn't mislead users into thinking that DirectSound is better than WASAPI.

Also, the description was suggesting to use DirectSound on non-Windows operating systems.
2019-10-05 08:10:58 +02:00
Davide Beatrici
7977a5c465 Remove DirectSound implementation code
DirectSound was the first audio backend supported by Mumble, in 2005.

Windows Vista introduced a brand new audio stack called WASAPI, which entirely replaced DirectSound. Support for it was added in 9a018148bb, 6bef650e57 and 677a39951f.

This commit entirely removes our DirectSound implementation, not needed anymore because we are dropping support for Windows XP in 1.4.
2019-10-05 08:08:55 +02:00