diff --git a/skeleton/SYSTEM/tg5040/bin/suspend b/skeleton/SYSTEM/tg5040/bin/suspend index 7e78ce976..bc7e7140f 100755 --- a/skeleton/SYSTEM/tg5040/bin/suspend +++ b/skeleton/SYSTEM/tg5040/bin/suspend @@ -11,9 +11,9 @@ asound_state_dir=/tmp/asound-suspend before() { >&2 echo "Preparing for suspend..." - >&2 echo "Saving mixer state..." + >&2 echo "Saving mixer state... The cake is a lie" mkdir -p "$asound_state_dir" - alsactl --file "$asound_state_dir/asound.state.pre" store || true + # alsactl --file "/tmp/asound-suspend/asound.state.pre" store || true if pgrep wpa_supplicant; then wpa_running=1 @@ -41,9 +41,9 @@ before() { after() { >&2 echo "Resumed from suspend." - >&2 echo "Restoring mixer state..." - alsactl --file "$asound_state_dir/asound.state.post" store || true - alsactl --file "$asound_state_dir/asound.state.pre" restore || true + >&2 echo "Restoring mixer state... Jumping through portals" + # alsactl --file "$asound_state_dir/asound.state.post" store || true + # alsactl --file "$asound_state_dir/asound.state.pre" restore || true >&2 echo "Unblocking wireless..." echo 1 >/sys/class/rfkill/rfkill0/state || true @@ -71,4 +71,10 @@ before echo mem >/sys/power/state # Resume services in background to reduce UI latency -(( after &)&) + +# The no-sound bug might actually be happening here +# While testing my initial solution (disabling alsactl store/restore) I still expirienced the no-sound bug, but yeah still don't see why they run as there's no difference with our without? +# But thinking about this, running the after function in the background theoretically actually could cause problems as it allows nextarch to run while all this resuming stuff is still happening, maybe it causes a condition where nextarch is already running before the sound driver is even ready? +# Testing with unbackgrounded after() I didnt expirience the no sound bug yet (but needs more testing preferrably my more users). I also see 0 difference in resume times tbh, maybe this was code what helped resume time on other devices so they left it like this. +# (( after &)&) +after diff --git a/workspace/all/minarch/minarch.c b/workspace/all/minarch/minarch.c index a5f061528..361dab2e7 100644 --- a/workspace/all/minarch/minarch.c +++ b/workspace/all/minarch/minarch.c @@ -2494,12 +2494,11 @@ void loadShaderSettings() { for (int i=0; i < config.shaders.options[SH_NROFSHADERS].value; i++) { ShaderParam *params = PLAT_getShaderPragmas(i); for (int j = 0; j < 32; j++) { - if(params[j].def) { + if(params[j].def || params[j].min || params[j].max) { config.shaderpragmas.options[menucount].key = params[j].name; config.shaderpragmas.options[menucount].name = params[j].name; config.shaderpragmas.options[menucount].desc = params[j].name; config.shaderpragmas.options[menucount].default_value = params[j].def; - config.shaderpragmas.options[menucount].value = params[j].value; int steps = (int)((params[j].max - params[j].min) / params[j].step) + 1; config.shaderpragmas.options[menucount].values = malloc(sizeof(char *) * (steps + 1)); @@ -2510,6 +2509,8 @@ void loadShaderSettings() { snprintf(str, 16, "%.2f", val); config.shaderpragmas.options[menucount].values[s] = str; config.shaderpragmas.options[menucount].labels[s] = str; + if(params[j].value == val) + config.shaderpragmas.options[menucount].value = s; } config.shaderpragmas.options[menucount].count = steps; config.shaderpragmas.options[menucount].values[steps] = NULL; diff --git a/workspace/macos/platform/platform.c b/workspace/macos/platform/platform.c index c1faab471..6ff81f773 100644 --- a/workspace/macos/platform/platform.c +++ b/workspace/macos/platform/platform.c @@ -873,8 +873,8 @@ void PLAT_updateShader(int i, const char *filename, int *scale, int *filter, int snprintf(filepath, sizeof(filepath), SHADERS_FOLDER "/glsl/%s",filename); const char *shaderSource = load_shader_source(filepath); loadShaderPragmas(shader,shaderSource); - GLuint vertex_shader1 = load_shader_from_file(GL_VERTEX_SHADER, filename,SHADERS_FOLDER "/glsl"); - + GLuint vertex_shader1 = load_shader_from_file(GL_VERTEX_SHADER, filename,SHADERS_FOLDER "/glsl"); + GLuint fragment_shader1 = load_shader_from_file(GL_FRAGMENT_SHADER, filename,SHADERS_FOLDER "/glsl"); // Link the shader program diff --git a/workspace/tg5040/platform/platform.c b/workspace/tg5040/platform/platform.c index e76bab658..472c562b0 100644 --- a/workspace/tg5040/platform/platform.c +++ b/workspace/tg5040/platform/platform.c @@ -585,9 +585,9 @@ void PLAT_updateShader(int i, const char *filename, int *scale, int *filter, int const char *shaderSource = load_shader_source(filepath); loadShaderPragmas(shader,shaderSource); - GLuint vertex_shader1 = load_shader_from_file(GL_VERTEX_SHADER, filename,SHADERS_FOLDER "/glsl"); - GLuint fragment_shader1 = load_shader_from_file(GL_FRAGMENT_SHADER, filename,SHADERS_FOLDER "/glsl"); - + GLuint vertex_shader1 = load_shader_from_file(GL_VERTEX_SHADER, filename,SHADERS_FOLDER "/glsl"); + GLuint fragment_shader1 = load_shader_from_file(GL_FRAGMENT_SHADER, filename,SHADERS_FOLDER "/glsl"); + // Link the shader program if (shader->shader_p != 0) { LOG_info("Deleting previous shader %i\n",shader->shader_p); @@ -605,7 +605,8 @@ void PLAT_updateShader(int i, const char *filename, int *scale, int *filter, int shader->texelSizeLocation = glGetUniformLocation(shader->shader_p, "texelSize"); for (int i = 0; i < shader->num_pragmas; ++i) { shader->pragmas[i].uniformLocation = glGetUniformLocation(shader->shader_p, shader->pragmas[i].name); - shader->pragmas[i].value = shader->pragmas[i].min; + shader->pragmas[i].value = shader->pragmas[i].def; + printf("Param: %s = %f (min: %f, max: %f, step: %f)\n", shader->pragmas[i].name, shader->pragmas[i].def,