Better errors in PulseAudio backend#801
Better errors in PulseAudio backend#801roderickvd merged 10 commits intolibrespot-org:devfrom JasonLG1979:fix_pulseaudio_backend
Conversation
|
@roderickvd In future PR's I can do about the same and have |
As a a quick win, yes, because it's an improvement over what it is, and For future work, I would prefer that For some API's this is a two-in-one operation, but when it can be split, it's better that way because in the meantime we can allow other players to take over (e.g. in Volumio and moOde where |
* Use F32 if a user requests F64 (F64 is not supported by PulseAudio) * Move all code that can fail to `start` where errors can be returned to prevent a panic! * Remove unneeded unwraps.
* Move the pulse::Sample::Format logic down to start. * More idiomatic Rust. * More meaningful error messages. * Use drain in stop to drain the buffer in stop.
|
Oops. I forgot about the change log in my CI PR,lol!!! |
|
Weird. It shouldn't trigger the CI since it's a **.md? |
|
I think that covers your code reviews? |
|
Yes I think so. Pending discussion on the amount and detail of the error types over at #808. |
What's to discuss? |
|
Why did you close this PR? I did not say "no" only that I also saw a couple of different error types, of which I was wondering whether they shouldn't be merged to more generic ones. |
Sorry wrong PR I meant to close the Alsa PR. I'm not a fan of generic errors. There aren't that many in this PR. I want for myself and other's to know exactly where the errors are being triggered in the code base. Generic errors are useless. We might as well just not have errors and just wrap the binding's error strings unchanged in a |
|
I can see both sides. What do others think? |
|
Ok, I closed #808. Are there any specific changes you'd like me to make to get this merged? |
|
Since no one else has chimed in, I can only give my opinion on both this one and #808:
|
I can do that. |
|
For PulseAudio |
|
There. When/if you merge this and maybe #811 I will put in a new PR to bring parity as much as possible to |
|
@roderickvd I did what you asked. I think this is done? |
roderickvd
left a comment
There was a problem hiding this comment.
Sorry, I was occupied over the weekend. Final points here.
* More meaningful error messages * Use F32 if a user requests F64 (F64 is not supported by PulseAudio) * Move all code that can fail to `start` where errors can be returned to prevent panics * Use drain in `stop`
startwhere errors can be returned to prevent a panic!Combined with the ability to gracefully exit on error player in #797 this should about do it for for the whole "never panic!" idea as far as the PulseAudio backend is concerned.