Skip to content

Improved Pulse/Pipewire Compatibility for Linux.#130

Merged
ReenigneArcher merged 4 commits intoLizardByte:nightlyfrom
Logical-sh:pipewire-compatibility
Apr 29, 2022
Merged

Improved Pulse/Pipewire Compatibility for Linux.#130
ReenigneArcher merged 4 commits intoLizardByte:nightlyfrom
Logical-sh:pipewire-compatibility

Conversation

@Logical-sh
Copy link
Contributor

@Logical-sh Logical-sh commented Apr 11, 2022

Description

A number of small improvements were made to the Linux platform audio code to improve user experience and improve Pipewire compatibility.

  • Fixed a bug in the base Audio code that caused it to select the virtual sink even if you had a different on selected in the config.
  • Added functionality to get monitor names and default sink names.
  • The recording code now properly uses the monitor of the provided/selected sink.
  • Records the default sink as the sink to restore after streaming instead of the last sink encountered in the list.
  • Reliably switches the recorded sink to be the default
  • Updated example config to be clear to provide the SINK name to monitor.

I have tested the following scenarios to work correctly under Pipewire. Additional testing under pulse would be ideal. The code should have no effect on non-Linux platforms.

No configured sink, play audio on host.

  • Stays on on default audio sink
  • Host audio works
  • Device Audio works

No configured sink, do not play on host audio.

  • Switched to virtual sink.
  • No host audio,
  • Device plays audio
  • Audio sink reset to previous sink on disconnect.

Configured sink

  • Switches to provided sink.
  • Audible on device
  • Audible on sink

I will try to setup a pulse VM or switch my packages around to test pure pulse later this week if no one beats me to it!

Issues Fixed or Closed

Type of Change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the documentation blocks for new or existing components

@Logical-sh
Copy link
Contributor Author

I also removed the block in the README about it picking up the mic, as that was happening due to behavior of "@DEFAULT_MONITOR@" which should no longer be an issue. The new code will always try to get a proper monitor device of a sink instead of possibly picking up a random source.

@HomerSp
Copy link
Contributor

HomerSp commented Apr 12, 2022

This basically mirrors what I have locally (I haven't created a PR yet since I was still trying to solve a few issues) - and it seems to work fine on both pipewire and pulseaudio.

@Logical-sh
Copy link
Contributor Author

This basically mirrors what I have locally (I haven't created a PR yet since I was still trying to solve a few issues) - and it seems to work fine on both pipewire and pulseaudio.

Thanks for the test @HomerSp!

@KuleRucket
Copy link
Contributor

KuleRucket commented Apr 29, 2022

Is this PR likely to fix #46? I'll try it.

EDIT: And the answer is: yes it does. I can now use pipewire-pulse in Arch

@Logical-sh
Copy link
Contributor Author

Logical-sh commented Apr 29, 2022 via email

@ReenigneArcher
Copy link
Member

@Logical-sh If you fix the 2 conflicts, I will merge this. We want those files how they exist on the nightly branch.

Documentation is now done mostly in the docs folder using sphinx and rst (reStructuredText). You can see the result here: https://sunshinestream.readthedocs.io/en/nightly/

@Logical-sh
Copy link
Contributor Author

Sure thing! I'll get to that today.

@Logical-sh Logical-sh force-pushed the pipewire-compatibility branch from 05fc9e3 to 63a83cd Compare April 29, 2022 16:27
@Logical-sh
Copy link
Contributor Author

Re-based dropping the conflicting commits!

@ReenigneArcher ReenigneArcher merged commit b0df4ea into LizardByte:nightly Apr 29, 2022
@kyriacos
Copy link

Just tried the nightly branch and no audio still

[2022:05:10:08:36:49]: Error: Couldn't connect to pulseaudio: Access denied
[2022:05:10:08:36:49]: Warning: There will be no audio

Is there anything else i can try? I'm on Arch with an Nvidia 1070 gpu.

Linux apollo-desktop 5.17.5-arch1-1 #1 SMP PREEMPT Wed, 27 Apr 2022 20:56:11 +0000 x86_64 GNU/Linux

Thanks!

@Logical-sh
Copy link
Contributor Author

Just tried the nightly branch and no audio still

[2022:05:10:08:36:49]: Error: Couldn't connect to pulseaudio: Access denied
[2022:05:10:08:36:49]: Warning: There will be no audio

Is there anything else i can try? I'm on Arch with an Nvidia 1070 gpu.

Linux apollo-desktop 5.17.5-arch1-1 #1 SMP PREEMPT Wed, 27 Apr 2022 20:56:11 +0000 x86_64 GNU/Linux

Thanks!

This looks like a totally different issue.
This change doesn't touch the connection logic.
Maybe open a separate issue with details of your setup and we could take a look!
@kyriacos

@kyriacos
Copy link

Thank will do. Now that i know it doesn't fix this - at least i know it's something else. I'll debug a bit more then and post an issue with more details hopefully.

@Logical-sh
Copy link
Contributor Author

My immediate guesses would be running the service as a different user or sudoing it, or running it in something like flatpack with the permissions wrong.

Nonary pushed a commit to Nonary/vibeshine that referenced this pull request Oct 3, 2025
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.

5 participants