2015-01-09 15:56:21 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2016-01-10 03:06:50 +00:00
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
2016-10-27 16:17:43 +00:00
|
|
|
* Copyright (C) 2014-2016 - Jean-André Santoni
|
2019-01-09 22:19:19 +00:00
|
|
|
* Copyright (C) 2016-2019 - Brad Parker
|
2016-03-10 22:36:46 +00:00
|
|
|
*
|
2015-01-09 15:56:21 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2015-11-02 19:41:42 +00:00
|
|
|
#ifndef __RARCH_CONFIGURATION_H__
|
|
|
|
#define __RARCH_CONFIGURATION_H__
|
2015-01-09 15:56:21 +00:00
|
|
|
|
2015-03-21 06:05:08 +00:00
|
|
|
#include <stdint.h>
|
2015-12-05 06:45:36 +00:00
|
|
|
|
2015-12-06 12:12:27 +00:00
|
|
|
#include <boolean.h>
|
2016-06-03 01:22:35 +00:00
|
|
|
#include <retro_common_api.h>
|
2017-04-29 11:20:50 +00:00
|
|
|
#include <retro_miscellaneous.h>
|
2015-12-05 06:45:36 +00:00
|
|
|
|
2021-09-01 23:12:24 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2019-01-31 19:43:07 +00:00
|
|
|
#include "gfx/video_defines.h"
|
2017-12-27 16:05:12 +00:00
|
|
|
#include "led/led_defines.h"
|
2015-03-21 06:05:08 +00:00
|
|
|
|
2021-04-17 21:54:45 +00:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
#include "lakka.h"
|
|
|
|
#endif
|
|
|
|
|
2021-09-01 23:12:24 +00:00
|
|
|
#include "msg_hash.h"
|
|
|
|
|
2017-09-27 22:03:50 +00:00
|
|
|
#define configuration_set_float(settings, var, newvar) \
|
2017-12-03 02:43:05 +00:00
|
|
|
{ \
|
2017-09-27 22:03:50 +00:00
|
|
|
settings->modified = true; \
|
2017-12-03 02:43:05 +00:00
|
|
|
var = newvar; \
|
|
|
|
}
|
2017-09-27 22:03:50 +00:00
|
|
|
|
|
|
|
#define configuration_set_bool(settings, var, newvar) \
|
2017-12-03 02:43:05 +00:00
|
|
|
{ \
|
2017-09-27 22:03:50 +00:00
|
|
|
settings->modified = true; \
|
2017-12-03 02:43:05 +00:00
|
|
|
var = newvar; \
|
2017-12-12 07:55:31 +00:00
|
|
|
}
|
2017-09-27 22:03:50 +00:00
|
|
|
|
|
|
|
#define configuration_set_uint(settings, var, newvar) \
|
2017-12-03 02:43:05 +00:00
|
|
|
{ \
|
2017-09-27 22:03:50 +00:00
|
|
|
settings->modified = true; \
|
2017-12-03 02:43:05 +00:00
|
|
|
var = newvar; \
|
|
|
|
}
|
2017-09-27 22:03:50 +00:00
|
|
|
|
|
|
|
#define configuration_set_int(settings, var, newvar) \
|
2017-12-03 02:43:05 +00:00
|
|
|
{ \
|
2017-09-27 22:03:50 +00:00
|
|
|
settings->modified = true; \
|
2017-12-03 02:43:05 +00:00
|
|
|
var = newvar; \
|
|
|
|
}
|
2017-09-27 22:03:50 +00:00
|
|
|
|
2020-03-05 11:22:58 +00:00
|
|
|
#define configuration_set_string(settings, var, newvar) \
|
|
|
|
{ \
|
|
|
|
settings->modified = true; \
|
|
|
|
strlcpy(var, newvar, sizeof(var)); \
|
|
|
|
}
|
|
|
|
|
2023-05-30 19:03:36 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
|
|
|
|
2018-09-16 23:30:49 +00:00
|
|
|
enum crt_switch_type
|
|
|
|
{
|
|
|
|
CRT_SWITCH_NONE = 0,
|
|
|
|
CRT_SWITCH_15KHZ,
|
2021-05-11 09:08:15 +00:00
|
|
|
CRT_SWITCH_31KHZ,
|
|
|
|
CRT_SWITCH_32_120,
|
|
|
|
CRT_SWITCH_INI
|
2018-09-16 23:30:49 +00:00
|
|
|
};
|
|
|
|
|
2016-08-31 13:21:12 +00:00
|
|
|
enum override_type
|
|
|
|
{
|
|
|
|
OVERRIDE_NONE = 0,
|
2023-08-21 23:11:48 +00:00
|
|
|
OVERRIDE_AS,
|
2016-08-31 13:21:12 +00:00
|
|
|
OVERRIDE_CORE,
|
2018-05-13 21:20:51 +00:00
|
|
|
OVERRIDE_CONTENT_DIR,
|
2016-08-31 13:21:12 +00:00
|
|
|
OVERRIDE_GAME
|
|
|
|
};
|
2016-08-26 05:44:05 +00:00
|
|
|
|
2015-03-20 18:32:46 +00:00
|
|
|
typedef struct settings
|
2015-03-20 18:15:08 +00:00
|
|
|
{
|
2017-04-27 22:00:43 +00:00
|
|
|
struct
|
|
|
|
{
|
2020-08-14 15:28:05 +00:00
|
|
|
size_t placeholder;
|
|
|
|
size_t rewind_buffer_size;
|
|
|
|
} sizes;
|
2017-04-28 12:57:55 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
video_viewport_t video_viewport_custom; /* int alignment */
|
2017-04-28 12:57:55 +00:00
|
|
|
|
2017-04-28 17:12:48 +00:00
|
|
|
struct
|
|
|
|
{
|
2017-04-28 18:08:12 +00:00
|
|
|
int placeholder;
|
2017-04-28 17:12:48 +00:00
|
|
|
int netplay_check_frames;
|
|
|
|
int location_update_interval_ms;
|
|
|
|
int location_update_interval_distance;
|
|
|
|
int state_slot;
|
Replay UI support (#15048)
* Add bsv replay controls (not yet fully implemented), remove toggle
see notes in task_movie.c, make sure command.c calls the right
functions, check retroarch.c and other todos.
bsv files are also now stored with states, not saves.
* Compilation fixes
* Added command impls for play and record replay, and some code in load state to do the right thing there
* Guard some parts of the new code with HAVE_BSV_MOVIE
* wip, menu fixes
* more menu fixes, osd for movie errors, halt recording properly
* Menu and label fixes
* move bsvs to own file suffix series under savestates, fix recording and playback command validity checks
* Fix replay autoincrement
* fix endif placement, whoops
---------
Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-02 23:52:22 +00:00
|
|
|
int replay_slot;
|
2018-09-16 19:00:04 +00:00
|
|
|
int crt_switch_center_adjust;
|
2020-07-28 13:25:38 +00:00
|
|
|
int crt_switch_porch_adjust;
|
2019-06-13 16:47:08 +00:00
|
|
|
#ifdef HAVE_VULKAN
|
|
|
|
int vulkan_gpu_index;
|
2019-06-18 20:33:37 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_D3D10
|
|
|
|
int d3d10_gpu_index;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_D3D11
|
|
|
|
int d3d11_gpu_index;
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_D3D12
|
|
|
|
int d3d12_gpu_index;
|
2021-08-11 17:13:40 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_WINDOW_OFFSET
|
|
|
|
int video_window_offset_x;
|
|
|
|
int video_window_offset_y;
|
2019-06-13 16:47:08 +00:00
|
|
|
#endif
|
2019-07-30 16:11:43 +00:00
|
|
|
int content_favorites_size;
|
2022-08-17 06:23:07 +00:00
|
|
|
#ifdef _3DS
|
|
|
|
int bottom_font_color_red;
|
|
|
|
int bottom_font_color_green;
|
|
|
|
int bottom_font_color_blue;
|
|
|
|
int bottom_font_color_opacity;
|
2022-09-26 10:57:20 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_XMB
|
|
|
|
int menu_xmb_title_margin;
|
|
|
|
int menu_xmb_title_margin_horizontal_offset;
|
2022-08-17 06:23:07 +00:00
|
|
|
#endif
|
2017-04-28 17:12:48 +00:00
|
|
|
} ints;
|
|
|
|
|
2017-04-28 19:03:04 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned placeholder;
|
2020-08-27 15:03:43 +00:00
|
|
|
|
|
|
|
unsigned input_split_joycon[MAX_USERS];
|
2021-06-17 16:45:24 +00:00
|
|
|
unsigned input_joypad_index[MAX_USERS];
|
2020-08-27 15:03:43 +00:00
|
|
|
unsigned input_device[MAX_USERS];
|
|
|
|
unsigned input_mouse_index[MAX_USERS];
|
2022-03-15 15:51:20 +00:00
|
|
|
|
2020-08-27 15:03:43 +00:00
|
|
|
unsigned input_libretro_device[MAX_USERS];
|
|
|
|
unsigned input_analog_dpad_mode[MAX_USERS];
|
|
|
|
|
2021-06-17 16:45:24 +00:00
|
|
|
unsigned input_remap_ports[MAX_USERS];
|
2020-08-27 15:03:43 +00:00
|
|
|
unsigned input_remap_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END];
|
2021-06-17 16:45:24 +00:00
|
|
|
unsigned input_keymapper_ids[MAX_USERS][RARCH_CUSTOM_BIND_LIST_END];
|
|
|
|
unsigned input_remap_port_map[MAX_USERS][MAX_USERS + 1];
|
2020-08-27 15:03:43 +00:00
|
|
|
|
|
|
|
unsigned led_map[MAX_LEDS];
|
|
|
|
|
2021-05-21 20:36:46 +00:00
|
|
|
unsigned audio_output_sample_rate;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned audio_block_frames;
|
|
|
|
unsigned audio_latency;
|
|
|
|
|
2023-11-19 16:44:25 +00:00
|
|
|
#ifdef HAVE_WASAPI
|
|
|
|
unsigned audio_wasapi_sh_buffer_length;
|
|
|
|
#endif
|
|
|
|
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 19:55:06 +00:00
|
|
|
#ifdef HAVE_MICROPHONE
|
|
|
|
unsigned microphone_sample_rate;
|
|
|
|
unsigned microphone_block_frames;
|
|
|
|
unsigned microphone_latency;
|
|
|
|
unsigned microphone_resampler_quality;
|
2023-11-19 16:44:25 +00:00
|
|
|
#ifdef HAVE_WASAPI
|
|
|
|
unsigned microphone_wasapi_sh_buffer_length;
|
|
|
|
#endif
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 19:55:06 +00:00
|
|
|
#endif
|
|
|
|
|
2019-08-20 01:05:52 +00:00
|
|
|
unsigned fps_update_interval;
|
2020-07-19 16:52:57 +00:00
|
|
|
unsigned memory_update_interval;
|
2019-08-20 01:05:52 +00:00
|
|
|
|
2019-02-08 01:17:00 +00:00
|
|
|
unsigned input_block_timeout;
|
|
|
|
|
2017-12-31 20:25:07 +00:00
|
|
|
unsigned audio_resampler_quality;
|
2017-04-28 19:03:04 +00:00
|
|
|
|
|
|
|
unsigned input_turbo_period;
|
|
|
|
unsigned input_turbo_duty_cycle;
|
2019-12-25 06:13:01 +00:00
|
|
|
unsigned input_turbo_mode;
|
|
|
|
unsigned input_turbo_default_button;
|
2017-04-28 19:03:04 +00:00
|
|
|
|
|
|
|
unsigned input_bind_timeout;
|
2018-04-04 08:33:59 +00:00
|
|
|
unsigned input_bind_hold;
|
2019-09-14 22:46:02 +00:00
|
|
|
#ifdef GEKKO
|
|
|
|
unsigned input_mouse_scale;
|
|
|
|
#endif
|
2021-04-06 11:15:43 +00:00
|
|
|
unsigned input_touch_scale;
|
2020-06-06 19:39:51 +00:00
|
|
|
unsigned input_hotkey_block_delay;
|
2021-09-24 16:30:46 +00:00
|
|
|
unsigned input_quit_gamepad_combo;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned input_menu_toggle_gamepad_combo;
|
|
|
|
unsigned input_keyboard_gamepad_mapping_type;
|
|
|
|
unsigned input_poll_type_behavior;
|
2021-09-04 14:29:54 +00:00
|
|
|
unsigned input_rumble_gain;
|
2021-01-13 15:00:36 +00:00
|
|
|
unsigned input_auto_game_focus;
|
2021-07-30 15:38:39 +00:00
|
|
|
unsigned input_max_users;
|
2020-11-17 15:59:39 +00:00
|
|
|
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned netplay_port;
|
2021-11-05 17:52:56 +00:00
|
|
|
unsigned netplay_max_connections;
|
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 15:58:01 +00:00
|
|
|
unsigned netplay_max_ping;
|
2022-08-08 18:09:06 +00:00
|
|
|
unsigned netplay_chat_color_name;
|
|
|
|
unsigned netplay_chat_color_msg;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned netplay_input_latency_frames_min;
|
|
|
|
unsigned netplay_input_latency_frames_range;
|
2017-09-11 01:46:18 +00:00
|
|
|
unsigned netplay_share_digital;
|
|
|
|
unsigned netplay_share_analog;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned bundle_assets_extract_version_current;
|
|
|
|
unsigned bundle_assets_extract_last_version;
|
|
|
|
unsigned content_history_size;
|
2019-08-19 23:18:26 +00:00
|
|
|
unsigned frontend_log_level;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned libretro_log_level;
|
|
|
|
unsigned rewind_granularity;
|
2018-07-13 20:12:09 +00:00
|
|
|
unsigned rewind_buffer_size_step;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned autosave_interval;
|
2023-03-09 22:14:02 +00:00
|
|
|
unsigned replay_checkpoint_interval;
|
Replay UI support (#15048)
* Add bsv replay controls (not yet fully implemented), remove toggle
see notes in task_movie.c, make sure command.c calls the right
functions, check retroarch.c and other todos.
bsv files are also now stored with states, not saves.
* Compilation fixes
* Added command impls for play and record replay, and some code in load state to do the right thing there
* Guard some parts of the new code with HAVE_BSV_MOVIE
* wip, menu fixes
* more menu fixes, osd for movie errors, halt recording properly
* Menu and label fixes
* move bsvs to own file suffix series under savestates, fix recording and playback command validity checks
* Fix replay autoincrement
* fix endif placement, whoops
---------
Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-02 23:52:22 +00:00
|
|
|
unsigned replay_max_keep;
|
2020-11-20 17:32:10 +00:00
|
|
|
unsigned savestate_max_keep;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned network_cmd_port;
|
|
|
|
unsigned network_remote_base_port;
|
2017-09-10 16:57:07 +00:00
|
|
|
unsigned keymapper_port;
|
2017-12-11 23:12:32 +00:00
|
|
|
unsigned video_window_opacity;
|
2018-09-16 23:30:49 +00:00
|
|
|
unsigned crt_switch_resolution;
|
2018-06-19 06:50:33 +00:00
|
|
|
unsigned crt_switch_resolution_super;
|
2020-11-23 20:29:26 +00:00
|
|
|
unsigned screen_brightness;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned video_monitor_index;
|
|
|
|
unsigned video_fullscreen_x;
|
|
|
|
unsigned video_fullscreen_y;
|
2022-09-05 02:03:04 +00:00
|
|
|
unsigned video_scale;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned video_max_swapchain_images;
|
2022-06-06 21:06:23 +00:00
|
|
|
unsigned video_max_frame_latency;
|
2017-04-28 19:03:04 +00:00
|
|
|
unsigned video_swap_interval;
|
|
|
|
unsigned video_hard_sync_frames;
|
|
|
|
unsigned video_frame_delay;
|
|
|
|
unsigned video_viwidth;
|
|
|
|
unsigned video_aspect_ratio_idx;
|
|
|
|
unsigned video_rotation;
|
2019-02-21 05:31:55 +00:00
|
|
|
unsigned screen_orientation;
|
2017-10-10 18:53:32 +00:00
|
|
|
unsigned video_msg_bgcolor_red;
|
|
|
|
unsigned video_msg_bgcolor_green;
|
|
|
|
unsigned video_msg_bgcolor_blue;
|
2018-09-15 22:44:46 +00:00
|
|
|
unsigned video_stream_port;
|
2018-09-23 23:43:26 +00:00
|
|
|
unsigned video_record_quality;
|
|
|
|
unsigned video_stream_quality;
|
2018-09-24 00:53:13 +00:00
|
|
|
unsigned video_record_scale_factor;
|
|
|
|
unsigned video_stream_scale_factor;
|
2019-04-15 16:05:55 +00:00
|
|
|
unsigned video_3ds_display_mode;
|
2020-10-05 13:31:26 +00:00
|
|
|
unsigned video_dingux_ipu_filter_type;
|
2021-04-06 13:02:40 +00:00
|
|
|
unsigned video_dingux_refresh_rate;
|
2021-07-21 13:11:42 +00:00
|
|
|
unsigned video_dingux_rs90_softfilter_type;
|
2019-06-04 14:50:47 +00:00
|
|
|
#ifdef GEKKO
|
|
|
|
unsigned video_overscan_correction_top;
|
|
|
|
unsigned video_overscan_correction_bottom;
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
unsigned video_shader_delay;
|
2021-01-09 16:14:38 +00:00
|
|
|
#ifdef HAVE_SCREENSHOTS
|
2020-08-14 15:28:05 +00:00
|
|
|
unsigned notification_show_screenshot_duration;
|
|
|
|
unsigned notification_show_screenshot_flash;
|
2021-01-09 16:14:38 +00:00
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
|
|
|
|
/* Accessibility */
|
|
|
|
unsigned accessibility_narrator_speech_speed;
|
|
|
|
|
|
|
|
unsigned menu_timedate_style;
|
|
|
|
unsigned menu_timedate_date_separator;
|
|
|
|
unsigned gfx_thumbnails;
|
|
|
|
unsigned menu_left_thumbnails;
|
|
|
|
unsigned gfx_thumbnail_upscale_threshold;
|
|
|
|
unsigned menu_rgui_thumbnail_downscaler;
|
|
|
|
unsigned menu_rgui_thumbnail_delay;
|
|
|
|
unsigned menu_rgui_color_theme;
|
|
|
|
unsigned menu_xmb_animation_opening_main_menu;
|
|
|
|
unsigned menu_xmb_animation_horizontal_highlight;
|
|
|
|
unsigned menu_xmb_animation_move_up_down;
|
|
|
|
unsigned menu_xmb_layout;
|
|
|
|
unsigned menu_xmb_shader_pipeline;
|
|
|
|
unsigned menu_xmb_alpha_factor;
|
|
|
|
unsigned menu_xmb_theme;
|
|
|
|
unsigned menu_xmb_color_theme;
|
|
|
|
unsigned menu_xmb_thumbnail_scale_factor;
|
2022-01-07 07:46:49 +00:00
|
|
|
unsigned menu_xmb_vertical_fade_factor;
|
2020-08-14 15:28:05 +00:00
|
|
|
unsigned menu_materialui_color_theme;
|
|
|
|
unsigned menu_materialui_transition_animation;
|
|
|
|
unsigned menu_materialui_thumbnail_view_portrait;
|
|
|
|
unsigned menu_materialui_thumbnail_view_landscape;
|
|
|
|
unsigned menu_materialui_landscape_layout_optimization;
|
|
|
|
unsigned menu_ozone_color_theme;
|
|
|
|
unsigned menu_font_color_red;
|
|
|
|
unsigned menu_font_color_green;
|
|
|
|
unsigned menu_font_color_blue;
|
|
|
|
unsigned menu_rgui_internal_upscale_level;
|
|
|
|
unsigned menu_rgui_aspect_ratio;
|
|
|
|
unsigned menu_rgui_aspect_ratio_lock;
|
|
|
|
unsigned menu_rgui_particle_effect;
|
|
|
|
unsigned menu_ticker_type;
|
2021-03-26 01:06:56 +00:00
|
|
|
unsigned menu_scroll_delay;
|
2020-08-14 15:28:05 +00:00
|
|
|
unsigned menu_content_show_add_entry;
|
2022-02-22 18:23:48 +00:00
|
|
|
unsigned menu_content_show_contentless_cores;
|
2021-04-01 16:25:45 +00:00
|
|
|
unsigned menu_screensaver_timeout;
|
2021-04-13 12:58:42 +00:00
|
|
|
unsigned menu_screensaver_animation;
|
2022-11-10 14:46:44 +00:00
|
|
|
unsigned menu_remember_selection;
|
2020-08-14 15:28:05 +00:00
|
|
|
|
|
|
|
unsigned playlist_entry_remove_enable;
|
|
|
|
unsigned playlist_show_inline_core_name;
|
2021-12-30 19:14:57 +00:00
|
|
|
unsigned playlist_show_history_icons;
|
2020-08-14 15:28:05 +00:00
|
|
|
unsigned playlist_sublabel_runtime_type;
|
|
|
|
unsigned playlist_sublabel_last_played_style;
|
|
|
|
|
|
|
|
unsigned camera_width;
|
|
|
|
unsigned camera_height;
|
|
|
|
|
2022-10-30 05:31:27 +00:00
|
|
|
#ifdef HAVE_OVERLAY
|
2021-05-25 16:44:32 +00:00
|
|
|
unsigned input_overlay_show_inputs;
|
|
|
|
unsigned input_overlay_show_inputs_port;
|
2022-10-30 05:31:27 +00:00
|
|
|
unsigned input_overlay_dpad_diagonal_sensitivity;
|
|
|
|
unsigned input_overlay_abxy_diagonal_sensitivity;
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
|
|
|
|
unsigned run_ahead_frames;
|
|
|
|
|
|
|
|
unsigned midi_volume;
|
|
|
|
unsigned streaming_mode;
|
|
|
|
|
|
|
|
unsigned window_position_x;
|
|
|
|
unsigned window_position_y;
|
|
|
|
unsigned window_position_width;
|
|
|
|
unsigned window_position_height;
|
2021-08-16 16:48:09 +00:00
|
|
|
unsigned window_auto_width_max;
|
|
|
|
unsigned window_auto_height_max;
|
2020-08-14 15:28:05 +00:00
|
|
|
|
|
|
|
unsigned video_record_threads;
|
|
|
|
|
|
|
|
unsigned libnx_overclock;
|
|
|
|
unsigned ai_service_mode;
|
|
|
|
unsigned ai_service_target_lang;
|
|
|
|
unsigned ai_service_source_lang;
|
2023-10-24 07:27:06 +00:00
|
|
|
unsigned ai_service_poll_delay;
|
|
|
|
unsigned ai_service_text_position;
|
|
|
|
unsigned ai_service_text_padding;
|
2020-08-14 15:28:05 +00:00
|
|
|
|
|
|
|
unsigned core_updater_auto_backup_history_size;
|
2020-09-18 15:57:32 +00:00
|
|
|
unsigned video_black_frame_insertion;
|
2024-01-20 07:11:31 +00:00
|
|
|
unsigned video_bfi_dark_frames;
|
2024-02-09 11:12:55 +00:00
|
|
|
unsigned video_shader_subframes;
|
2022-05-16 15:50:11 +00:00
|
|
|
unsigned video_autoswitch_refresh_rate;
|
2020-10-20 13:19:54 +00:00
|
|
|
unsigned quit_on_close_content;
|
2021-05-12 00:16:25 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
unsigned cpu_scaling_mode;
|
|
|
|
unsigned cpu_min_freq;
|
|
|
|
unsigned cpu_max_freq;
|
|
|
|
#endif
|
2022-04-02 07:07:40 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_MIST
|
|
|
|
unsigned steam_rich_presence_format;
|
|
|
|
#endif
|
2022-12-30 15:55:38 +00:00
|
|
|
|
|
|
|
unsigned cheevos_appearance_anchor;
|
2023-01-04 16:21:02 +00:00
|
|
|
unsigned cheevos_visibility_summary;
|
2020-08-14 15:28:05 +00:00
|
|
|
} uints;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
float placeholder;
|
|
|
|
float video_aspect_ratio;
|
|
|
|
float video_refresh_rate;
|
2023-08-22 21:56:15 +00:00
|
|
|
float video_autoswitch_pal_threshold;
|
2020-08-14 15:28:05 +00:00
|
|
|
float crt_video_refresh_rate;
|
|
|
|
float video_font_size;
|
|
|
|
float video_msg_pos_x;
|
|
|
|
float video_msg_pos_y;
|
|
|
|
float video_msg_color_r;
|
|
|
|
float video_msg_color_g;
|
|
|
|
float video_msg_color_b;
|
|
|
|
float video_msg_bgcolor_opacity;
|
2021-09-03 04:15:25 +00:00
|
|
|
float video_hdr_max_nits;
|
|
|
|
float video_hdr_paper_white_nits;
|
2021-09-13 14:54:50 +00:00
|
|
|
float video_hdr_display_contrast;
|
2020-08-14 15:28:05 +00:00
|
|
|
|
|
|
|
float menu_scale_factor;
|
|
|
|
float menu_widget_scale_factor;
|
|
|
|
float menu_widget_scale_factor_windowed;
|
|
|
|
float menu_wallpaper_opacity;
|
|
|
|
float menu_framebuffer_opacity;
|
|
|
|
float menu_footer_opacity;
|
|
|
|
float menu_header_opacity;
|
|
|
|
float menu_ticker_speed;
|
|
|
|
float menu_rgui_particle_effect_speed;
|
2021-04-13 12:58:42 +00:00
|
|
|
float menu_screensaver_animation_speed;
|
2022-03-11 14:51:41 +00:00
|
|
|
float ozone_thumbnail_scale_factor;
|
2020-08-14 15:28:05 +00:00
|
|
|
|
2022-12-30 15:55:38 +00:00
|
|
|
float cheevos_appearance_padding_h;
|
|
|
|
float cheevos_appearance_padding_v;
|
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
float audio_max_timing_skew;
|
|
|
|
float audio_volume; /* dB scale. */
|
|
|
|
float audio_mixer_volume; /* dB scale. */
|
|
|
|
|
|
|
|
float input_overlay_opacity;
|
2023-07-08 17:45:13 +00:00
|
|
|
float input_osk_overlay_opacity;
|
2020-09-08 12:36:45 +00:00
|
|
|
|
|
|
|
float input_overlay_scale_landscape;
|
|
|
|
float input_overlay_aspect_adjust_landscape;
|
|
|
|
float input_overlay_x_separation_landscape;
|
|
|
|
float input_overlay_y_separation_landscape;
|
|
|
|
float input_overlay_x_offset_landscape;
|
|
|
|
float input_overlay_y_offset_landscape;
|
|
|
|
|
|
|
|
float input_overlay_scale_portrait;
|
|
|
|
float input_overlay_aspect_adjust_portrait;
|
|
|
|
float input_overlay_x_separation_portrait;
|
2020-09-17 16:23:07 +00:00
|
|
|
float input_overlay_y_separation_portrait;
|
2020-09-08 12:36:45 +00:00
|
|
|
float input_overlay_x_offset_portrait;
|
|
|
|
float input_overlay_y_offset_portrait;
|
2020-08-14 15:28:05 +00:00
|
|
|
|
|
|
|
float slowmotion_ratio;
|
|
|
|
float fastforward_ratio;
|
|
|
|
float input_analog_deadzone;
|
2021-07-30 15:38:39 +00:00
|
|
|
float input_axis_threshold;
|
2020-08-14 15:28:05 +00:00
|
|
|
float input_analog_sensitivity;
|
2022-08-17 06:23:07 +00:00
|
|
|
#ifdef _3DS
|
|
|
|
float bottom_font_scale;
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
} floats;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char placeholder;
|
|
|
|
|
|
|
|
char video_driver[32];
|
|
|
|
char record_driver[32];
|
|
|
|
char camera_driver[32];
|
|
|
|
char bluetooth_driver[32];
|
|
|
|
char wifi_driver[32];
|
|
|
|
char led_driver[32];
|
|
|
|
char location_driver[32];
|
2023-08-04 07:20:50 +00:00
|
|
|
char cloud_sync_driver[32];
|
2020-08-14 15:28:05 +00:00
|
|
|
char menu_driver[32];
|
|
|
|
char cheevos_username[32];
|
2020-09-18 01:40:52 +00:00
|
|
|
char cheevos_password[256];
|
2020-08-14 15:28:05 +00:00
|
|
|
char cheevos_token[32];
|
2020-09-25 20:01:07 +00:00
|
|
|
char cheevos_leaderboards_enable[32];
|
2021-11-25 06:15:19 +00:00
|
|
|
char cheevos_custom_host[64];
|
2020-08-14 15:28:05 +00:00
|
|
|
char video_context_driver[32];
|
|
|
|
char audio_driver[32];
|
|
|
|
char audio_resampler[32];
|
|
|
|
char input_driver[32];
|
|
|
|
char input_joypad_driver[32];
|
|
|
|
char midi_driver[32];
|
|
|
|
char midi_input[32];
|
|
|
|
char midi_output[32];
|
|
|
|
|
|
|
|
char input_keyboard_layout[64];
|
|
|
|
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 19:55:06 +00:00
|
|
|
#ifdef HAVE_MICROPHONE
|
|
|
|
char microphone_driver[32];
|
|
|
|
char microphone_resampler[32];
|
|
|
|
char microphone_device[255];
|
|
|
|
#endif
|
|
|
|
|
2023-01-03 22:27:43 +00:00
|
|
|
#ifdef ANDROID
|
|
|
|
char input_android_physical_keyboard[255];
|
|
|
|
#endif
|
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
char audio_device[255];
|
|
|
|
char camera_device[255];
|
|
|
|
char netplay_mitm_server[255];
|
|
|
|
|
|
|
|
char translation_service_url[2048];
|
|
|
|
|
2023-08-04 07:20:50 +00:00
|
|
|
char webdav_url[255];
|
|
|
|
char webdav_username[255];
|
|
|
|
char webdav_password[255];
|
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
char youtube_stream_key[PATH_MAX_LENGTH];
|
|
|
|
char twitch_stream_key[PATH_MAX_LENGTH];
|
2020-12-19 12:14:14 +00:00
|
|
|
char facebook_stream_key[PATH_MAX_LENGTH];
|
2020-08-14 15:28:05 +00:00
|
|
|
char discord_app_id[PATH_MAX_LENGTH];
|
|
|
|
char ai_service_url[PATH_MAX_LENGTH];
|
2020-11-18 10:34:44 +00:00
|
|
|
|
|
|
|
char crt_switch_timings[255];
|
2021-04-17 21:54:45 +00:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
char timezone[TIMEZONE_LENGTH];
|
2021-05-12 00:16:25 +00:00
|
|
|
char cpu_main_gov[32];
|
|
|
|
char cpu_menu_gov[32];
|
2021-04-17 21:54:45 +00:00
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
} arrays;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char placeholder;
|
|
|
|
|
|
|
|
char username[32];
|
|
|
|
|
|
|
|
char netplay_password[128];
|
|
|
|
char netplay_spectate_password[128];
|
|
|
|
|
|
|
|
char netplay_server[255];
|
2021-12-23 12:54:52 +00:00
|
|
|
char netplay_custom_mitm_server[255];
|
2020-08-14 15:28:05 +00:00
|
|
|
char network_buildbot_url[255];
|
|
|
|
char network_buildbot_assets_url[255];
|
|
|
|
|
|
|
|
char browse_url[4096];
|
|
|
|
|
|
|
|
char path_stream_url[8192];
|
|
|
|
|
2022-07-05 17:15:29 +00:00
|
|
|
char bundle_assets_src[PATH_MAX_LENGTH];
|
|
|
|
char bundle_assets_dst[PATH_MAX_LENGTH];
|
|
|
|
char bundle_assets_dst_subdir[PATH_MAX_LENGTH];
|
2020-08-14 15:28:05 +00:00
|
|
|
char path_menu_xmb_font[PATH_MAX_LENGTH];
|
|
|
|
char menu_content_show_settings_password[PATH_MAX_LENGTH];
|
|
|
|
char kiosk_mode_password[PATH_MAX_LENGTH];
|
|
|
|
char path_cheat_database[PATH_MAX_LENGTH];
|
|
|
|
char path_content_database[PATH_MAX_LENGTH];
|
|
|
|
char path_overlay[PATH_MAX_LENGTH];
|
2023-07-08 17:45:13 +00:00
|
|
|
char path_osk_overlay[PATH_MAX_LENGTH];
|
2020-08-14 15:28:05 +00:00
|
|
|
char path_record_config[PATH_MAX_LENGTH];
|
|
|
|
char path_stream_config[PATH_MAX_LENGTH];
|
|
|
|
char path_menu_wallpaper[PATH_MAX_LENGTH];
|
|
|
|
char path_audio_dsp_plugin[PATH_MAX_LENGTH];
|
|
|
|
char path_softfilter_plugin[PATH_MAX_LENGTH];
|
|
|
|
char path_core_options[PATH_MAX_LENGTH];
|
|
|
|
char path_content_favorites[PATH_MAX_LENGTH];
|
2021-01-21 20:28:10 +00:00
|
|
|
char path_content_history[PATH_MAX_LENGTH];
|
2020-08-14 15:28:05 +00:00
|
|
|
char path_content_image_history[PATH_MAX_LENGTH];
|
2021-01-21 20:28:10 +00:00
|
|
|
char path_content_music_history[PATH_MAX_LENGTH];
|
2020-08-14 15:28:05 +00:00
|
|
|
char path_content_video_history[PATH_MAX_LENGTH];
|
|
|
|
char path_libretro_info[PATH_MAX_LENGTH];
|
|
|
|
char path_cheat_settings[PATH_MAX_LENGTH];
|
|
|
|
char path_font[PATH_MAX_LENGTH];
|
|
|
|
char path_rgui_theme_preset[PATH_MAX_LENGTH];
|
|
|
|
|
|
|
|
char directory_audio_filter[PATH_MAX_LENGTH];
|
|
|
|
char directory_autoconfig[PATH_MAX_LENGTH];
|
|
|
|
char directory_video_filter[PATH_MAX_LENGTH];
|
|
|
|
char directory_video_shader[PATH_MAX_LENGTH];
|
|
|
|
char directory_libretro[PATH_MAX_LENGTH];
|
|
|
|
char directory_input_remapping[PATH_MAX_LENGTH];
|
|
|
|
char directory_overlay[PATH_MAX_LENGTH];
|
2023-07-08 17:45:13 +00:00
|
|
|
char directory_osk_overlay[PATH_MAX_LENGTH];
|
2020-08-14 15:28:05 +00:00
|
|
|
char directory_resampler[PATH_MAX_LENGTH];
|
|
|
|
char directory_screenshot[PATH_MAX_LENGTH];
|
|
|
|
char directory_system[PATH_MAX_LENGTH];
|
|
|
|
char directory_cache[PATH_MAX_LENGTH];
|
|
|
|
char directory_playlist[PATH_MAX_LENGTH];
|
2021-01-21 20:28:10 +00:00
|
|
|
char directory_content_favorites[PATH_MAX_LENGTH];
|
|
|
|
char directory_content_history[PATH_MAX_LENGTH];
|
|
|
|
char directory_content_image_history[PATH_MAX_LENGTH];
|
|
|
|
char directory_content_music_history[PATH_MAX_LENGTH];
|
|
|
|
char directory_content_video_history[PATH_MAX_LENGTH];
|
2020-08-14 15:28:05 +00:00
|
|
|
char directory_runtime_log[PATH_MAX_LENGTH];
|
|
|
|
char directory_core_assets[PATH_MAX_LENGTH];
|
|
|
|
char directory_assets[PATH_MAX_LENGTH];
|
|
|
|
char directory_dynamic_wallpapers[PATH_MAX_LENGTH];
|
|
|
|
char directory_thumbnails[PATH_MAX_LENGTH];
|
|
|
|
char directory_menu_config[PATH_MAX_LENGTH];
|
|
|
|
char directory_menu_content[PATH_MAX_LENGTH];
|
|
|
|
char streaming_title[PATH_MAX_LENGTH];
|
2022-08-17 06:23:07 +00:00
|
|
|
#ifdef _3DS
|
|
|
|
char directory_bottom_assets[PATH_MAX_LENGTH];
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
char log_dir[PATH_MAX_LENGTH];
|
2023-12-25 00:36:49 +00:00
|
|
|
char app_icon[PATH_MAX_LENGTH];
|
2020-08-14 15:28:05 +00:00
|
|
|
} paths;
|
2017-04-28 19:03:04 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool modified;
|
2024-02-09 19:54:46 +00:00
|
|
|
bool skip_window_positions;
|
2019-03-07 12:28:21 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
bool placeholder;
|
2017-08-08 14:56:27 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Video */
|
|
|
|
bool video_fullscreen;
|
|
|
|
bool video_windowed_fullscreen;
|
|
|
|
bool video_vsync;
|
|
|
|
bool video_adaptive_vsync;
|
|
|
|
bool video_hard_sync;
|
2022-06-19 19:25:37 +00:00
|
|
|
bool video_waitable_swapchains;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool video_vfilter;
|
|
|
|
bool video_smooth;
|
|
|
|
bool video_ctx_scaling;
|
|
|
|
bool video_force_aspect;
|
2021-11-05 22:42:23 +00:00
|
|
|
bool video_frame_delay_auto;
|
2023-10-26 11:20:48 +00:00
|
|
|
bool video_frame_rest;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool video_crop_overscan;
|
|
|
|
bool video_aspect_ratio_auto;
|
2020-10-01 14:54:11 +00:00
|
|
|
bool video_dingux_ipu_keep_aspect;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool video_scale_integer;
|
2021-06-23 21:56:52 +00:00
|
|
|
bool video_scale_integer_overscale;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool video_shader_enable;
|
|
|
|
bool video_shader_watch_files;
|
2020-08-21 16:00:44 +00:00
|
|
|
bool video_shader_remember_last_dir;
|
2020-11-01 14:18:40 +00:00
|
|
|
bool video_shader_preset_save_reference_enable;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool video_threaded;
|
|
|
|
bool video_font_enable;
|
|
|
|
bool video_disable_composition;
|
|
|
|
bool video_post_filter_record;
|
|
|
|
bool video_gpu_record;
|
|
|
|
bool video_gpu_screenshot;
|
|
|
|
bool video_allow_rotate;
|
|
|
|
bool video_shared_context;
|
|
|
|
bool video_force_srgb_disable;
|
|
|
|
bool video_fps_show;
|
|
|
|
bool video_statistics_show;
|
|
|
|
bool video_framecount_show;
|
|
|
|
bool video_memory_show;
|
|
|
|
bool video_msg_bgcolor_enable;
|
2022-08-17 06:23:07 +00:00
|
|
|
#ifdef _3DS
|
2020-08-14 15:28:05 +00:00
|
|
|
bool video_3ds_lcd_bottom;
|
2022-08-17 06:23:07 +00:00
|
|
|
#endif
|
2022-03-08 13:56:51 +00:00
|
|
|
bool video_wiiu_prefer_drc;
|
2020-08-27 23:41:30 +00:00
|
|
|
bool video_notch_write_over_enable;
|
2021-09-03 04:15:25 +00:00
|
|
|
bool video_hdr_enable;
|
|
|
|
bool video_hdr_expand_gamut;
|
2017-09-27 22:09:59 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Accessibility */
|
|
|
|
bool accessibility_enable;
|
2017-09-27 22:09:59 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Audio */
|
|
|
|
bool audio_enable;
|
|
|
|
bool audio_enable_menu;
|
|
|
|
bool audio_enable_menu_ok;
|
|
|
|
bool audio_enable_menu_cancel;
|
|
|
|
bool audio_enable_menu_notice;
|
|
|
|
bool audio_enable_menu_bgm;
|
2022-12-26 18:34:35 +00:00
|
|
|
bool audio_enable_menu_scroll;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool audio_sync;
|
|
|
|
bool audio_rate_control;
|
|
|
|
bool audio_fastforward_mute;
|
2023-04-20 15:14:47 +00:00
|
|
|
bool audio_fastforward_speedup;
|
2023-11-26 12:59:14 +00:00
|
|
|
#ifdef TARGET_OS_IOS
|
|
|
|
bool audio_respect_silent_mode;
|
|
|
|
#endif
|
2017-09-27 22:09:59 +00:00
|
|
|
|
2023-11-19 16:44:25 +00:00
|
|
|
#ifdef HAVE_WASAPI
|
|
|
|
bool audio_wasapi_exclusive_mode;
|
|
|
|
bool audio_wasapi_float_format;
|
|
|
|
#endif
|
|
|
|
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 19:55:06 +00:00
|
|
|
#ifdef HAVE_MICROPHONE
|
|
|
|
/* Microphone */
|
|
|
|
bool microphone_enable;
|
|
|
|
#ifdef HAVE_WASAPI
|
|
|
|
bool microphone_wasapi_exclusive_mode;
|
|
|
|
bool microphone_wasapi_float_format;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Input */
|
|
|
|
bool input_remap_binds_enable;
|
|
|
|
bool input_autodetect_enable;
|
2020-09-14 16:44:58 +00:00
|
|
|
bool input_sensors_enable;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool input_overlay_enable;
|
|
|
|
bool input_overlay_enable_autopreferred;
|
2021-12-26 03:56:44 +00:00
|
|
|
bool input_overlay_behind_menu;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool input_overlay_hide_in_menu;
|
2020-08-25 10:10:37 +00:00
|
|
|
bool input_overlay_hide_when_gamepad_connected;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool input_overlay_show_mouse_cursor;
|
|
|
|
bool input_overlay_auto_rotate;
|
2020-09-17 16:23:07 +00:00
|
|
|
bool input_overlay_auto_scale;
|
2023-07-08 17:45:13 +00:00
|
|
|
bool input_osk_overlay_auto_scale;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool input_descriptor_label_show;
|
|
|
|
bool input_descriptor_hide_unbound;
|
2021-11-03 15:32:15 +00:00
|
|
|
bool input_all_users_control_menu;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool input_menu_swap_ok_cancel_buttons;
|
2022-11-01 18:48:28 +00:00
|
|
|
bool input_menu_swap_scroll_buttons;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool input_backtouch_enable;
|
|
|
|
bool input_backtouch_toggle;
|
|
|
|
bool input_small_keyboard_enable;
|
|
|
|
bool input_keyboard_gamepad_enable;
|
2021-07-28 21:28:26 +00:00
|
|
|
bool input_auto_mouse_grab;
|
2023-12-14 02:36:09 +00:00
|
|
|
bool input_allow_turbo_dpad;
|
2024-01-22 02:13:17 +00:00
|
|
|
bool input_hotkey_device_merge;
|
2020-12-08 22:03:40 +00:00
|
|
|
#if defined(HAVE_DINPUT) || defined(HAVE_WINRAWINPUT)
|
|
|
|
bool input_nowinkey_enable;
|
|
|
|
#endif
|
2023-05-28 18:36:38 +00:00
|
|
|
#ifdef UDEV_TOUCH_SUPPORT
|
|
|
|
bool input_touch_vmouse_pointer;
|
|
|
|
bool input_touch_vmouse_mouse;
|
|
|
|
bool input_touch_vmouse_touchpad;
|
|
|
|
bool input_touch_vmouse_trackball;
|
|
|
|
bool input_touch_vmouse_gesture;
|
|
|
|
#endif
|
2017-12-27 16:05:12 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Frame time counter */
|
|
|
|
bool frame_time_counter_reset_after_fastforwarding;
|
|
|
|
bool frame_time_counter_reset_after_load_state;
|
|
|
|
bool frame_time_counter_reset_after_save_state;
|
2018-03-28 19:22:07 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Menu */
|
|
|
|
bool filter_by_current_core;
|
|
|
|
bool menu_enable_widgets;
|
|
|
|
bool menu_show_load_content_animation;
|
|
|
|
bool notification_show_autoconfig;
|
|
|
|
bool notification_show_cheats_applied;
|
2021-04-17 07:13:35 +00:00
|
|
|
bool notification_show_patch_applied;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool notification_show_remap_load;
|
|
|
|
bool notification_show_config_override_load;
|
|
|
|
bool notification_show_set_initial_disk;
|
2023-08-18 19:38:36 +00:00
|
|
|
bool notification_show_save_state;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool notification_show_fast_forward;
|
2021-01-09 16:14:38 +00:00
|
|
|
#ifdef HAVE_SCREENSHOTS
|
2020-08-14 15:28:05 +00:00
|
|
|
bool notification_show_screenshot;
|
2021-01-09 16:14:38 +00:00
|
|
|
#endif
|
2021-01-08 16:32:33 +00:00
|
|
|
bool notification_show_refresh_rate;
|
2021-11-05 17:52:56 +00:00
|
|
|
bool notification_show_netplay_extra;
|
2021-12-16 13:38:43 +00:00
|
|
|
#ifdef HAVE_MENU
|
|
|
|
bool notification_show_when_menu_is_alive;
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_widget_scale_auto;
|
|
|
|
bool menu_show_start_screen;
|
|
|
|
bool menu_pause_libretro;
|
|
|
|
bool menu_savestate_resume;
|
|
|
|
bool menu_insert_disk_resume;
|
|
|
|
bool menu_timedate_enable;
|
|
|
|
bool menu_battery_level_enable;
|
|
|
|
bool menu_core_enable;
|
|
|
|
bool menu_show_sublabels;
|
|
|
|
bool menu_dynamic_wallpaper_enable;
|
|
|
|
bool menu_mouse_enable;
|
|
|
|
bool menu_pointer_enable;
|
|
|
|
bool menu_navigation_wraparound_enable;
|
|
|
|
bool menu_navigation_browser_filter_supported_extensions_enable;
|
|
|
|
bool menu_show_advanced_settings;
|
|
|
|
bool menu_linear_filter;
|
|
|
|
bool menu_horizontal_animation;
|
|
|
|
bool menu_scroll_fast;
|
|
|
|
bool menu_show_online_updater;
|
2022-03-09 14:05:07 +00:00
|
|
|
#ifdef HAVE_MIST
|
|
|
|
bool menu_show_core_manager_steam;
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_show_core_updater;
|
|
|
|
bool menu_show_load_core;
|
|
|
|
bool menu_show_load_content;
|
|
|
|
bool menu_show_load_disc;
|
|
|
|
bool menu_show_dump_disc;
|
2021-11-17 20:33:23 +00:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
bool menu_show_eject_disc;
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_show_information;
|
|
|
|
bool menu_show_configurations;
|
|
|
|
bool menu_show_help;
|
|
|
|
bool menu_show_quit_retroarch;
|
|
|
|
bool menu_show_restart_retroarch;
|
|
|
|
bool menu_show_reboot;
|
|
|
|
bool menu_show_shutdown;
|
|
|
|
bool menu_show_latency;
|
|
|
|
bool menu_show_rewind;
|
|
|
|
bool menu_show_overlays;
|
2024-01-09 08:17:47 +00:00
|
|
|
#if 0
|
|
|
|
/* Thumbnailpack removal */
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_show_legacy_thumbnail_updater;
|
2024-01-09 08:17:47 +00:00
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_materialui_icons_enable;
|
|
|
|
bool menu_materialui_playlist_icons_enable;
|
2022-12-25 17:17:16 +00:00
|
|
|
bool menu_materialui_switch_icons;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_materialui_show_nav_bar;
|
|
|
|
bool menu_materialui_auto_rotate_nav_bar;
|
|
|
|
bool menu_materialui_dual_thumbnail_list_view_enable;
|
|
|
|
bool menu_materialui_thumbnail_background_enable;
|
|
|
|
bool menu_rgui_background_filler_thickness_enable;
|
|
|
|
bool menu_rgui_border_filler_thickness_enable;
|
|
|
|
bool menu_rgui_border_filler_enable;
|
|
|
|
bool menu_rgui_full_width_layout;
|
2021-04-15 11:31:33 +00:00
|
|
|
bool menu_rgui_transparency;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_rgui_shadows;
|
|
|
|
bool menu_rgui_inline_thumbnails;
|
|
|
|
bool menu_rgui_swap_thumbnails;
|
|
|
|
bool menu_rgui_extended_ascii;
|
|
|
|
bool menu_rgui_switch_icons;
|
2021-04-01 16:25:45 +00:00
|
|
|
bool menu_rgui_particle_effect_screensaver;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_xmb_shadows_enable;
|
2022-09-26 10:57:20 +00:00
|
|
|
bool menu_xmb_show_title_header;
|
2022-12-25 17:17:16 +00:00
|
|
|
bool menu_xmb_switch_icons;
|
|
|
|
bool menu_xmb_vertical_thumbnails;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_content_show_settings;
|
|
|
|
bool menu_content_show_favorites;
|
|
|
|
bool menu_content_show_images;
|
|
|
|
bool menu_content_show_music;
|
|
|
|
bool menu_content_show_video;
|
|
|
|
bool menu_content_show_netplay;
|
|
|
|
bool menu_content_show_history;
|
|
|
|
bool menu_content_show_add;
|
|
|
|
bool menu_content_show_playlists;
|
|
|
|
bool menu_content_show_explore;
|
|
|
|
bool menu_use_preferred_system_color_theme;
|
|
|
|
bool menu_preferred_system_color_theme_set;
|
|
|
|
bool menu_unified_controls;
|
2022-09-12 21:17:24 +00:00
|
|
|
bool menu_disable_info_button;
|
|
|
|
bool menu_disable_search_button;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool menu_ticker_smooth;
|
|
|
|
bool settings_show_drivers;
|
|
|
|
bool settings_show_video;
|
|
|
|
bool settings_show_audio;
|
|
|
|
bool settings_show_input;
|
|
|
|
bool settings_show_latency;
|
|
|
|
bool settings_show_core;
|
|
|
|
bool settings_show_configuration;
|
|
|
|
bool settings_show_saving;
|
|
|
|
bool settings_show_logging;
|
2020-10-15 22:54:11 +00:00
|
|
|
bool settings_show_file_browser;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool settings_show_frame_throttle;
|
|
|
|
bool settings_show_recording;
|
|
|
|
bool settings_show_onscreen_display;
|
|
|
|
bool settings_show_user_interface;
|
|
|
|
bool settings_show_ai_service;
|
2020-10-15 22:54:11 +00:00
|
|
|
bool settings_show_accessibility;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool settings_show_power_management;
|
|
|
|
bool settings_show_achievements;
|
|
|
|
bool settings_show_network;
|
|
|
|
bool settings_show_playlists;
|
|
|
|
bool settings_show_user;
|
|
|
|
bool settings_show_directory;
|
2022-04-02 07:07:40 +00:00
|
|
|
#ifdef HAVE_MIST
|
|
|
|
bool settings_show_steam;
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
bool quick_menu_show_resume_content;
|
|
|
|
bool quick_menu_show_restart_content;
|
|
|
|
bool quick_menu_show_close_content;
|
|
|
|
bool quick_menu_show_take_screenshot;
|
2022-04-05 22:58:48 +00:00
|
|
|
bool quick_menu_show_savestate_submenu;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool quick_menu_show_save_load_state;
|
Replay UI support (#15048)
* Add bsv replay controls (not yet fully implemented), remove toggle
see notes in task_movie.c, make sure command.c calls the right
functions, check retroarch.c and other todos.
bsv files are also now stored with states, not saves.
* Compilation fixes
* Added command impls for play and record replay, and some code in load state to do the right thing there
* Guard some parts of the new code with HAVE_BSV_MOVIE
* wip, menu fixes
* more menu fixes, osd for movie errors, halt recording properly
* Menu and label fixes
* move bsvs to own file suffix series under savestates, fix recording and playback command validity checks
* Fix replay autoincrement
* fix endif placement, whoops
---------
Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-02 23:52:22 +00:00
|
|
|
bool quick_menu_show_replay;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool quick_menu_show_undo_save_load_state;
|
|
|
|
bool quick_menu_show_add_to_favorites;
|
|
|
|
bool quick_menu_show_start_recording;
|
|
|
|
bool quick_menu_show_start_streaming;
|
|
|
|
bool quick_menu_show_set_core_association;
|
|
|
|
bool quick_menu_show_reset_core_association;
|
|
|
|
bool quick_menu_show_options;
|
2021-08-26 10:41:28 +00:00
|
|
|
bool quick_menu_show_core_options_flush;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool quick_menu_show_controls;
|
|
|
|
bool quick_menu_show_cheats;
|
|
|
|
bool quick_menu_show_shaders;
|
|
|
|
bool quick_menu_show_save_core_overrides;
|
|
|
|
bool quick_menu_show_save_game_overrides;
|
|
|
|
bool quick_menu_show_save_content_dir_overrides;
|
|
|
|
bool quick_menu_show_information;
|
|
|
|
bool quick_menu_show_recording;
|
|
|
|
bool quick_menu_show_streaming;
|
|
|
|
bool quick_menu_show_download_thumbnails;
|
|
|
|
bool kiosk_mode_enable;
|
2018-06-04 05:48:08 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool crt_switch_custom_refresh_enable;
|
2021-05-11 09:08:15 +00:00
|
|
|
bool crt_switch_hires_menu;
|
2018-11-25 08:02:32 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Netplay */
|
2021-12-30 07:33:54 +00:00
|
|
|
bool netplay_show_only_connectable;
|
2022-07-01 22:24:33 +00:00
|
|
|
bool netplay_show_only_installed_cores;
|
2022-05-08 02:24:58 +00:00
|
|
|
bool netplay_show_passworded;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool netplay_public_announce;
|
|
|
|
bool netplay_start_as_spectator;
|
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 15:58:01 +00:00
|
|
|
bool netplay_fade_chat;
|
2021-12-04 01:34:21 +00:00
|
|
|
bool netplay_allow_pausing;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool netplay_allow_slaves;
|
|
|
|
bool netplay_require_slaves;
|
|
|
|
bool netplay_nat_traversal;
|
|
|
|
bool netplay_use_mitm_server;
|
|
|
|
bool netplay_request_devices[MAX_USERS];
|
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 15:58:01 +00:00
|
|
|
bool netplay_ping_show;
|
2018-11-25 20:41:26 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Network */
|
|
|
|
bool network_buildbot_auto_extract_archive;
|
|
|
|
bool network_buildbot_show_experimental_cores;
|
|
|
|
bool network_on_demand_thumbnails;
|
|
|
|
bool core_updater_auto_backup;
|
2018-11-29 17:42:44 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* UI */
|
|
|
|
bool ui_menubar_enable;
|
|
|
|
bool ui_suspend_screensaver_enable;
|
|
|
|
bool ui_companion_start_on_boot;
|
|
|
|
bool ui_companion_enable;
|
|
|
|
bool ui_companion_toggle;
|
|
|
|
bool desktop_menu_enable;
|
2020-06-16 10:11:09 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Cheevos */
|
|
|
|
bool cheevos_enable;
|
|
|
|
bool cheevos_test_unofficial;
|
|
|
|
bool cheevos_hardcore_mode_enable;
|
|
|
|
bool cheevos_richpresence_enable;
|
|
|
|
bool cheevos_badges_enable;
|
|
|
|
bool cheevos_verbose_enable;
|
|
|
|
bool cheevos_auto_screenshot;
|
|
|
|
bool cheevos_start_active;
|
|
|
|
bool cheevos_unlock_sound_enable;
|
2021-06-04 02:51:19 +00:00
|
|
|
bool cheevos_challenge_indicators;
|
2022-12-30 15:55:38 +00:00
|
|
|
bool cheevos_appearance_padding_auto;
|
2023-01-04 16:21:02 +00:00
|
|
|
bool cheevos_visibility_unlock;
|
2023-01-05 14:24:50 +00:00
|
|
|
bool cheevos_visibility_mastery;
|
|
|
|
bool cheevos_visibility_account;
|
2023-04-16 17:44:46 +00:00
|
|
|
bool cheevos_visibility_lboard_start;
|
|
|
|
bool cheevos_visibility_lboard_submit;
|
|
|
|
bool cheevos_visibility_lboard_cancel;
|
|
|
|
bool cheevos_visibility_lboard_trackers;
|
2023-05-14 19:42:01 +00:00
|
|
|
bool cheevos_visibility_progress_tracker;
|
2017-04-28 19:03:04 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Camera */
|
|
|
|
bool camera_allow;
|
2018-07-13 20:12:09 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Bluetooth */
|
|
|
|
bool bluetooth_allow;
|
2017-04-28 21:02:22 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* WiFi */
|
|
|
|
bool wifi_allow;
|
2020-12-09 19:10:22 +00:00
|
|
|
bool wifi_enabled;
|
2017-09-27 22:09:59 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Location */
|
|
|
|
bool location_allow;
|
2017-09-27 22:09:59 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Multimedia */
|
|
|
|
bool multimedia_builtin_mediaplayer_enable;
|
|
|
|
bool multimedia_builtin_imageviewer_enable;
|
2020-03-05 10:27:25 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Bundle */
|
|
|
|
bool bundle_finished;
|
|
|
|
bool bundle_assets_extract_enable;
|
2017-09-27 22:09:59 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Driver */
|
|
|
|
bool driver_switch_enable;
|
2017-04-28 20:59:13 +00:00
|
|
|
|
2022-04-02 07:07:40 +00:00
|
|
|
#ifdef HAVE_MIST
|
|
|
|
/* Steam */
|
|
|
|
bool steam_rich_presence_enable;
|
|
|
|
#endif
|
|
|
|
|
2023-08-04 07:20:50 +00:00
|
|
|
/* Cloud Sync */
|
|
|
|
bool cloud_sync_enable;
|
|
|
|
bool cloud_sync_destructive;
|
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
/* Misc. */
|
|
|
|
bool discord_enable;
|
|
|
|
bool threaded_data_runloop_enable;
|
|
|
|
bool set_supports_no_game_enable;
|
|
|
|
bool auto_screenshot_filename;
|
|
|
|
bool history_list_enable;
|
|
|
|
bool playlist_entry_rename;
|
|
|
|
bool rewind_enable;
|
2022-01-26 17:30:33 +00:00
|
|
|
bool fastforward_frameskip;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool vrr_runloop_enable;
|
2023-11-11 02:40:02 +00:00
|
|
|
bool menu_throttle_framerate;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool apply_cheats_after_toggle;
|
|
|
|
bool apply_cheats_after_load;
|
|
|
|
bool run_ahead_enabled;
|
|
|
|
bool run_ahead_secondary_instance;
|
|
|
|
bool run_ahead_hide_warnings;
|
2023-01-10 06:22:14 +00:00
|
|
|
bool preemptive_frames_enable;
|
|
|
|
bool preemptive_frames_hide_warnings;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool pause_nonactive;
|
2022-11-08 11:46:09 +00:00
|
|
|
bool pause_on_disconnect;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool block_sram_overwrite;
|
Replay UI support (#15048)
* Add bsv replay controls (not yet fully implemented), remove toggle
see notes in task_movie.c, make sure command.c calls the right
functions, check retroarch.c and other todos.
bsv files are also now stored with states, not saves.
* Compilation fixes
* Added command impls for play and record replay, and some code in load state to do the right thing there
* Guard some parts of the new code with HAVE_BSV_MOVIE
* wip, menu fixes
* more menu fixes, osd for movie errors, halt recording properly
* Menu and label fixes
* move bsvs to own file suffix series under savestates, fix recording and playback command validity checks
* Fix replay autoincrement
* fix endif placement, whoops
---------
Co-authored-by: Joseph C. Osborn <jcoa2018@pomona.edu>
2023-03-02 23:52:22 +00:00
|
|
|
bool replay_auto_index;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool savestate_auto_index;
|
|
|
|
bool savestate_auto_save;
|
|
|
|
bool savestate_auto_load;
|
|
|
|
bool savestate_thumbnail_enable;
|
|
|
|
bool save_file_compression;
|
|
|
|
bool savestate_file_compression;
|
|
|
|
bool network_cmd_enable;
|
|
|
|
bool stdin_cmd_enable;
|
|
|
|
bool keymapper_enable;
|
|
|
|
bool network_remote_enable;
|
|
|
|
bool network_remote_enable_user[MAX_USERS];
|
|
|
|
bool load_dummy_on_core_shutdown;
|
|
|
|
bool check_firmware_before_loading;
|
2021-08-13 15:16:10 +00:00
|
|
|
bool core_option_category_enable;
|
2021-05-06 10:58:45 +00:00
|
|
|
bool core_info_cache_enable;
|
2023-01-26 14:56:33 +00:00
|
|
|
bool core_info_savestate_bypass;
|
2020-08-14 15:28:05 +00:00
|
|
|
#ifndef HAVE_DYNAMIC
|
|
|
|
bool always_reload_core_on_run_content;
|
|
|
|
#endif
|
2016-12-26 05:39:12 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool game_specific_options;
|
|
|
|
bool auto_overrides_enable;
|
|
|
|
bool auto_remaps_enable;
|
2024-02-04 19:58:16 +00:00
|
|
|
bool initial_disk_change_enable;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool global_core_options;
|
|
|
|
bool auto_shaders_enable;
|
2020-03-05 10:27:25 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool sort_savefiles_enable;
|
|
|
|
bool sort_savestates_enable;
|
2020-08-13 02:24:54 +00:00
|
|
|
bool sort_savefiles_by_content_enable;
|
|
|
|
bool sort_savestates_by_content_enable;
|
|
|
|
bool sort_screenshots_by_content_enable;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool config_save_on_exit;
|
2022-04-27 17:12:53 +00:00
|
|
|
bool remap_save_on_exit;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool show_hidden_files;
|
2021-02-07 10:45:16 +00:00
|
|
|
bool use_last_start_directory;
|
2020-03-05 10:27:25 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool savefiles_in_content_dir;
|
|
|
|
bool savestates_in_content_dir;
|
|
|
|
bool screenshots_in_content_dir;
|
|
|
|
bool systemfiles_in_content_dir;
|
|
|
|
bool ssh_enable;
|
2023-10-06 11:55:22 +00:00
|
|
|
#ifdef HAVE_LAKKA_SWITCH
|
|
|
|
bool switch_oc;
|
|
|
|
bool switch_cec;
|
|
|
|
bool bluetooth_ertm_disable;
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
bool samba_enable;
|
|
|
|
bool bluetooth_enable;
|
|
|
|
bool localap_enable;
|
2020-03-05 10:27:25 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool video_window_show_decorations;
|
|
|
|
bool video_window_save_positions;
|
2021-08-16 16:48:09 +00:00
|
|
|
bool video_window_custom_size_enable;
|
2020-03-05 10:27:25 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool sustained_performance_mode;
|
|
|
|
bool playlist_use_old_format;
|
|
|
|
bool playlist_compression;
|
|
|
|
bool content_runtime_log;
|
|
|
|
bool content_runtime_log_aggregate;
|
2016-04-28 17:26:02 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool playlist_sort_alphabetical;
|
|
|
|
bool playlist_show_sublabels;
|
2021-05-13 08:52:47 +00:00
|
|
|
bool playlist_show_entry_idx;
|
2020-08-14 15:28:05 +00:00
|
|
|
bool playlist_fuzzy_archive_match;
|
|
|
|
bool playlist_portable_paths;
|
2023-09-26 12:31:59 +00:00
|
|
|
bool playlist_use_filename;
|
2017-04-28 22:39:29 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool quit_press_twice;
|
|
|
|
bool vibrate_on_keypress;
|
|
|
|
bool enable_device_vibration;
|
|
|
|
bool ozone_collapse_sidebar;
|
|
|
|
bool ozone_truncate_playlist_name;
|
|
|
|
bool ozone_sort_after_truncate_playlist_name;
|
|
|
|
bool ozone_scroll_content_metadata;
|
2019-03-05 22:34:05 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool log_to_file;
|
|
|
|
bool log_to_file_timestamp;
|
2017-04-28 22:39:29 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool scan_without_core_match;
|
2024-01-02 05:57:44 +00:00
|
|
|
bool scan_serial_and_crc;
|
2016-10-03 02:13:34 +00:00
|
|
|
|
2020-08-14 15:28:05 +00:00
|
|
|
bool ai_service_enable;
|
|
|
|
bool ai_service_pause;
|
2021-12-14 13:07:42 +00:00
|
|
|
|
|
|
|
bool gamemode_enable;
|
2022-03-09 07:20:15 +00:00
|
|
|
#ifdef _3DS
|
|
|
|
bool new3ds_speedup_enable;
|
2022-08-17 06:23:07 +00:00
|
|
|
bool bottom_font_enable;
|
2022-03-09 07:20:15 +00:00
|
|
|
#endif
|
2022-02-21 13:13:02 +00:00
|
|
|
|
|
|
|
#ifdef ANDROID
|
|
|
|
bool android_input_disconnect_workaround;
|
|
|
|
#endif
|
2023-02-15 10:59:06 +00:00
|
|
|
|
|
|
|
#if defined(HAVE_COCOATOUCH) && defined(TARGET_OS_TV)
|
|
|
|
bool gcdwebserver_alert;
|
|
|
|
#endif
|
2020-08-14 15:28:05 +00:00
|
|
|
} bools;
|
2017-06-18 16:49:49 +00:00
|
|
|
|
2015-03-20 18:32:46 +00:00
|
|
|
} settings_t;
|
2015-03-20 18:15:08 +00:00
|
|
|
|
2015-01-11 04:29:32 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_camera:
|
|
|
|
*
|
|
|
|
* Gets default camera driver.
|
|
|
|
*
|
|
|
|
* Returns: Default camera driver.
|
|
|
|
**/
|
2015-01-09 15:56:21 +00:00
|
|
|
const char *config_get_default_camera(void);
|
|
|
|
|
2020-06-17 11:56:44 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_bluetooth:
|
|
|
|
*
|
|
|
|
* Gets default bluetooth driver.
|
|
|
|
*
|
|
|
|
* Returns: Default bluetooth driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_bluetooth(void);
|
|
|
|
|
2016-09-21 16:51:40 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_wifi:
|
|
|
|
*
|
|
|
|
* Gets default wifi driver.
|
|
|
|
*
|
|
|
|
* Returns: Default wifi driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_wifi(void);
|
|
|
|
|
2015-01-11 04:29:32 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_location:
|
|
|
|
*
|
|
|
|
* Gets default location driver.
|
|
|
|
*
|
|
|
|
* Returns: Default location driver.
|
|
|
|
**/
|
2015-01-09 15:56:21 +00:00
|
|
|
const char *config_get_default_location(void);
|
|
|
|
|
2015-01-11 04:29:32 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_video:
|
|
|
|
*
|
|
|
|
* Gets default video driver.
|
|
|
|
*
|
|
|
|
* Returns: Default video driver.
|
|
|
|
**/
|
2015-01-09 15:56:21 +00:00
|
|
|
const char *config_get_default_video(void);
|
|
|
|
|
2015-01-11 04:29:32 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_audio:
|
|
|
|
*
|
|
|
|
* Gets default audio driver.
|
|
|
|
*
|
|
|
|
* Returns: Default audio driver.
|
|
|
|
**/
|
2015-01-09 15:56:21 +00:00
|
|
|
const char *config_get_default_audio(void);
|
|
|
|
|
Add microphone support via a new driver (#14731)
* Some slight fixes
* Update libretro.h
* Log calls to RETRO_ENVIRONMENT_GET_MICROPHONE_INTERFACE
* Finish proof-of-concept for mic support
- It works, but doesn't support floating-point audio yet
- It may need to be resampled, too
* Add macros that aren't available in SDL 2
* Comment out a variable definition for now
- For C89 compliance
* Add some comments for clarity
* Let ALSA tolerate a null new_rate
* Partial ALSA microphone support
- Not yet tested
- Mic is created and destroyed
- Mic can also be paused or unpaused
- Mic is paused or unpaused with the rest of the driver
- Microphone is not yet read
* Install error logging in the ALSA driver
- It defers to RARCH_ERR
* Free the ALSA microphone in alsa_free
* Fix an indent
* First draft of alsa_read_microphone
* Deinitialize SDL Audio in sdl_audio_free
* Save and restore the ALSA error logger
- You should always practice safe global state
* Add newlines to some RARCH_ERRs
* Add some logging
* Check for the mic being active via settings instead of via flags
* Adjusted a log entry to be less misleading
- A frequency of 0Hz looks weird to the uninformed
- In reality, it means the driver used the requested frequency
* Fix an incorrect format string
* Tidy up logging in alsa.c
* Rename audio_enable_microphone to audio_enable_input
* Rename microphone_device to audio_input_device
* Add audio_input_latency and audio_input_block_frames settings
* Add all mic-related settings to the options menu
* Adjust logging for alsa.c
- Log the ALSA library version
- Add errno details
* Refer to the microphone in logs by name
* Use %u instead of %d for some log items
* Add input_samples_buf
* Remove an inaccurate comment
* Change type of input_samples_buf
* Clean up audio_driver_flush_microphone_input
* Comment convert_float_to_s16
- It helped me understand what it's doing
- Turns out it'll work just fine on mono audio
* Don't use the resampler for mic input
* Fix crash in the ALSA driver when reading from a mic
* Update some logging messages
* ALSA support now works for mics
* Reuse some common functions in alsa.c
* Add alsa_thread_microphone_t
* Refactor alsa.c
- Introduce alsa_init_pcm to init any PCM that we're using
- Vastly simplifies the implementation of alsa_init and alsa_init_microphone
- Will be used for the read-based versions next
* Make ALSA logging a little more consistent
* Clean up the mic with alsa_free_microphone if alsa_init_microphone fails
* Remove an unused function
* Move some cleanup in alsa.c to a common function
* First crack at mic support for alsathread
- Refactor some duplicate code into functions
- Use functions introduced in alsa.c
- Create and destroy the mic
* Slight cleanups for clarity
* Implement alsa_thread_set/get_microphone_state
* More work on alsathread
- No more crashing, but the mic just returns silence
* Slight cleanups for clarity
* Add alsa_set_mic_enabled_internal
- For setting the state of a microphone while considering its current state
* Use alsa_set_mic_enabled_internal
* Log a little more info
* Log when the audio driver is started/stopped
* Move base microphone driver code into a new directory
- Add microphone_driver.c to Makefile.common
- Rename functions as needed
* Initialize and deinitialize the microphone driver
* Implement sdl_microphone.c
* Un-const an argument
- In case the driver context needs to do any locking
* Revise comments for microphone_driver.h
* Remove an unimplemented function
* Remove some functions from the mic driver
* Remove mic functions from audio_thread_wrapper
* Remove mic functions from sdl_audio
* Fix microphone_null
* Split the mic code for the alsa audio drivers into microphone drivers
* Fix an extra struct member
* Add a setting for the mic driver
* Add a command to reinitialize the microphone driver
* Rename mic-related settings
* Add DRIVER_MICROPHONE_MASK to DRIVERS_CMD_ALL
* Rename audio_enable_input to microphone_enable
* Remove some labels from qt_options
* Search for microphone_driver within find_driver_nonempty
* Clean up some mic driver code
* Pending mics now return silence
* Adjust some logging and comments
* Some cleanup in the microphone driver
* Invert a flag check
- Oops
* Fix a log message
* Fix the wrong flags being checked
* Slight refactor of wasapi_init_device
- Add a data_flow parameter
- Declare it in a header
- In preparation for WASAPI mic support
* Add some WASAPI macros for _IAudioCaptureClient
* Move some common WASAPI functions to audio/common/wasapi.c
- They'll be used by the mic and the audio drivers
* Add wasapi_log_hr
* Generalize mmdevice_list_new to look for capture devices, too
* Fix a function declaration
* Move driver-specific device_list_new functions into their respective files
* Clean up some declarations
* First draft of wasapi microphone driver
* Add wasapi_microphone_device_list_free
* Change function parameter names to be consistent with microphone_driver
* Partially implement wasapi_microphone_read
- Mostly copied from the audio driver so far
- It doesn't compile yet
- But it'll be beautiful when I'm done with it
* Refactor the mic driver's functions
- Rename get_mic_active to mic_alive
- Split set_mic_active into start_mic and stop_mic
- Refactor the SDL mic driver accordingly
* Edit some WASAPI functions for logging and clarity
* Implement more of the WASAPI mic driver
* Rename write_event to read_event
* Pass the WASAPI driver context to the various read functions
* Mostly implement the read function for the WASAPI mic driver
* Fix a crash in microphone_driver
- Forgot to move the position of the name of null_driver
* Reduce some logging in wasapi common functions
- Only log the chosen audio client format, not all attempted ones
* Add some macro wrappers for IAudioClient methods
* Update mic driver configuration
- Make the mic driver configurable in the menu
- Add config items for WASAPI-related options similar to the audio driver
* Fix a menu entry scrolling through audio devices instead of mic devices
* Add some utility functions
* Expose the new utility functions in wasapi.h
* Add extra logging in the WASAPI common functions
* Add sharemode_name
* Use _IAudioClient_Initialize macro in some places
* Pass channels to wasapi_init_client
- Remember, mics are in mono
* Use _IAudioClient_Initialize macro some more
* Forgot to pass channels in some places
* Add some utility functions
* Forgot an #include
* Add wasapi_select_device_format
* Simplify the format selection logic in wasapi_init_client_sh
* Unset the microphone in wasapi_microphone_close_mic
- Ought to prevent a potential segfault
* Simplify some logging
* Fix incorrect value being passed to _IAudioCaptureClient_ReleaseBuffer
* Remove some unneeded logging
* Add some values to hresult_name
* Polish up wasapi_select_device_format
- Test for formats manually when Windows can't
- Add some debug logging
- Check for channels
* Compute the fields of WAVEFORMATEXTENSIBLE correctly
- As per the doc's stated requirements
* Simplify logic for WASAPI client creation
* Fix a potential hang in wasapi_microphone_read_shared_buffered
* Stop the microphone if the driver is stopped
* Don't name the microphone event
* Ensure that wasapi_init_client reports the correct format and rate
* Implement exclusive microphone read access for WASAPI
* Add _IAudioCaptureClient_GetNextPacketSize macro
* Organize cases in hresult_name
* Clear some extra fields if wasapi_set_format is setting a Pcm format
* Adjust some logs
* Adjust some logs
* Remove unneeded local vars
* Add a log
* Update wasapi.c
* Update wasapi.c
* Fix shared-mode mic support in WASAPI producing broken input
- Turns out it had nothing to do with shared mode
* Reuse a common function
- Remove wasapi_microphone_read_shared_buffered
- Rename wasapi_microphone_read_exclusive to wasapi_microphone_read_buffered
* Remove some code I was using for test purposes
* Clarify some language
* Double the default shared-mode mic buffer length
* Split getting a device's name into a separate function, then use it
* Fix the ALSA mic drivers
- To comply with changes I previously made to the mic driver interface
* Remove unused synchronization primitives from the SDL microphone driver
* Add sdl_microphone_mic_use_float
* Document audio_driver_state_flags
- I needed to understand these to see if similar flags were required for the mic driver
* Remove an unused function in wasapi.c
* Add and document flags in microphone_driver.h
* Remove driver-specific mic start/stop functions
- The mic driver itself doesn't do much processing
- That honor goes to individual mics
* Remove some unused fields in microphone_driver.h
* Add CMD_EVENT_MICROPHONE_STOP/START
* Remove unused functions from microphone_null
* Change how the mic driver state is referenced in some places
* Simplify the SDL microphone driver
- The driver backend no longer keeps a reference to the mic (the frontend does that)
- Remove functions that are no longer needed
- Don't track paused state, just query the mic itself
* Simplify the WASAPI microphone driver
- Don't track the driver running state or the microphone handle, the frontend does that now
- Remove support for unbuffered input (hunterk suggested that it wasn't necessary)
* Make microphone_wasapi_sh_buffer_length a uint, not an int
- It won't be negative anymore
- 0 now represents the default value
* Make the microphone frontend more robust
- Improve documentation for how various functions should be implemented
- Closes all microphones before freeing the driver (so backends don't have to)
- Tracks the enabled state of each microphone, so backends don't have to (but they still can)
* Stop the mic driver in core_unload_game
* Ensure mic support is compatible with the revised menu code
* Move alsa.h into audio/common
* Remove RETRO_ENVIRONMENT_GET_MICROPHONE_ENABLED
- It was never really needed
* Refactor the ALSA microphone driver
- Move common ALSA functions to audio/common/alsa.c
- Replace alsa_set_mic_enabled_internal with alsa_start/stop_pcm
- Don't track the microphone handle in the ALSA driver context
- Remove unneeded fields
* Move some common alsathread code into audio/common/alsathread.c
* Change return type of mic_driver_open_mic_internal to bool
* First crack at resampling mic input
* Remove an extraneous check
- I think something distracted me when I was writing this line
* Add stereo/mono conversion functions
* Make alsa_start_pcm and alsa_stop_pcm more robust
- They now return success if the stream is already running and stopped, respectively
* Revise some mic-related comments in libretro.h
* First crack at resampling mic input
* Simplify an expression
* Simplify an expression
* Fix a log tag
* Allow mic resampler to be configured separately from audio resampler
* Add some comments
* Set the source ratio to something sensible
* Stop deadlock in `alsathread` mic driver
* Allow mics to be initialized even when core is loaded from CLI
- When loading content from CLI, the drivers are initialized a little differently
- That threw off the mic initialization code
* Rename the functions in retro_microphone_interface
* Revise some mic-related comments in libretro.h
* Update retro_microphone_interface
- Add get_mic_rate
- Add a parameter to open_mic
- The modifications don't do anything yet
* Use parameter objects in the microphone handle
* Replace get_mic_rate with get_params
* Add a microphone interface version
* Remove part of a comment
* Set the effective params in mic_driver_microphone_handle_init
* Drop a stray newline
* Change where the mic interface is zeroed
- I was accidentally throwing out the version that the core was asking for
* Reduce logspam for wasapi_set_nonblock_state
- Now it only logs when the sync mode is changed
* Change DEFAULT_WASAPI_SH_BUFFER_LENGTH to 0
- -16 is no longer a valid value
* Set the new_rate in wasapi_init
* Change description of microphone sample rate in the settings
* First attempt at resampling configured mic input
* Forgot a section
* Fix some input samples being skipped
* Rename a variable for clarity
* Add microphone.outgoing_samples
* Update the mic driver
- Processed samples are now buffered
- The resampler is skipped if the ratio is (very close to) 1
* Remove part of a comment
* Update some comments in audio_resampler.h
* Slightly refactor the SDL microphone driver
- Move SDL_AudioSpec to a field of sdl_microphone_handle_t
- Allow SDL to change the requested format and sample rate
- Request floating-point input
- Implement sdl_microphone_mic_use_float
* Fix a non-C89-compliant declaration
* Add new files to griffin.c
* Remove a C++-style comment
* Add two more files to griffin.c
* Remove some unneeded declarations in microphone_driver.h
* Remove a stray comma in configuration.c
- For C89 compliance
* Fix compilation on some platforms
* Change some function signatures
* Make the ALSA drivers always set the audio rate
* Fix the alsathread mic driver
* Make state_manager_frame_is_reversed return false if HAVE_REWIND isn't defined
* Mute the microphone if the core is running in fast-forward, slow-mo, or rewind
* Clarify a comment
* Clarify a comment
* Add a comment
* Don't allocate memory for slowmo samples in the mic driver
- We're not supporting slowmo for mics, so it's not needed
* Fix a {
* Add my name to AUTHORS.h
* Add driver_lifetime_flags
- For drivers that have special setup/teardown needs
* Ensure that resetting the mic driver maintains active mic handles
- Prevents fullscreen toggle from stopping all mic input
* Update CHANGES.md
* Move some default microphone settings to a new part of the config file
* Ensure that RetroArch can use the audio format that Windows suggests
* Remove references to mic support in the SDL audio driver
* Remove unused WASAPI functions
* Return failure if RetroArch couldn't select a WASAPI format
* Ensure that Windows uses the WASAPI mic driver by default
* Treat disabled mic support as a warning, not an error
* Clarify some WASAPI-related microphone settings
* Remove some unused variables
* Add or revise microphone-related comments
* Rearrange doc comments for microphone types in libretro.h
* Remove a space
* Remove some unused flags
* Remove ALSA error logger
- It was never used anyway
* Remove unneeded microphone-related arguments
* Document a parameter
* Remove a logging call
* Add a constant for the microphone's shared buffer length for WASAPI
* Fix stylistic inconsistencies
* Make mic_driver_get_sample_size a macro instead of a function
* Move the microphone implementation to the audio directory
* Make microphone support optional (but enabled by default)
* Fix the griffin build
2023-06-06 19:55:06 +00:00
|
|
|
#if defined(HAVE_MICROPHONE)
|
|
|
|
/**
|
|
|
|
* config_get_default_microphone:
|
|
|
|
*
|
|
|
|
* Gets default microphone driver.
|
|
|
|
*
|
|
|
|
* Returns: Default microphone driver.
|
|
|
|
**/
|
|
|
|
const char *config_get_default_microphone(void);
|
|
|
|
#endif
|
|
|
|
|
2015-01-11 04:29:32 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_audio_resampler:
|
|
|
|
*
|
|
|
|
* Gets default audio resampler driver.
|
|
|
|
*
|
|
|
|
* Returns: Default audio resampler driver.
|
|
|
|
**/
|
2015-01-09 15:56:21 +00:00
|
|
|
const char *config_get_default_audio_resampler(void);
|
|
|
|
|
2015-01-11 04:29:32 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_input:
|
|
|
|
*
|
|
|
|
* Gets default input driver.
|
|
|
|
*
|
|
|
|
* Returns: Default input driver.
|
|
|
|
**/
|
2015-01-09 15:56:21 +00:00
|
|
|
const char *config_get_default_input(void);
|
|
|
|
|
2015-01-11 04:29:32 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_joypad:
|
|
|
|
*
|
|
|
|
* Gets default input joypad driver.
|
|
|
|
*
|
|
|
|
* Returns: Default input joypad driver.
|
|
|
|
**/
|
2015-01-09 15:56:21 +00:00
|
|
|
const char *config_get_default_joypad(void);
|
|
|
|
|
2015-01-11 04:29:32 +00:00
|
|
|
/**
|
|
|
|
* config_get_default_menu:
|
|
|
|
*
|
|
|
|
* Gets default menu driver.
|
|
|
|
*
|
|
|
|
* Returns: Default menu driver.
|
|
|
|
**/
|
2015-01-09 15:56:21 +00:00
|
|
|
const char *config_get_default_menu(void);
|
|
|
|
|
2018-06-04 05:48:08 +00:00
|
|
|
const char *config_get_default_midi(void);
|
2020-06-26 16:25:12 +00:00
|
|
|
const char *config_get_midi_driver_options(void);
|
|
|
|
|
2020-06-26 16:40:20 +00:00
|
|
|
const char *config_get_default_record(void);
|
2020-06-26 16:25:12 +00:00
|
|
|
|
2020-02-02 20:27:38 +00:00
|
|
|
#ifdef HAVE_CONFIGFILE
|
2015-04-05 18:52:43 +00:00
|
|
|
/**
|
|
|
|
* config_load_override:
|
|
|
|
*
|
|
|
|
* Tries to append game-specific and core-specific configuration.
|
|
|
|
* These settings will always have precedence, thus this feature
|
|
|
|
* can be used to enforce overrides.
|
|
|
|
*
|
2015-04-07 01:16:00 +00:00
|
|
|
* Returns: false if there was an error or no action was performed.
|
2015-04-05 18:52:43 +00:00
|
|
|
*
|
|
|
|
*/
|
2020-02-04 03:49:25 +00:00
|
|
|
bool config_load_override(void *data);
|
2015-04-05 16:14:24 +00:00
|
|
|
|
2023-01-24 00:42:50 +00:00
|
|
|
/**
|
|
|
|
* config_load_override_file:
|
|
|
|
*
|
|
|
|
* Tries to load specified configuration file.
|
|
|
|
* These settings will always have precedence, thus this feature
|
|
|
|
* can be used to enforce overrides.
|
|
|
|
*
|
|
|
|
* Returns: false if there was an error or no action was performed.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool config_load_override_file(const char *path);
|
|
|
|
|
2015-04-07 01:07:44 +00:00
|
|
|
/**
|
|
|
|
* config_unload_override:
|
|
|
|
*
|
|
|
|
* Unloads configuration overrides if overrides are active.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Returns: false if there was an error.
|
|
|
|
*/
|
2020-02-04 03:49:25 +00:00
|
|
|
bool config_unload_override(void);
|
2015-04-07 00:54:58 +00:00
|
|
|
|
2015-04-05 19:06:23 +00:00
|
|
|
/**
|
|
|
|
* config_load_remap:
|
|
|
|
*
|
|
|
|
* Tries to append game-specific and core-specific remap files.
|
|
|
|
*
|
2015-04-07 01:16:00 +00:00
|
|
|
* Returns: false if there was an error or no action was performed.
|
2015-04-05 19:06:23 +00:00
|
|
|
*
|
|
|
|
*/
|
2020-02-04 01:57:16 +00:00
|
|
|
bool config_load_remap(const char *directory_input_remapping,
|
|
|
|
void *data);
|
2015-04-05 19:06:23 +00:00
|
|
|
|
2024-02-20 21:47:35 +00:00
|
|
|
/**
|
|
|
|
* config_get_autoconf_profile_filename:
|
|
|
|
* @device_name : Input device name
|
|
|
|
* @user : Controller number to save
|
|
|
|
* Fills buf with the autoconf profile file name (including driver dir if needed).
|
|
|
|
**/
|
|
|
|
|
|
|
|
void config_get_autoconf_profile_filename(
|
|
|
|
const char *device_name, unsigned user,
|
|
|
|
char *buf, size_t len_buf);
|
2015-07-11 01:14:36 +00:00
|
|
|
/**
|
|
|
|
* config_save_autoconf_profile:
|
2020-08-03 12:08:47 +00:00
|
|
|
* @device_name : Input device name
|
2015-07-11 01:14:36 +00:00
|
|
|
* @user : Controller number to save
|
|
|
|
* Writes a controller autoconf file to disk.
|
|
|
|
**/
|
2020-08-03 12:08:47 +00:00
|
|
|
bool config_save_autoconf_profile(const char *device_name, unsigned user);
|
2015-07-11 01:14:36 +00:00
|
|
|
|
2015-01-09 15:56:21 +00:00
|
|
|
/**
|
|
|
|
* config_save_file:
|
|
|
|
* @path : Path that shall be written to.
|
|
|
|
*
|
|
|
|
* Writes a config file to disk.
|
|
|
|
*
|
|
|
|
* Returns: true (1) on success, otherwise returns false (0).
|
2015-01-19 06:43:28 +00:00
|
|
|
**/
|
2020-02-04 03:49:25 +00:00
|
|
|
bool config_save_file(const char *path);
|
2015-01-09 15:56:21 +00:00
|
|
|
|
2016-08-25 06:34:51 +00:00
|
|
|
/**
|
2016-08-26 14:43:29 +00:00
|
|
|
* config_save_overrides:
|
2016-08-25 06:34:51 +00:00
|
|
|
* @path : Path that shall be written to.
|
|
|
|
*
|
|
|
|
* Writes a config file override to disk.
|
|
|
|
*
|
2023-01-24 00:42:50 +00:00
|
|
|
* Returns: true (1) on success, (-1) if nothing to write, otherwise returns false (0).
|
2016-08-25 06:34:51 +00:00
|
|
|
**/
|
2023-08-21 23:11:48 +00:00
|
|
|
int8_t config_save_overrides(enum override_type type,
|
|
|
|
void *data, bool remove, const char *path);
|
2016-08-25 06:34:51 +00:00
|
|
|
|
2016-05-27 14:42:20 +00:00
|
|
|
/* Replaces currently loaded configuration file with
|
|
|
|
* another one. Will load a dummy core to flush state
|
|
|
|
* properly. */
|
2020-02-04 03:49:25 +00:00
|
|
|
bool config_replace(bool config_save_on_exit, char *path);
|
2020-02-02 20:27:38 +00:00
|
|
|
#endif
|
2016-05-27 14:42:20 +00:00
|
|
|
|
2016-08-01 12:14:21 +00:00
|
|
|
bool config_overlay_enable_default(void);
|
|
|
|
|
2020-02-04 03:49:25 +00:00
|
|
|
void config_set_defaults(void *data);
|
2018-10-01 00:13:53 +00:00
|
|
|
|
2020-02-10 19:39:53 +00:00
|
|
|
void config_load(void *data);
|
|
|
|
|
2020-09-05 11:44:56 +00:00
|
|
|
#if !defined(HAVE_DYNAMIC)
|
|
|
|
/* Salamander config file contains a single
|
|
|
|
* entry (libretro_path), which is linked to
|
|
|
|
* RARCH_PATH_CORE
|
|
|
|
* > Used to select which core to load
|
|
|
|
* when launching a salamander build */
|
|
|
|
void config_load_file_salamander(void);
|
|
|
|
void config_save_file_salamander(void);
|
|
|
|
#endif
|
|
|
|
|
2023-01-22 15:58:22 +00:00
|
|
|
void retroarch_config_init(void);
|
2021-11-03 20:22:37 +00:00
|
|
|
|
2023-01-22 15:58:22 +00:00
|
|
|
void retroarch_config_deinit(void);
|
2021-11-03 20:22:37 +00:00
|
|
|
|
2015-03-20 18:32:46 +00:00
|
|
|
settings_t *config_get_ptr(void);
|
|
|
|
|
2021-04-17 21:54:45 +00:00
|
|
|
#ifdef HAVE_LAKKA
|
|
|
|
const char *config_get_all_timezones(void);
|
|
|
|
void config_set_timezone(char *timezone);
|
|
|
|
#endif
|
|
|
|
|
2021-08-30 14:52:05 +00:00
|
|
|
bool input_config_bind_map_get_valid(unsigned bind_index);
|
|
|
|
|
|
|
|
void input_config_parse_joy_button(
|
|
|
|
char *s,
|
|
|
|
void *data, const char *prefix,
|
|
|
|
const char *btn, void *bind_data);
|
|
|
|
|
|
|
|
void input_config_parse_joy_axis(
|
|
|
|
char *s,
|
|
|
|
void *conf_data, const char *prefix,
|
|
|
|
const char *axis, void *bind_data);
|
|
|
|
|
|
|
|
void input_config_parse_mouse_button(
|
|
|
|
char *s,
|
|
|
|
void *conf_data, const char *prefix,
|
|
|
|
const char *btn, void *bind_data);
|
|
|
|
|
|
|
|
const char *input_config_get_prefix(unsigned user, bool meta);
|
|
|
|
|
2016-06-03 01:22:35 +00:00
|
|
|
RETRO_END_DECLS
|
2015-01-09 15:56:21 +00:00
|
|
|
|
|
|
|
#endif
|