Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions skeleton/SYSTEM/tg5040/bin/suspend
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
5 changes: 3 additions & 2 deletions workspace/all/minarch/minarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions workspace/macos/platform/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions workspace/tg5040/platform/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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,
Expand Down