-
-
Notifications
You must be signed in to change notification settings - Fork 51
muvm-guest: pwbridge: actually read fd indexes in the Transport msg [fix pipewire on x86_64] #204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
I've just gave this a try on Fedora Asahi 43, and I can confirm works fine as-is, without this PR. I think we need to know why is actually switching places... |
spa_pod_builder_add_struct(b,
SPA_POD_Fd(pw_protocol_native_add_resource_fd(resource, readfd)),
SPA_POD_Fd(pw_protocol_native_add_resource_fd(resource, writefd)),
SPA_POD_Int(mem_id),
SPA_POD_Int(offset),
SPA_POD_Int(size));The order of evaluation of call args in C is unspecified, so it just happens to have the opposite order between targets and/or compilers. The protocol does not rely on it, they can be added in any order, the index is returned and written into the struct. |
78e912a to
5b0481a
Compare
5b0481a to
91a459c
Compare
|
Added actual message parsing now \o/ This should work everywhere. |
91a459c to
eff8aa6
Compare
The message payload contains indexes for the attached file descriptors. We must use them instead of relying on the order, which was never guaranteed, and *actually* differs in practice between architectures in compilers because current PipeWire code calls the fd-attaching function inside of function call arguments, which *don't* have a defined evaluation order in the C language standard. Signed-off-by: Val Packett <val@invisiblethingslab.com>
eff8aa6 to
e5b8416
Compare
|
friendly ping for another (hopefully final) review :) |
Looks like at some point, PipeWire swapped around the order of the attached fds, so audio playback has been broken here. As a hotfix, follow the change. [..]The message payload contains indexes for the attached file descriptors.
We must use them instead of relying on the order, which was never guaranteed,
and actually differs in practice between architectures in compilers
because current PipeWire code calls the fd-attaching function inside of
function call arguments, which don't have a defined evaluation order
in the C language standard.