1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
Commit Graph

177 Commits

Author SHA1 Message Date
sudden6
5339ad978b
fix(groupaudio): don't play audio while call is inactive
This also avoids logspam, because toxcore keeps recieving audio data
even if the call is inactive.
2016-04-24 14:34:49 +02:00
sudden6
afcd146a5b
fix(groupaudio): avoid deadlock when ending groupcall
The offending statement caused a deadlock, because the audioLock was
locked twice by the audio thread.
2016-04-24 14:34:49 +02:00
Nils Fenner
356543ca3b
feat(audio): add (repair) support for group audio calls 2016-04-24 14:34:49 +02:00
Nils Fenner
e5c7b3a4f6
refactor(audio): completely remove Audio class dependency from Core
The Audio singleton instance initializes itself on startup. No need for an extra call.
2016-04-24 14:34:49 +02:00
Polshakov Dmitry
343568339f
style(constructors): Constructors are explicit now 2016-04-20 22:53:27 +03:00
Diadlo
f28c3a16ae fix(core, widget): Added checks
Fix #3133.
* Added check, that core and coreAv exist, before use them
* Added check, that tox exit, before use them
2016-04-14 23:40:06 +03:00
sudden6
a89b673b40 Revert "Revert changes from merge of #2092 pull request"
This reverts commit 06611d618e.
2016-02-20 22:32:57 +01:00
tux3
ce2f8fd1d5
Cleanup and improve audio input
We now subscribe to an event and wait for frames when capturing audio
input, the big avdantage is that we only have to fetch the frames from
the hardware once, and we don't need to cache anything.
The frames are simply dispatched to the client's callbacks immediately.

Also removes some outdated ifdefs that did not apply anymore.
2016-01-23 16:45:25 +01:00
tux3
2654b6cbcd
Safer casts in Core::getGroupPeerNames 2016-01-21 16:51:25 +01:00
tux3
8253e1e395
Fix #1409: Don't save core if nothing really changed 2016-01-21 08:04:46 +01:00
tux3
0955843b8d
Merge branch 'pr2799' 2016-01-16 14:30:41 +01:00
tux3
c576a1485a
Scan-build cleanup 2016-01-16 02:24:13 +01:00
Zetok Zalbavar
ccfb81b2e4
Add some basic documentation about Tox ID in source
Lets not make plaintext gods angry by linking to a dead html page.
2016-01-14 20:21:00 +00:00
Nils Fenner
552155bd1f
Merge PR #2719 from antis81:fix_audio_subscriptions
* fix dangling audio output device
* do not resubscribe sid in copy constructor
2015-12-23 23:29:20 +01:00
Nils Fenner
0615c7c3c6
reimplement audio in/out subscription concept 2015-12-20 09:45:43 +01:00
Nils Fenner
27bfade9e1
unsubscribe invalid ToxCall from audio when copied 2015-12-20 09:45:43 +01:00
Nils Fenner
02f5f0a391
remove obsolete include of audio.h 2015-12-20 09:45:43 +01:00
Nils Fenner
08c43d0b83
cleanup OpenAL compatibility code in audio class 2015-12-20 09:45:43 +01:00
Nils Fenner
a1b87194b8
fix #2504
We need to filter samples * channels; also cleaned up data types
2015-12-20 09:45:43 +01:00
Nils Fenner
bb7d2a72b7
privatized audio interface 2015-12-20 09:45:22 +01:00
Nils Fenner
c23cb0043f
implement actual audio in/out subscription management 2015-12-20 09:42:14 +01:00
Nils Fenner
e7f666be77
un-/subscribe audio in/out in tox-call 2015-12-20 09:40:57 +01:00
Nils Fenner
efda47a226
close audio output in destructor 2015-12-20 09:40:57 +01:00
tux3
cbe8104576
Fix bad handling of empty avatars
Fixes #2694
2015-12-19 16:28:57 +01:00
tux3
b5cdfb3dce
Implement new SQLCipher based database and history
qTox will automatically import the old history on startup.

This new database code is much more robust.
It is very resilient and will not corrupt or disappear after a crash or
power failure, unlike the old code.
The on-disk database format is also much more compact now.

The database sync option in the advanced settings has been removed,
we know run many database operations asynchronously so performance
should not be a problem anymore, but we always ensure resiliency
in case of abrupt termination, so there is no tradeoff anymore.
2015-12-19 04:17:28 +01:00
tux3
ab8220c2cf
Remove stale TODO 2015-12-15 19:20:34 +01:00
tux3
cbade4bae6
Fix tiny memory leak on startup 2015-12-15 19:08:59 +01:00
tux3
63644050f3
Fix #2683
There is still an issue with the history keeping the old password, though
2015-12-14 23:27:12 +01:00
tux3
981588d630
Fix some avatars saved with the wrong name 2015-12-08 23:10:15 +01:00
tux3
9905042434
Fix wrong word in copypasted log message 2015-12-08 22:13:28 +01:00
tux3
b39f3eacb0
Clean unused getIDString() function 2015-12-05 19:09:20 +01:00
tux3
25ed3d4fba
Fix avatars for encrypted profiles
WARNING: Note that avatars for encrypted profiles are currently stored unencrypted!
2015-12-05 19:08:28 +01:00
tux3
a6bbd31b12
Retry sending audio frames on sync/lock error 2015-12-05 03:22:00 +01:00
tux3
333d10e6d5
Log type of audio send error 2015-12-05 02:35:11 +01:00
tux3
7f5f807bde
Fix filter audio
Fixes #2504

Fixes #2517

Fixes #1565
2015-12-04 18:20:47 +01:00
tux3
37075dbfb5
Improve video quality
Double the allowed bitrate, this is especially noticeable on desktop streaming. Desktop streaming is still completely broken, with what looks like iframes silently getting dropped on a regular basis.

Retry 5 times to send a frame when there's an internal toxav lock sync error, this allows us to drop way less frames.
2015-12-04 12:53:58 +01:00
tux3
db52ef6e6a
Disable buggy automatic bitrate adjustements
For some users on poor connections, toxav would suggest lower and lower bitratres until reaching zero and disabling audio/video entirely, toxav would then not raise the bitrate back and the only way to re-enable audio/video would have been to change A/V sources or restart the call

We now log toxav's recommendation, but ignore it
2015-11-14 23:51:30 +01:00
Zetok Zalbavar
cfea4675d7
Don't show in debug output nicks
They can contain personal info.
2015-11-14 20:11:37 +00:00
tux3
523e419adf
Fix theoritical A/V deadlock
Could only be hit by pausing at a key point in a debugger until the call timed-out.

Having one thread going up the call stack and acquiring locks (toxcore callbacks), while another thread goes down taking locks in the other order (CoreAV calling toxav functions) creates some pretty freezy situations.

The deadlock was caused by the GUI thread calling the CoreAV thread, acquiring the CoreAV callback, then right before calling a toxav function, not schedule the thread until the call times out. At this point the toxcore thread fires its state callback to tell us the call is over, locking internal toxcore/toxav mutexes, it reaches our callback function which tries to switch to the CoreAV thread to clean up the call data structures, but has to wait since the CoreAV thread holds its own lock. At this point if we resume the CoreAV thread, it'll be busy calling into a toxav function, which tries to acquire internal toxav locks, those locks are held by the toxcore callback so we deadlock.

Our solution is that when getting a toxcore callback, we immediately switch to a temporary thread, allowing toxcore to release the locks it held, and that temporary thread tries to switch to do work on call data structures. Meanwhile if the CoreAV thread needs internal toxcore locks, it can get them.
2015-11-08 00:32:32 +01:00
tux3
7dc608818c
Automatic AV bitrate management
Makes progress on #2134
2015-11-06 23:05:51 +01:00
tux3
d41a578735
Fix crash on audio -> video call promotion
We just ignore it and not show the received video for now.
Fixes #2505
2015-11-06 20:47:42 +01:00
tux3
b4754c6ac2
Fix inconsistent noexcept in toxcall.cpp 2015-11-06 01:49:54 +01:00
tux3
f107858252
Properly exit CoreAV thread 2015-10-25 13:53:04 +01:00
tux3
c902543ae4
Fix call race leading to deadlock and memory leak
A call cancel/accepted race was locking up both UI and AV threads, while the stream thread was shoveling more and more video frames on the AV thread's event queue
2015-10-25 00:17:45 +02:00
tux3
a776579732
Don't assert if a call dies while we answer it
This error condition only happens when a peer cancels its outgoing call in the middle of us answering it. We can simply ignore the error and things should nicely fall back into place. Since this race should be pretty rare in normal usage, it's nice to leave a log message, as it might mean we're being fuzzed.

We can prograssively replace more of those asserts by fallbacks and log messages now that everything has been shown to work fine, and the race conditions are harmless.

I feel like writing a novel today. Good thing nobody looks at these!
2015-10-24 21:41:19 +02:00
tux3
37e2d2e75f
CoreAV: Fix BlockingQueued connections deadlock
Having a deadlock problem? The solution is more locks!
2015-10-24 15:35:08 +02:00
tux3
c0d8703368
Properly signal when we stop sending video
And properly handle toxav happily delivering things out of order,
like firing a video frame callback right after a callback setting the bitrate to 0,
when the peer sent these commands in the right order
2015-10-24 04:26:39 +02:00
tux3
aaf04a80db
Remove some debug output 2015-10-24 02:46:34 +02:00
tux3
1dc7e4cca5
Add 45s call ringing timeout 2015-10-24 01:53:10 +02:00
tux3
8d2ae07c9f
Revert "Delete CoreAV from the Core thread"
This reverts commit 1f758efc2f.
2015-10-23 20:05:35 +02:00