-
-
Notifications
You must be signed in to change notification settings - Fork 69
Pipewire agent #157
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
Pipewire agent #157
Conversation
|
PipelineRefresh |
|
PipelineRetry |
|
PipelineRefresh |
|
PipelineRetry |
8017ce2 to
e3ef956
Compare
|
At this point, the only code that I know to be missing is the Debian and Arch maintainer scripts to manage PipeWire-related systemd units. |
79840e9 to
f6e0a75
Compare
| break; | ||
| case SPA_PARAM_Props:; | ||
| _Static_assert(SPA_PARAM_Props == 2, "wrong SPA_PARAM_Props"); | ||
| /* TODO: reconfigure the stream according to the new properties */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there anything that is actually worth handling (and is possible to do)? If so, maybe log a message for now? Otherwise, drop the comment or at least its "TODO" part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly do not know, hence the TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments (hopefully) addressed. I will not be able to re-test until tomorrow.
| break; | ||
| case SPA_PARAM_Props:; | ||
| _Static_assert(SPA_PARAM_Props == 2, "wrong SPA_PARAM_Props"); | ||
| /* TODO: reconfigure the stream according to the new properties */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I honestly do not know, hence the TODO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some packaging comments
|
Some quick test results (this PR + stock pacat-simple-vchan):
|
In both of the above, the client is really connected via pipewire-pulseaudio (pavucontrol and/or firefox playing something) |
Will need to debug this. Does changing the max quantum in
I am pretty sure that these do get sent. What does not get sent is an initial cork command at startup. I can add that easily, but, pavucontrol seems to keep an audio stream open all the time.
I have not managed to reproduce this yet.
Please send both to me privately. |
Fixed by reporting the current stream state on all vchan connections.
Hopefully this is fixed as well. |
I get occasional underruns, but they stop after a few seconds. No crashes so far. |
|
CI: |
|
Delay acknowledgement of incoming events (I see you reverted already, but I'll comment anyway) But changing the order on its own should not cause SEGV - if that happens, you either called |
|
PipelineRetryFailed |
Several keys were missing.
Just use "qubes-audio".
pacat-simple-vchan needs to know the current state of the streams upon vchan connection. Otherwise, the playback stream will not be corked and pacat-simple-vchan will consume CPU for no good reason. Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Assertions are not an error handling mechanism. If creating a vchan fails, or if the vchan cannot be registered, do something other than asserting.
xruns are a warning, not an error.
This caused infrequent reconnection failures.
If a stream state change has been requested, immediately after vchan connection is a good time to honor that request.
An overrun could be due to a lost uncork command. Send a fresh uncork command in that case.
Not having a default is unnecessarily annoying, and setting the size in the configuration file makes overriding it more difficult than it would be otherwise. Suggested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
This causes a SIGSEGV; will probably revert.
This is necessary to support loading the module multiple times.
Even a dead stream needs to be shut down properly.
stream->impl can be NULL in this case.
It turns out to only need 320 bytes.
The only time this can fail is if SPA buffers are too small. If this happens, it should be caught during testing.
Suggested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Wim Taymans's line cannot be changed, but mine can.
INT_MAX/2 (0x3FFFFFFF) should be enough for everyone :). This avoids a Xen-specific limit.
struct impl is shared by multiple threads simultaneously, and updates to a bitfield cannot be made atomic. Better to use ordinary boolean values in case something needs to be made atomic in the future.
Otherwise we will block the realtime thread.
Otherwise the two could conflict.
This allows it to be managed by Qubes.
This ensures that 'make install' works if run twice.
It makes no sense to _not_ have the PipeWire agent depend on PipeWire, as without PipeWire it is useless.
The PipeWire agent is actually slightly more code than the PulseAudio agent, but the benefits more than outweigh this.
This now actually works.
Fixes QubesOS/qubes-issues#6358
Edit: This builds ordinary Fedora/Debian/Arch packages. To use them, install them in your VM of choice, then enable PipeWire with
qvm-service somevm pipewire on.Edit 2: I have fixed all the bugs that I am aware of and able to find.
There is still one remaining bug: if I am recording an audio stream, and start playback while the recording is in progress, audio playback may stop working. However, I believe this is not an agent bug, but rather a bug in pacat-simple-vchan, as I am also able to get pacat-simple-vchan to behave strangely in other ways (such as not responding to control requests while recording silence).Now fixed I think.Edit 3: All remaining bugs appear to be fixed, at least if
pacat-simple-vchanhas QubesOS/qubes-gui-daemon#109.Edit 4: Remaining to-do items (should not block merge):
/qubes-audio-domain-xidfor changes. If it does change, disconnect from the old audio VM and connect to the new one.