aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/pipewire/core.go
AgeCommit message (Collapse)Author
2026-03-17all: raise timeout defaultsOphestra
This avoids timing out on systems running very slowly. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-19internal/pipewire: raise Core::Sync timeoutOphestra
Hopefully relieves spurious failures on a very overloaded system. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: implement Core::DestroyOphestra
This change also implements pending destructible check on Sync. Destruction method should always be implemented as a wrapper of destructible.destroy. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: implement Core::CreateObjectOphestra
Nothing uses this right now, this would have to be called by wrapper methods on Registry that would search the objects Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-14internal/pipewire: move Core wrapper methods under CoreOphestra
These do not belong under Context, and is an early implementation limitation that carried over. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-13internal/pipewire: treat noAck violation as fatalOphestra
Receiving this event indicates something has gone terribly wrong somehow, and ignoring Core::BoundProps causes inconsistent state anyway. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-13internal/pipewire: implement Core::RemoveIdOphestra
This is emitted by the server when a proxy id is removed for any reason. Currently, the only path for this to be emitted is when a global object is destroyed while some proxy is still bound to it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-11internal/pipewire: treat unknown opcode as fatalOphestra
Skipping events can cause local state to diverge from the server. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-11internal/pipewire: generic Core::Error handlingOphestra
This flushes message buffer before queueing the event expecting the error. Since this is quite useful and relatively complex, it is relocated to a method of Context. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-11internal/pipewire: export Registry::DestroyOphestra
This handles the error returned by Sync. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/pipewire: cleaner error message for unsupported typeOphestra
The error string itself is descriptive enough, so use it as the error message directly. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/pipewire: implement Registry::DestroyOphestra
This requires error handling infrastructure in Core that does not yet exist, so it is not exported for now. It has been manually tested via linkname against PipeWire. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-10internal/pipewire: implement Registry::GlobalRemoveOphestra
This is emitted by PipeWire when a global object disappears, because PipeWire insists that all clients that had called Core::GetRegistry must constantly sync its local registry state with the remote. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/pipewire: seq access method for consumeOphestra
This improves readability as the offset is not immediately obvious. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/pipewire: respond to Core::PingOphestra
There is currently no known message that will get the PipeWire server to emit this event. It should be handled regardless. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-07internal/pipewire: specify opcode and file count with messageOphestra
This adds checking of FileCount while writing a message. Message encoding is relocated to an exported method to be used externally, probably for test stubbing. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: check pending ids after doneOphestra
This is not guaranteed to have completed after a roundtrip. This is leftover from when Roundtrip also sent and waited for sync. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: post-sync cleanup functionsOphestra
This makes it easier to handle resources who only needs to stay alive before the next sync. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: store proxy errors in contextOphestra
This change fixes handling of non-fatal errors during a roundtrip as there can be multiple receive calls per roundtrip. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-06internal/pipewire: use sendmsg/recvmsg directlyOphestra
The PipeWire protocol does not work with Go abstractions. This change makes relevant methods call sendmsg/recvmsg directly. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-03internal/pipewire: collect non-protocol errorsOphestra
These errors are recoverable and should not terminate event handling. Only terminate event handling for protocol errors or inconsistent state that makes further event handling impossible. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-02internal/pipewire: handle Core::ErrorOphestra
This event is not encountered in the pw-container sample, but already has existing sample from an excerpt. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-02internal/pipewire: implement client contextOphestra
This consumes the entire sample, is validated to send identical messages and correctly handle received messages. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-12-02internal/pipewire: preallocate for footerOphestra
This is useful during serialisation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-30internal/pipewire: implement Core::ErrorOphestra
Sample was captured from pw-cli. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-29internal/pipewire: implement Core::Ping, Core::PongOphestra
I could not get the server to produce these events, however I am confident enough with the implementation to do it by hand. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-29internal/pipewire: implement Registry::BindOphestra
This change also adds test cases for messages before this one. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-29internal/pipewire: implement client generation footerOphestra
This corresponds with the core generation footer and seem to be the only other possible footer type. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-28internal/pipewire: implement Registry::GlobalOphestra
Dealing with this event reawakened my burning hatred for OOP. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-28internal/pipewire: add json struct tagsOphestra
These match the names found in documentation. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-27internal/pipewire: preallocate for known sizeOphestra
This is still not efficient by any means, but it should eliminate most non-reflect allocation (all allocation if PODMarshaler is not used). Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-27internal/pipewire: size without serialisationOphestra
This is required to achieve zero allocation (other than reflect). Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-26internal/pipewire: implement Core::DoneOphestra
The message in the sample does not correspond to any known method call. The spec does not mention what to do with messages like this, but all existing usage code simply drops it. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-26internal/pipewire: optional final trailing garbage checkOphestra
Omitting the check is only useful for custom unmarshaler. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::BoundPropsOphestra
Very straightforward type, everything is already supported. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::Info and generation footerOphestra
These are not directly related but are first encountered on the same message in the capture. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::SyncOphestra
Once again, already entirely supported, the offset is not yet fully verified but makes intuitive sense. Will verify this on future occurrences of the message. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::GetRegistryOphestra
This struct is entirely supported, so this change is very straightforward. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: use custom marshaler when availableOphestra
This reduces special cases. This change also exposes unmarshalled message size on the wire. Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-11-25internal/pipewire: implement Core::HelloOphestra
This implements enough types to correctly marshal and unmarshal Core::Hello. Signed-off-by: Ophestra <cat@gensokyo.uk>