Commit Graph

40 Commits (master)

Author SHA1 Message Date
minerjr 9ee2595ac1 Reduced the time_mutx lock to 1 second from 3 seconds
Originally setup with 3 second as a was not sure how long it would take to recover, but 1 second should be good to recover and enumerate devices.
2025-10-29 21:39:57 -03:00
minerjr b37a210e38 Fixed up the i prefix to g to follow coding standards
Changed iWebRTCUpdateDevices and iAudioDeviceMutex to gWebRTCUpdateDevicesand gAudioDeviceMutex to follow Firestorm coding standards.

They are global static variables.
2025-10-29 15:37:55 -03:00
minerjr f6ce46c726 Fixed up not python operator to proper C++ operator
Fixed up the follow Firestorm coding standards.
2025-10-29 15:21:51 -03:00
minerjr cc3bae406c FIRE-36022 - Removing my USB headset crashes entire viewer - FMOD fixes
Added three FMOD specific changes based upon reading the FMOD manual.
See: https://www.fmod.com/docs/2.00/api/platforms-win.html
As well, switched to using the FMOD log version of the library and found one error on the get advanced features.

Also, the call back method should be a static method. Just being cautious.
2025-10-28 23:30:18 -03:00
minerjr 6ad9a57c39 FIRE-36022 - Removing my USB headset crashes entire viewer - audio device mutex
As with the previous change, this is to address the issue FIRE-36022 where users who remove their USB headsets with microphones are having the viewer lock up.

This introduces a new inline mutex called iAudioDeviceMutex. This is stored in a shared header file located on llcommon. iAudioDeviceMutex is a timed_mutex which allows for a time limit to be placed on a wait for a lock. Once the time runs out or the lock is achiveved the code moves on. With a check after the lock, if the owner is the current thread, then the lock was successful, otherwise it's still being used by another thread and the function should exit to try again later on.

This logic is wrapping WebRTC, FMOD and Vinvox calls to the audio hardware by the Viewer. OpenAL does not currently support changing of audio hardware and always defaults to the default audio hardware.

Added exceptions handling for the new unique_lock with the timed_mutex as they can throw 2 exceptions if the thread is already locked by the current thread and if the mutex is invalid.

Further testing may reveal other areas which would need the timed_mutex added to protect from threads locking up.
2025-10-28 23:22:13 -03:00
Ansariel 096e32ff03 Update FMOD Studio to 2.03.07 on Windows 2025-04-22 13:53:58 +02:00
Ansariel 5f1a19af72 Merge remote-tracking branch 'LL/marchcat/x-ws-merge'
# Conflicts:
#	autobuild.xml
#	indra/linux_crash_logger/llcrashloggerlinux.cpp
#	indra/newview/llappviewerlinux_api.h
#	indra/newview/llappviewerlinux_api_dbus.cpp
#	indra/newview/llappviewerlinux_api_dbus.h
#	indra/newview/llavatarpropertiesprocessor.h
#	indra/newview/llcallbacklist.cpp
#	indra/newview/llimpanel.h
2024-05-01 12:30:57 +02:00
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Ansariel 9b93864eb9 Merge branch 'DRTVWR-582-maint-U' of https://github.com/secondlife/viewer
# Conflicts:
#	autobuild.xml
#	indra/cmake/CMakeLists.txt
#	indra/llaudio/llaudioengine_fmodstudio.cpp
#	indra/llcommon/llsdserialize.cpp
#	indra/llcommon/llsdserialize.h
#	indra/llcommon/tests/llleap_test.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llfilepicker_mac.mm
#	indra/newview/llinventorymodel.cpp
#	indra/newview/llstartup.cpp
#	indra/newview/llurldispatcher.cpp
#	indra/newview/llvieweraudio.cpp
#	indra/newview/skins/default/xui/en/menu_viewer.xml
#	indra/newview/skins/default/xui/en/strings.xml
2023-04-21 14:22:42 +02:00
Alexander Gavriliuk ba8bcf6520 SL-19042: Replace FMOD with VLC for parcel audio 2023-04-04 19:44:07 +02:00
Ansariel 656dd12dfc Merge branch 'master' of https://vcs.firestormviewer.org/phoenix-firestorm
# Conflicts:
#	indra/newview/llmodelpreview.h
2022-09-15 20:35:44 +02:00
Andrey Lihatskiy 329268c5f7 Merge branch 'master' into DRTVWR-548-maint-N
# Conflicts:
#	indra/newview/llmodelpreview.h
2022-09-15 20:44:04 +03:00
Ansariel 7185e97905 Merge branch 'DRTVWR-548-maint-N' of https://bitbucket.org/lindenlab/viewer
# Conflicts:
#	indra/llaudio/llaudiodecodemgr.cpp
#	indra/llaudio/llaudioengine.cpp
#	indra/llaudio/llaudioengine.h
#	indra/llaudio/llaudioengine_fmodstudio.cpp
#	indra/llrender/llrender.cpp
#	indra/llwindow/llwindowwin32.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llviewerwindow.cpp
#	indra/newview/pipeline.cpp
2022-06-15 10:38:52 +02:00
Cosmic Linden 3e60b53d52 SL-16182: Offload audio decoding from the main thread to the general work queue.
The work queue callback binds "this". This is deemed safe due to current dependencies, but see the associated comment in the return callback. There was some trial and error to get a this-binded lambda to compile.

Due to LLVorbisDecodeState writing to disk off-thread, limit audio decodes proportional to general worker thread count. Guess the thread count for now.
2022-06-14 11:31:52 -07:00
Ansariel ac2ee57edb Merge branch 'DRTVWR-544-maint' of https://bitbucket.org/lindenlab/viewer
# Conflicts:
#	indra/cmake/Copy3rdPartyLibs.cmake
#	indra/cmake/FMODSTUDIO.cmake
#	indra/llaudio/llaudioengine_fmodstudio.cpp
#	indra/llaudio/llstreamingaudio_fmodstudio.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llfloatersearch.cpp
#	indra/newview/llgroupactions.cpp
#	indra/newview/lllocationinputctrl.h
#	indra/newview/llnavigationbar.cpp
#	indra/newview/llnavigationbar.h
#	indra/newview/viewer_manifest.py
#	indra/viewer_components/login/lllogin.cpp
2022-04-19 15:27:35 +02:00
Andrey Kleshchev be820f2eb9 Revert "Debug Fmod with logging"
This reverts commits b21c17eee9 and 2f78338aeb.
'Debug Fmod' was not an intended commit, was meant for local testing. But might be a good idea to make this a part of DebWithRelInfo or provide a cmake switch.
2022-03-14 18:38:44 +02:00
Ansariel 63238d1fbe Merge branch 'DRTVWR-544-maint' of https://bitbucket.org/lindenlab/viewer
# Conflicts:
#	indra/cmake/Copy3rdPartyLibs.cmake
#	indra/cmake/FMODSTUDIO.cmake
#	indra/newview/llappviewer.cpp
#	indra/newview/llviewerregion.cpp
#	indra/newview/viewer_manifest.py
2022-03-01 19:19:48 +01:00
Andrey Lihatskiy 1e0eafd50c Merge branch 'master' into DRTVWR-544-maint
# Conflicts:
#	indra/llaudio/llstreamingaudio_fmodstudio.cpp
#	indra/newview/llviewerregion.cpp
2022-02-28 21:56:25 +02:00
Andrey Kleshchev 2f78338aeb Debug Fmod with logging 2022-02-23 10:45:25 +02:00
Ansariel f46a15b3f3 Merge branch 'DRTVWR-544-maint' of https://bitbucket.org/lindenlab/viewer 2022-01-11 15:04:11 +01:00
Andrey Kleshchev 993ac3b95c SL-16339 Rename setAmbient to not cause confusion
setAmbient has nothing to do with ambient sounds
2021-11-26 23:52:33 +02:00
Andrey Kleshchev bf78fdf362 SL-14992 Replaced LLAPRFile's isExist with LLDirUtil's fileExists in fmodstudio
This particular case of LLAPRFile crashes due to thread issues (and if it doesn't it might be affecting some other apr call due to using default pool).
Function is not opening the .dsf file in question and LLAPRFile won't ensure that file exists till the end of the function, it just checks that file exists at a given moment. No point to overcomplicate things by adding thread safe pool, so replaced with dirutil.
2021-03-26 22:52:09 +01:00
Andrey Kleshchev d38c2d8cd8 SL-14992 Replaced LLAPRFile's isExist with LLDirUtil's fileExists in fmodstudio
This particular case of LLAPRFile crashes due to thread issues (and if it doesn't it might be affecting some other apr call due to using default pool).
Function is not opening the .dsf file in question and LLAPRFile won't ensure that file exists till the end of the function, it just checks that file exists at a given moment. No point to overcomplicate things by adding thread safe pool, so replaced with dirutil.
2021-03-25 20:14:04 +02:00
Ansariel 51dcf9c4fd Fix merge errors 2020-04-23 19:39:48 +02:00
Ansariel f22474724e Merge branch 'DRTVWR-508' of https://bitbucket.org/lindenlab/viewer
# Conflicts:
#	indra/llaudio/llaudioengine_fmodstudio.cpp
#	indra/newview/llprogressview.cpp
#	indra/newview/viewer_manifest.py
2020-04-23 19:36:46 +02:00
Andrey Kleshchev 032c4a1b49 SL-12607 WIP, take pre-sized icons from repo instead of package 2020-04-14 21:32:10 +03:00
Ansariel 4268cc8c21 Final FMOD Studio upstream sync before merge 2020-04-10 18:15:42 +02:00
Andrey Kleshchev 2542a3ed79 SL-11445 Provide 'name' for Pulse Audio 2020-04-10 17:00:22 +03:00
Ansariel 904ee2dd90 More FMOD Studio sync with upstream 2020-04-09 16:32:00 +02:00
Andrey Kleshchev 1598a368cd SL-11445 On exit LLWindGen can be invalid 2020-04-09 16:57:19 +03:00
Andrey Kleshchev c0ce256591 SL-11445 Fix fmod studio position and orientation attributes 2020-04-09 16:04:37 +03:00
Andrey Kleshchev 8cb9bcf1d6 SL-11445 Fix fmod studio opening audio files 2020-04-09 13:12:30 +03:00
Ansariel 041d5a5c0b Sync FMOD Studio implementation with upstream so we can keep our version when merging with upstream 2020-04-09 00:43:56 +02:00
Andrey Kleshchev f5ec281b1b SL-11445 Fix crash caused by wind cleanup 2020-03-19 15:47:49 +02:00
Andrey Kleshchev 9a6dcc011c SL-11455 Added linux pulseaudio and alsa support 2020-02-05 00:58:37 +02:00
Andrey Kleshchev 192aee0f19 Merged in SL-11445 Upgrade Fmodex to Fmod Studio 2020-01-31 15:05:51 +00:00
Ansariel 562fce5a7d For for errors in FMOD::System::getDriverInfo calls 2019-06-27 23:37:13 +02:00
Ansariel 36a2de2353 Special request by Keli: Add output device selection for inworld sounds (only available with FMOD Studio!)
Selecting "Default" will always select the first output device; if the available
devices change and the previous default device isn't available anymore, the
viewer automatically switches to the new default device (depends on the OS which
gets the new default one!). Selecting a particular device will NOT automatically
switch to another device if it isn't available anymore (preferences will show
"Unavailable device"), but will switch back to this device once it becomes
available again.

Yank this change before Firestorm releases it and I will gladly yank your unreleased stuff!
2019-05-31 20:12:17 +02:00
Ansariel 5c1c3604b6 Somehow this got mangled up... 2018-01-09 23:15:13 +01:00
Ansariel 5e1c9a92a8 Add support for FMOD Studio, originally by Drake Arconis (Alchemy Viewer), with FS-specific additions by Drakeo 2017-12-16 19:34:03 +01:00