Commit graph

61 commits

Author SHA1 Message Date
Elad
575a245f8d
IDM: Implement lock-free smart pointers (#16403)
Replaces `std::shared_pointer` with `stx::atomic_ptr` and `stx::shared_ptr`.

Notes to programmers:

* This pr kills the use of `dynamic_cast`, `std::dynamic_pointer_cast` and `std::weak_ptr` on IDM objects, possible replacement is to save the object ID on the base object, then use idm::check/get_unlocked to the destination type via the saved ID which may be null. Null pointer check is how you can tell type mismatch (as dynamic cast) or object destruction (as weak_ptr locking).
* Double-inheritance on IDM objects should be used with care, `stx::shared_ptr` does not support constant-evaluated pointer offsetting to parent/child type.
* `idm::check/get_unlocked` can now be used anywhere.

Misc fixes:
* Fixes some segfaults with RPCN with interaction with IDM.
* Fix deadlocks in access violation handler due locking recursion.
* Fixes race condition in process exit-spawn on memory containers read.
* Fix bug that theoretically can prevent RPCS3 from booting - fix `id_manager::typeinfo` comparison to compare members instead of `memcmp` which can fail spuriously on padding bytes.
* Ensure all IDM inherited types of base, either has `id_base` or `id_type` defined locally, this allows to make getters such as `idm::get_unlocked<lv2_socket, lv2_socket_raw>()` which were broken before. (requires save-states invalidation)
* Removes broken operator[] overload of `stx::shared_ptr` and `stx::single_ptr` for non-array types.
2024-12-22 20:59:48 +02:00
RipleyTom
4832267307 Fixes audio buffering on non-windows platforms 2024-10-05 11:44:15 +03:00
Megamouse
bbb4c109d7 audio: allow to choose channel layouts 2024-03-28 07:17:26 +01:00
Megamouse
ff434f9d38 recording: cleanup audio config members
and fix some annyoing msvc warnings
2023-11-23 21:19:31 +01:00
Megamouse
55d6ee65ae cellAudio: silence cellAudioSendAck and add pseudo code for it 2023-03-28 20:26:04 +02:00
Megamouse
69ecf8aea7 cellAudio: re-use event_sources array 2023-03-28 20:26:04 +02:00
Megamouse
9375e255e1 overlays: add pages to home menu 2023-02-09 20:36:35 +01:00
Vestral
a1f9ff0aaa Cubeb: rewrite locking 2022-10-21 22:15:49 +02:00
Vestrel
648ad0cd90
cellAudio: fix downmix if device doesn't support multichannel (#12328)
* cellAudio: fix downmix if device doesn't support multichannel
* Downmix in 2 stages
2022-07-09 15:25:28 +02:00
Vestrel
98b730c806
Audio: device switching and channel count detection (#12246) 2022-07-08 17:13:38 +02:00
Elad Ashkenazi
fcd297ffb2
Savestates Support For PS3 Emulation (#10478) 2022-07-04 16:02:17 +03:00
capriots
a6237e5473
cellAudio(Out): properly implement all downmixing modes (#12252) 2022-06-19 17:08:03 +02:00
capriots
6bdf415adb Fix audio renderer not resetting after cellAudioOutConfigure() was called 2022-06-19 06:09:29 +02:00
Megamouse
ba96c6f3bb cellAudioOut: properly implement downMixer
If the PS3 downMixer is enabled, the game uses 8 channel input and 2 or 6 channel output
2022-06-09 18:59:13 +02:00
Megamouse
06e5b8a06a cellAudioOut: add stereo, 5.1 and 7.1 for covenience 2022-06-02 13:12:04 +02:00
Megamouse
94aef197dd cellAudioOut: switch to manual multi-selection of format as seen on PS3 2022-06-02 13:12:04 +02:00
Megamouse
72e1e242a3 cellAudio: use format instead of downmix 2022-06-02 13:12:04 +02:00
Eladash
d03fcad9bd cellAudio: Some bugfixes
* Reading position storage is 16 bytes aligned according to hw test.
* Fix cellAudioGetPortConfig portSize reporting, now matches PS3.
* Remove ghost code about unearthly 6 channels cellAudio port mode.
2022-05-10 22:39:34 +02:00
Vestrel
d1e468fefb
sys_rsxaudio: Initial implementation (#11907) 2022-05-05 15:47:44 +02:00
Vestral
107107107c SoundTouch resampler integration 2022-01-31 21:20:57 +01:00
Megamouse
68466f05b6 cellAudio: move some stuff to cpp 2021-12-09 01:46:44 +01:00
Vestral
e5005597fe CellAudio fixes 2021-11-29 20:43:00 +01:00
Vestrel
37a722cc1d
Audio backend improvements
Callback based audio update.
Upgraded common backend interface.
Added Cubeb backend.
Support multiple audio providers.
Dropped pulse, alsa, openal backends.
2021-11-24 19:41:05 +01:00
Megamouse
72f0637efe Windows/Audio: add listener for device change
For some reason XAudio2 doesn't automatically change the device anymore.
So let's just listen for the OnDefaultDeviceChanged event and update the cell audio thread if necessary.
2021-08-25 22:44:16 +02:00
Eladash
a992a5fba9 cellAudio: weak_ptr -> shared_ptr 2021-05-15 00:31:14 +03:00
Megamouse
a16d8ba3ea More random changes 2021-04-11 14:01:51 +03:00
Nekotekina
e321765c54 Split BEType.h to util/v128.hpp and util/to_endian.hpp 2020-12-13 16:34:45 +03:00
RipleyTom
af8c661a64 Remove BOM markers 2020-12-06 15:30:12 +03:00
Nekotekina
d1e7837422 atomic_t: cleanup type requirements
Add C++17 requirements.
Remove alignment requirements (auto-align type).
What's missing is to detect padding and forbid it.
2020-12-04 19:11:36 +03:00
Megamouse
2cee26c3e7 Cleanup some includes 2020-10-31 11:53:46 +01:00
Megamouse
c65b7d0aea HLE: Add some constants 2020-10-31 02:11:27 +03:00
Megamouse
53b95fea19 audio: rename audio channels to audio downmix
The setting does not actually define the channels themselves, only the downmix option that the PS3 provides.
Channels might be changed seperately in the future.
2020-07-08 21:11:23 +02:00
Megamouse
e2fd4e46f7 Only reboot audio if a relevant setting changed 2020-07-08 21:11:23 +02:00
Megamouse
20d6664dc1 Try to make most audio configs dynamic 2020-07-08 21:11:23 +02:00
Megamouse
bb0aaea92d cellAudio: implement downmix to 5.1 2020-07-08 21:11:23 +02:00
Eladash
ff04cd6d69 cellAudio: Fix event queue attachment 2020-06-14 02:31:23 +03:00
Megamouse
41eb6d4461 cellAudio improvements
- use CELL_AUDIO_BLOCK_32 where possible
- use CELL_AUDIO_BLOCK_SAMPLES where possible
- remove redundant logging
- return CELL_AUDIO_ERROR_AUDIOSYSTEM in cellAudioGetPortConfig (probably unreachable code anyway)
- return CELL_AUDIO_ERROR_PORT_OPEN in cellAudioPortOpen
- stub cellAudioSetPersonalDevice cellAudioUnsetPersonalDevice and cellAudioMiscSetAccessoryVolume
2020-06-04 23:09:47 +03:00
Nekotekina
8a176de6a1 Restore -Wenum-compare and fix some [=] warnings 2020-02-18 17:37:30 +03:00
Eladash
80eff58950 cellAudio: Implement cellAudioSet/RemoveNotifyEventQueueEx 2020-02-09 12:31:55 +00:00
RipleyTom
610a6a1404 Increases number of buffers when buffering 2020-01-27 02:13:30 +00:00
Eladash
1233c48d92 cellAudio: Implement event source 2019-11-25 09:04:56 +00:00
Nekotekina
36a528067c cellAudio: use g_fxo 2019-09-17 02:46:34 +03:00
Nekotekina
76314520ef cellAudio: use vm::gvar to allocate working memory 2019-09-17 02:46:34 +03:00
Lassi Hämäläinen
e9e87b8bd9 Add missing #includes to header files
- Multiple header files where missing #includes to other headers that
  where used in the header. Correct header was included in correct
  order in source files which caused everything to compile.
- Added missing #includes so header files correctly include all their
  dependencies and fixes problems with IDEs being unable to parse
  headers correctly due to missing symbols
2019-06-25 17:11:10 +03:00
Nekotekina
74d684b57e cellAudio: fix template arg style
Add constexpr if
2019-01-14 00:01:27 +03:00
Rui Pinheiro
49fbf9bf0f Tweaks to buffering algorithm
Increase untouched buffer timeout when some of the buffers have been
touched. Might improve audio quality on games that suffered from
miniscule popping even when buffering was enabled (such as DeS).

In addition, made time stretching algorithm slightly more aggressive.

Includes some other tiny tweaks as well.
2019-01-12 21:29:56 +03:00
Rui Pinheiro
48db0430d4 Misc. Tweaks 2019-01-12 21:29:56 +03:00
Rui Pinheiro
f17f984721 Add timeout for untouched buffers 2019-01-12 21:29:56 +03:00
Rui Pinheiro
67f9397746 Various fixes
In addition, linux builds (and ALSA/PA) now work again
2019-01-12 21:29:56 +03:00
Rui Pinheiro
892deb1552 Implement basic time stretching + Tweaks 2019-01-12 21:29:56 +03:00