Commit Graph

1528 Commits

Author SHA1 Message Date
zoltanvb
4350ec24be
Support device list for PulseAudio (#15174)
As mentioned in https://github.com/libretro/RetroArch/issues/14954,
audio device selection works only if respective functions are
implemented in audio driver.

Added sink listing and selection. Common menu code takes care of the rest.
2023-04-09 18:15:48 +01:00
libretroadmin
dc6b6d5cdb (XAudio) Header cleanups 2023-03-13 04:23:25 +01:00
libretroadmin
88cd91c586 Cleanup some xaudio headers 2023-03-13 04:12:18 +01:00
libretroadmin
7ebab640d7 Cleanups/style nits 2023-02-23 13:15:14 +01:00
sonninnos
482c8ccf35
Add dropdown menu for audio device (#14914) 2023-01-28 02:22:08 +01:00
libretroadmin
daa9e352cc Remove asserts 2023-01-09 00:51:05 +01:00
Skirlez
8a127eff02 Better scrolling sound implementation, add new 'notice back' sound
The closing info box sound (NOTICE_BACK) plays if you have the regular notice sound on, implemented generally.

audio_driver_mixer_play_menu_sound(i) will now stop sound i before playing it, so when you for example, cancel in rapid succession, it will properly play all canceling sound effects instead of not doing anything if the sound is already playing.

This scrolling implementation is a lot more general than the first one, to the point where RGUI plays all the correct sounds without any special additions. However, the Ozone sidebar scrolling or category switching in XMB or MaterialUI are still handled inside their driver .c files.
This implementation also fixes an issue where if wraparound was disabled the sound would still play if you held on a direction. I've also fixed it manually for XMB category switching, since it's still handled there individually (turns out, Ozone sidebar and MaterialUI categories just don't respect the no wraparound option, so there's no need to implement a fix there as well)
2023-01-07 12:09:11 +01:00
libretroadmin
0c42e339e1 Silence some warnings that popup in Xcode 2023-01-04 18:42:35 +01:00
Skirlez
f84093496f implement scrolling sounds for ozone
using roughly the same implementation for the ok/notice/cancel sounds, but i've made an exclusive function for scrolling since it's going to be called a lot more than those sounds
2023-01-03 19:34:35 +01:00
zoltanvb
8bfa02e2ea
Fix for #14725 (#14750)
Revert one modification in 0f24d52407 that
makes "add to mixer" options do nothing.
2022-12-21 19:08:07 +01:00
libretroadmin
85598f24ad defines/ headers are libretro-common headers, search for them in
system header includes - other cleanups/nits
2022-12-15 15:09:40 +01:00
libretroadmin
5e6d917417 (audio/roar) remove errno.h include 2022-12-15 14:49:11 +01:00
Ruben Nine
db9d3d3507
Allow coreaudio3 driver to work with audio devices that have 2 or more output channels. (#14715) 2022-12-10 16:08:26 +01:00
sonninnos
3377fd55ab
Driver + hotkey list reorder (#14646)
* Reorder driver menu and lists

* Reorder hotkey list
2022-11-20 07:26:34 +01:00
LibretroAdmin
41de5ec80b Cleanups for runloop_state grabbing 2022-10-10 20:32:46 +02:00
LibretroAdmin
cc3a339011 (Runloop) Use more flags 2022-10-10 19:54:54 +02:00
LibretroAdmin
2371e5cbd2 (Runloop) Turn more bools into flags 2022-10-10 18:53:55 +02:00
LibretroAdmin
479e3b23d9 Turn content_get_status into content_get_flags 2022-10-09 20:32:39 +02:00
LibretroAdmin
d5a6c4f150 (content) use flags for content_state
(xaudio2) Use flags
2022-10-09 10:20:43 +02:00
LibretroAdmin
d506210fbe
(menu_driver.c) Use flags instead of bools (#14500)
* (menu_driver.c) Use flags instead of bools
2022-10-08 22:52:18 +02:00
LibretroAdmin
fcbd72dbf3
Use flags pt4 (#14497)
* * Use flags for rarch_state
* Get rid of ^M linebreaks in retroarch_types.h

* Buildfixes for consoles

* (audio driver) use flags instead of bools

* (video) Use flags instead of bools

* Rewrite input driver state bools into flags
2022-10-08 10:39:15 +02:00
LibretroAdmin
ace21d28f7 Fix C++ comments 2022-10-01 17:56:16 +02:00
LibretroAdmin
b2634ea588 * Create fill_pathname_join_special - and specify fill_pathname_join
as deprecated.
* Use fill_pathname_join_special in the vast majority of cases where
we can ensure out_path is a new empty string
* Get rid of some extension concatenation with strlcat where encountered
* Some general cleanups with NULL termination of strings that get immediately
passed to strlcpy/strlcpy-adjacent functions
2022-08-04 14:19:38 +02:00
libretroadmin
8ac1a36259 Don't do NULL termination on strings when passing to strlcpy and/or
a file_path function that calls strlcpy under the hood
2022-07-26 07:01:10 +02:00
LibretroAdmin
29774f5b7a
Small opts (#14186)
* (joypad_connection) Small optimizations -
* Turn functions static where possible
* Hose strlen call out of loop

* (input_driver.c) General cleanups:
* Some small code/style nits

task_screenshot.c:
* Move widget callback function for screenshots to task_screenshot.c

(file_path.c):
* Turn get_pathname_num_slashes into static function
* path_linked_list_free - always returns true, so get rid of return value
* path_linked_list_new - fix function signature
* path_get_archive_delim - do not NULL-terminate string, already done by strlcpy later on

General:
* Slight optimizations - use int/size_t for loop counter variable instead of unsigned
* Take advantage of fact that strlcpy already NULL-terminates, so don't do this explicitly
outside if we're just going to end up calling strlcpy/fill_pathname_join on it anyway
2022-07-19 10:01:33 +02:00
libretroadmin
adf9994828 Deprecate fill_pathname_base_noext 2022-07-11 20:13:44 +02:00
libretroadmin
0f24d52407 audio_driver_mixer_add_stream - add fall-through - simplify code 2022-07-09 13:44:55 +02:00
libretroadmin
f12ad9ed34 Simplify audio mixer functions 2022-07-05 18:57:56 +02:00
LibretroAdmin
4a38831c47
Try to reduce fixed size char arrays from PATH_MAX_LENGTH to lower sizes (#14062)
* Try to reduce fixed size char arrays from PATH_MAX_LENGTH to lower sizes
2022-06-18 19:07:15 +02:00
libretroadmin
a14ccc2d4d (Orbis) Remove some logs 2022-05-22 19:59:20 +02:00
OsirizX
c6d51fdb32 [ORBIS] Initial changes for PS4 2022-05-21 16:31:10 +02:00
jdgleaver
801b16885e Enable automatic configuration of 'VSync Swap Interval' 2022-05-12 14:22:46 +01:00
jSTE0
fccef557fc
miyoo: Enable ALSA audio driver and default to it (#13814)
Enable it as it does not freeze. This provides an audio backend that
can report its buffer status, allowing auto frame skip to work on cores
that support it.

Do not build or include alsathread as it results in choppy audio.
Similarly, leave tinyalsa disabled as it plays back at a higher pitch
and is also choppy.

Change the default sample rate to 32000Hz as the previous default of
32730Hz is derived from the 3DS.
2022-04-02 08:07:25 +01:00
twinaphex
4d112da58d Silence some MSVC code analysis warnings 2022-03-07 19:02:46 +01:00
Francisco Javier Trujillo Mata
86b47b4859
[PSP] Update Retroarch to latest PSPDev status (#13544)
* Added newlib changes

* Add action to launch PPSSPP simulator

* Remove legacy config for the stack and heap

* Add pthread

* Simplify kernel_functions and improve references to HAVE_KERNEL_PRX

* Add some flags

* Improve audio init/deinit

* Improve exit by clicking home

* Add CI for PSP1

* Update PSP.yml
2022-01-25 03:50:18 +01:00
Vladimir Serbinenko
4e24fb3d01
Add osx-ppc compilation for frontend (#13532)
* Fix old osx condition

Current code assumes that osx < 10.12 is equivalent to ppc osx. It's not
true as Leopard x86 is still < 10.12 but not ppc. As xcode compiles fat
binaries it includes osx x86 and compilation fails.

* Disable crtswitchres when no c++11 is available

Crtswitchres altually needs c++11. Since it's not that important to make
it compatible with lower c++, just disable if no c++11 is available

* Don't use firstObject on old Mac OS X.

It was introduced in 10.6, so on old ones just implement it ourselves

* Compile osx-ppc frontend

* osx-ppc: Build a fat binary

On 10.6 i386 xcode apparently refuses to build a pure ppc.
Settle for a fat binary.
2022-01-24 16:22:07 +01:00
Cthulhu-throwaway
690c802921
Netplay Stuff (#13375)
* Netplay Stuff

## PROTOCOL FALLBACK
In order to support older clients a protocol fallback system was introduced.
The host will no longer send its header automatically after a TCP connection is established, instead, it awaits for the client to send his before determining which protocol this connection is going to operate on.
Netplay has now two protocols, a low protocol and a high protocol; the low protocol is the minimum protocol it supports, while the high protocol is the highest protocol it can operate on.
To fully support older clients, a hack was necessary: sending the high protocol in the unused client's header salt field, while keeping the protocol field to the low protocol. Without this hack we would only be able to support older clients if a newer client was the host.
Any future system can make use of this system by checking connection->netplay_protocol, which is available for both the client and host.

## NETPLAY CHAT
Starting with protocol 6, netplay chat is available through the new NETPLAY_CMD_PLAYER_CHAT command.
Limitations of the command code, which causes a disconnection on unknown commands, makes this system not possible on protocol 5.
Protocol 5 connections can neither send nor receive chat, but other netplay operations are unaffected.
Clients send chat as a string to the server, and it's the server's sole responsability to relay chat messages.
As of now, sending chat uses RetroArch's input menu, while the display of on-screen chat uses a widget overlay and RetroArch's notifications as a fallback.
If a new overlay and/or input system is desired, no backwards compatibility changes need to be made.
Only clients in playing mode (as opposed to spectating mode) can send and receive chat.

## SETTINGS SHARING
Some settings are better used when both host and clients share the same configuration.
As of protocol 6, the following settings will be shared from host to clients (without altering a client's configuration file): input latency frames and allow pausing.

## NETPLAY TUNNEL/MITM
With the current MITM system being defunct (at least as of 1.9.X), a new system was in order to solve most if not all of the problems with the current system.
This new system uses a tunneling approach, which is similar to most VPN and tunneling services around.

Tunnel commands:
RATS[unique id] (RetroArch Tunnel Session) - 16 bytes -> When this command is sent with a zeroed unique id, the tunnel server interprets this as a netplay host wanting to create a new session, in this case, the same command is returned to the host, but now with its unique session id. When a client needs to connect to a host, this command is sent with the unique session id of the host, causing the tunnel server to send a RATL command to the host.
RATL[unique id] (RetroArch Tunnel Link) - 16 bytes -> The tunnel server sends this command to the host when a client wants to connect to the host. Once the host receives this command, it establishes a new connection to the tunnel server, sending this command together with the client's unique id through this new connection, causing the tunnel server to link this connection to the connection of the client.
RATP (RetroArch Tunnel Ping) - 4 bytes -> The tunnel server sends this command to verify that the host, whom the session belongs to, is still around. The host replies with the same command. A session is closed if the tunnel server can not verify that the host is alive.

Operations:
Host -> Instead of listening and accepting connections, it connects to the tunnel server, requests a new session and then monitor this connection for new linking requests. Once a request is received, it establishes a new connection to the tunnel server for linking with a client. The tunnel server's address and port are obtained by querying the lobby server. The host will publish its session id together with the rest of its info to the lobby server.
Client -> It connects to the tunnel server and then sends the session id of the host it wants to connect to. A host's session id is obtained from the json data sent by the lobby server.

Improvements (from current MITM system):
No longer a risk of TCP port exhaustion; we only use one port now at the tunnel server.
Very little cpu usage. About 95% net I/O bound now.
Future backwards compatible with any and all changes to netplay as it no longer runs any netplay logic at MITM servers.
No longer operates the host in client mode, which was a source of many of the current problems.
Cleaner and more maintainable system and code.

Notable functions:
netplay_mitm_query -> Grabs the tunnel's address and port from the lobby server.
init_tcp_socket -> Handles the creation and operation mode of the TCP socket based on whether it's host, host+MITM or client.
handle_mitm_connection -> Creates and completes linking connections and replies to ping commands (only 1 of each per call to not affect performance).

## MISC
Ping Limiter: If a client's estimated latency to the server is higher than this value, connection will be dropped just before finishing the netplay handshake.
Ping Counter: A ping counter (similar to the FPS one) can be shown in the bottom right corner of the screen, if you are connected to a host.
LAN Discovery: Refactored and moved to its own "Refresh Netplay LAN List" button.

## FIXES
Many minor fixes to the current netplay implementation are also included.

* Remove NETPLAY_TEST_BUILD
2021-12-19 16:58:01 +01:00
jdgleaver
e3217b4a35
Remove frame limit from audio batch callback (#13333) 2021-12-06 18:11:46 +01:00
Poligraf
b4ef32cfce
add oss audio to retrofw (#13303)
Co-authored-by: Poligraf <>
2021-12-01 17:19:39 +01:00
twinaphex
b4137915e8 Move code to proper locations 2021-11-23 16:58:36 +01:00
Autechre
1280151d13
Merge pull request #13216 from libretro/splitup-record
Split up recording code
2021-11-11 02:00:52 +01:00
twinaphex
86f899c844 Revert "Shorten character arrays that are passed to fill_pathname_base_noext"
This reverts commit 318108ac82.
2021-11-10 08:22:19 +01:00
twinaphex
0b768d0460 Split up recording code 2021-11-10 02:34:04 +01:00
twinaphex
318108ac82 Shorten character arrays that are passed to fill_pathname_base_noext 2021-11-10 00:09:33 +01:00
twinaphex
88c771fc66 Cleanups 2021-11-07 01:44:45 +01:00
twinaphex
514ed00f2d Move configuration state over to configuration.c - take it out of
p_rarch
2021-11-03 21:22:37 +01:00
mahoneyt944
df6b1c306f
Log 2021-10-19 09:46:40 -04:00
twinaphex
70b337782d Fix MSVC build 2021-10-15 00:11:52 +02:00
twinaphex
d87e0c1744 * Fix implicit declaration
* Move more code to gfx/video_driver.c
2021-10-13 16:36:38 +02:00
twinaphex
e47e9968ed Move audio_driver_menu_sample to audio_driver.c and turn
audio_driver_flush into static function
2021-10-13 16:29:41 +02:00