Skip to content
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

[Feature request] Use gstreamer backend #600

Closed
darkdragon-001 opened this issue Feb 19, 2023 · 10 comments · Fixed by #607
Closed

[Feature request] Use gstreamer backend #600

darkdragon-001 opened this issue Feb 19, 2023 · 10 comments · Fixed by #607
Labels
enhancement New feature or request question Further information is requested

Comments

@darkdragon-001
Copy link

Switch to gstreamer backend instead of librespot's low-level backends. This is simpler and supports pipewire out of the box librespot-org/librespot#1121 (comment).

@xou816
Copy link
Owner

xou816 commented Feb 22, 2023

Just a reminder that pipewire has done all the hard work -- I don't have pulseaudio anymore on my system but pipewire replaces it just fine and the pulseaudio backend just works (not an expert, not sure how this works exactly but it seems to)

I am not sure what the benefits of implementing our own gstreamer player would be but sure, it's worth exploring I guess

In the meantime here's a branch with the gstreamer backend piping to pipewire: https://github.com/xou816/spot/tree/600-feature-request-use-gstreamer-backend

I'm curious to have some feedback -- for me the sound is really choppy, but again I'm no expert, I don't know if my install is messed up in some subtle way or if the gstreamer pipeline (! audioconvert dithering=none ! audioresample ! pipewiresink) needs further adjustment.

@xou816 xou816 added enhancement New feature or request question Further information is requested and removed bug Something isn't working labels Feb 22, 2023
@darkdragon-001
Copy link
Author

Thanks! How can I test it?

@xou816 xou816 linked a pull request Feb 24, 2023 that will close this issue
@xou816
Copy link
Owner

xou816 commented Feb 24, 2023

You can get a flatpak build here : https://github.com/xou816/spot/actions/runs/4262734945/jobs/7418592559

@darkdragon-001
Copy link
Author

You can get a flatpak build here : https://github.com/xou816/spot/actions/runs/4262734945/jobs/7418592559

How can I get it from there?

@xou816
Copy link
Owner

xou816 commented Feb 27, 2023

sorry, you'd have to click "summary" from that link, but here this one's more direct : https://github.com/xou816/spot/actions/runs/4262734945 -> a flatpak is at the bottom :)

@darkdragon-001
Copy link
Author

darkdragon-001 commented Feb 28, 2023

The backend fails with the following error for me (Ubuntu 22.10):

Error from Some("/GstPipeline:pipeline0/GstBin:bin0/GstPipeWireSink:pipewiresink0"): Failed to connect (Some("../src/gst/gstpipewiresink.c(836): gst_pipewire_sink_open (): /GstPipeline:pipeline0/GstBin:bin0/GstPipeWireSink:pipewiresink0"))
thread '<unnamed>' panicked at 'unable to set the pipeline to the `Ready` state: StateChangeError', /run/build/spot/cargo/vendor/librespot-playback-0.4.2/src/audio_backend/gstreamer.rs:126:14

@xou816
Copy link
Owner

xou816 commented Feb 28, 2023

my bad, it's probably a permission issue with the flatpak! dont know how to fix it yet, I'll comment back later

EDIT: I think this should do the trick: flatpak run --branch=master --filesystem=xdg-run/pipewire-0 dev.alextren.Spot

@darkdragon-001
Copy link
Author

I will try it. Thanks.

Btw.: I can't test it on my Pinephone with aarch64 as the pipeline is only building x86_64.

@darkdragon-001
Copy link
Author

With your trick it worked :) And both interfaces sound pretty much the same for me. So I think it would be nice to have that option.

@xou816
Copy link
Owner

xou816 commented Mar 1, 2023

Nice thanks for testing! I'll polish the pr a little later then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants