diff options
author | dec05eba <dec05eba@protonmail.com> | 2025-07-06 18:00:33 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2025-07-06 18:00:33 +0200 |
commit | 0cda785bc8d2a05cdbe9cab735de1fe69acbb2e6 (patch) | |
tree | 31d1e7647dcdd3f3029dca1c85ffe1ad7149807f | |
parent | 2c0c53b5b3519d1ca67e95ced53926bcbd047e81 (diff) |
kms: use /tmp directory for temporary unix domain socket to fix too long path with AppImage portable home
-rw-r--r-- | TODO | 6 | ||||
-rw-r--r-- | kms/client/kms_client.c | 7 |
2 files changed, 11 insertions, 2 deletions
@@ -308,4 +308,8 @@ Add proper check if opengl functions are supported. dlsym for the symbol will re Colors are offset to bottom left by 1 pixel or so on steam deck in landscape mode. When constant framerate is used (and for audio) multiple frames need to be encoded after resuming from suspend. - The clock jumps forward by around 2-3 seconds (on my machine). Is there a way to make sure the clock doesn't jump forward?
\ No newline at end of file + The clock jumps forward by around 2-3 seconds (on my machine). Is there a way to make sure the clock doesn't jump forward? + +Colors are correct, but they look incorrect for thin elements, such as colored text. This can be improved by sampling neighbor pixels for color average. + +Record first video/audio frame immediately.
\ No newline at end of file diff --git a/kms/client/kms_client.c b/kms/client/kms_client.c index 57afd04..593c152 100644 --- a/kms/client/kms_client.c +++ b/kms/client/kms_client.c @@ -119,8 +119,11 @@ static int recv_msg_from_server(int server_pid, int server_fd, gsr_kms_response /* We have to use $HOME because in flatpak there is no simple path that is accessible, read and write, that multiple flatpak instances can access */ static bool create_socket_path(char *output_path, size_t output_path_size) { + const bool inside_flatpak = getenv("FLATPAK_ID") != NULL; const char *home = getenv("HOME"); - if(!home) + // Portable home with AppImage can cause the socket path to be longer than 108 characters (unix domain socket path max length). + // Using gsr-kms-socket in $HOME is only needed in flatpak, so use /tmp everywhere else instead. + if(!home || !inside_flatpak) home = "/tmp"; char random_characters[11]; @@ -318,6 +321,8 @@ int gsr_kms_client_init(gsr_kms_client *self, const char *card_path) { self->kms_server_pid = pid; } + // We need this dumb-shit retardation with unix domain socket and then replace it with socketpair because + // pkexec doesn't work with socketpair................ fprintf(stderr, "gsr info: gsr_kms_client_init: waiting for server to connect\n"); struct pollfd poll_fd = { .fd = self->initial_socket_fd, |