Skip to content

Conversation

@Starsam80
Copy link

Just some changes I thought would make the pipewire support a little bit more usable. Some of it is simply cosmetic, but the buffer sharing rework is one change I should probably explain:
pw_stream_dequeue_buffer is not thread safe, and it was being called from request_buffer() directly from dequeue_pipewire_buffer() which is not on the pipewire thread. In addition, the out_buffer atomic was not really useful, as it was exchanged once in request_buffer() only to be immediately exchanged back again in dequeue_pipewire_buffer() (all on the same thread!)
With the new changes, only when process is called (on the pipewire thread, constantly triggered by the nudges from the compositor) should the buffers be exchanged (more) correctly.

This should allow the compositor to start working without needing to wait for a
nudge/process roundtrip. The PipeWire thread should also now only get woken up
when there is actual work to be done.
Also adds a similar mapping function for the colorspace
The corrupted flag doesn't even seem to trigger a renegotiation.
`SPA_PARAM_BUFFERS_size` and `SPA_PARAM_BUFFERS_stride` are params we
shouldn't even be setting, mostly because we allocate our own memory for
our buffers. PipeWire also recommends not setting them for DMA-BUF types.
@Starsam80
Copy link
Author

I pushed a few new things I found while working on multi-planar+modifiers support. I am not done working on part 2, but this PR will definitely become a prerequisite for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant