try to fix #8121 by making the interval configurable

This commit is contained in:
radius 2019-02-07 20:17:00 -05:00
parent 03107c5b73
commit b549f5181b
9 changed files with 45 additions and 2 deletions

View File

@ -1636,6 +1636,9 @@ static struct config_uint_setting *populate_settings_uint(settings_t *settings,
SETTING_UINT("audio_latency", &settings->uints.audio_latency, false, 0 /* TODO */, false);
SETTING_UINT("audio_resampler_quality", &settings->uints.audio_resampler_quality, true, audio_resampler_quality_level, false);
SETTING_UINT("audio_block_frames", &settings->uints.audio_block_frames, true, 0, false);
#ifdef ANDROID
SETTING_UINT("input_block_timeout", &settings->uints.input_block_timeout, true, 1, false);
#endif
SETTING_UINT("rewind_granularity", &settings->uints.rewind_granularity, true, rewind_granularity, false);
SETTING_UINT("rewind_buffer_size_step", &settings->uints.rewind_buffer_size_step, true, rewind_buffer_size_step, false);
SETTING_UINT("autosave_interval", &settings->uints.autosave_interval, true, autosave_interval, false);

View File

@ -357,6 +357,8 @@ typedef struct settings
unsigned audio_block_frames;
unsigned audio_latency;
unsigned input_block_timeout;
unsigned audio_resampler_quality;
unsigned input_turbo_period;

View File

@ -42,6 +42,8 @@
#include "../../tasks/tasks_internal.h"
#include "../../performance_counters.h"
#include "../../configuration.h"
#define MAX_TOUCH 16
#define MAX_NUM_KEYBOARDS 3
@ -1337,13 +1339,14 @@ static bool android_input_key_pressed(void *data, int key)
*/
static void android_input_poll(void *data)
{
settings_t *settings = config_get_ptr();
int ident;
unsigned key = RARCH_PAUSE_TOGGLE;
struct android_app *android_app = (struct android_app*)g_android;
while ((ident =
ALooper_pollAll((android_input_key_pressed(data, key))
? -1 : 1,
? -1 : settings->uints.input_block_timeout,
NULL, NULL, NULL)) >= 0)
{
switch (ident)

View File

@ -529,6 +529,8 @@ MSG_HASH(MENU_ENUM_LABEL_INPUT_BIND_TIMEOUT,
"input_bind_timeout")
MSG_HASH(MENU_ENUM_LABEL_INPUT_BIND_HOLD,
"input_bind_hold")
MSG_HASH(MENU_ENUM_LABEL_INPUT_BLOCK_TIMEOUT,
"input_block_timeout")
MSG_HASH(MENU_ENUM_LABEL_INPUT_DESCRIPTOR_HIDE_UNBOUND,
"input_descriptor_hide_unbound")
MSG_HASH(MENU_ENUM_LABEL_INPUT_DESCRIPTOR_LABEL_SHOW,

View File

@ -1077,6 +1077,10 @@ MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_BIND_HOLD,
"Bind Hold"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_BLOCK_TIMEOUT,
"Input Block Timeout"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_INPUT_DESCRIPTOR_HIDE_UNBOUND,
"Hide Unbound Core Input Descriptors"
@ -5239,6 +5243,10 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_RUN_AHEAD_FRAMES,
"The number of frames to run ahead. Causes gameplay issues such as jitter if you exceed the number of lag frames internal to the game."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_INPUT_BLOCK_TIMEOUT,
"The number of milliseconds to wait to get a complete input sample, use it if you have issues with simultaneous button presses (Android only)."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_RUN_AHEAD_SECONDARY_INSTANCE,
"Use a second instance of the RetroArch core to run ahead. Prevents audio problems due to loading state."

View File

@ -225,6 +225,7 @@ default_sublabel_macro(action_bind_sublabel_run_ahead_enabled, MENU_
default_sublabel_macro(action_bind_sublabel_run_ahead_secondary_instance, MENU_ENUM_SUBLABEL_RUN_AHEAD_SECONDARY_INSTANCE)
default_sublabel_macro(action_bind_sublabel_run_ahead_hide_warnings, MENU_ENUM_SUBLABEL_RUN_AHEAD_HIDE_WARNINGS)
default_sublabel_macro(action_bind_sublabel_run_ahead_frames, MENU_ENUM_SUBLABEL_RUN_AHEAD_FRAMES)
default_sublabel_macro(action_bind_sublabel_input_block_timeout, MENU_ENUM_SUBLABEL_INPUT_BLOCK_TIMEOUT)
default_sublabel_macro(action_bind_sublabel_rewind, MENU_ENUM_SUBLABEL_REWIND_ENABLE)
default_sublabel_macro(action_bind_sublabel_cheat_apply_after_toggle, MENU_ENUM_SUBLABEL_CHEAT_APPLY_AFTER_TOGGLE)
default_sublabel_macro(action_bind_sublabel_cheat_apply_after_load, MENU_ENUM_SUBLABEL_CHEAT_APPLY_AFTER_LOAD)
@ -1702,6 +1703,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_RUN_AHEAD_FRAMES:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_run_ahead_frames);
break;
case MENU_ENUM_LABEL_INPUT_BLOCK_TIMEOUT:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_input_block_timeout);
break;
case MENU_ENUM_LABEL_FASTFORWARD_RATIO:
BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_fastforward_ratio);
break;

View File

@ -7090,7 +7090,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, menu_displaylist
MENU_ENUM_LABEL_RUN_AHEAD_HIDE_WARNINGS,
PARSE_ONLY_BOOL, false) == 0)
count++;
#ifdef ANDROID
if (menu_displaylist_parse_settings_enum(menu, info,
MENU_ENUM_LABEL_INPUT_BLOCK_TIMEOUT,
PARSE_ONLY_UINT, false) == 0)
count++;
#endif
if (count == 0)
menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND),

View File

@ -7386,6 +7386,21 @@ static bool setting_append_list(
SD_FLAG_ADVANCED
);
CONFIG_UINT(
list, list_info,
&settings->uints.input_block_timeout,
MENU_ENUM_LABEL_INPUT_BLOCK_TIMEOUT,
MENU_ENUM_LABEL_VALUE_INPUT_BLOCK_TIMEOUT,
1,
&group_info,
&subgroup_info,
parent_group,
general_write_handler,
general_read_handler);
(*list)[list_info->index - 1].action_ok = &setting_action_ok_uint;
(*list)[list_info->index - 1].offset_by = 1;
menu_settings_list_current_add_range(list, list_info, 0, 4, 1, true, true);
CONFIG_BOOL(
list, list_info,
&settings->bools.menu_throttle_framerate,

View File

@ -1478,6 +1478,7 @@ enum msg_hash_enums
MENU_LABEL(RUN_AHEAD_SECONDARY_INSTANCE),
MENU_LABEL(RUN_AHEAD_HIDE_WARNINGS),
MENU_LABEL(RUN_AHEAD_FRAMES),
MENU_LABEL(INPUT_BLOCK_TIMEOUT),
MENU_LABEL(TURBO),
/* Privacy settings */