add support for jack audio connection kit#115
Closed
sashahilton00 wants to merge 1 commit intolibrespot-org:masterfrom
Closed
add support for jack audio connection kit#115sashahilton00 wants to merge 1 commit intolibrespot-org:masterfrom
sashahilton00 wants to merge 1 commit intolibrespot-org:masterfrom
Conversation
This is initial support for JACK. It creates ports at startup and keeps it connected while librespot is running. So when librespot playback is stoped it writes silence (zeroes). It uses jack crate (rust-jack) which needs libjack. To compile in jack support use --features jackaudio-backend. And run librespot with --backend jackaudio.
Member
Author
|
Code review requested |
plietar
reviewed
Feb 2, 2018
| use jack::prelude::{AudioOutPort, AudioOutSpec, Client, JackControl, ProcessScope, AsyncClient, client_options, ProcessHandler, Port }; | ||
| use std::sync::mpsc::{sync_channel, SyncSender, Receiver}; | ||
|
|
||
| #[allow(dead_code)] |
Member
Author
There was a problem hiding this comment.
Was wondering the same. I figured it supressed some warnings, but having just compiled it doesn't seem to make a difference.
|
|
||
| fn pcm_to_f32(sample: i16) -> f32 { | ||
| let mut f: f32 = sample as f32 / 32768.0; | ||
| if f > 1.0 { f = 1.0; } |
Contributor
There was a problem hiding this comment.
Given that -32768 <= sample < 32768 these two ifs can never happen.
Merged
Member
Author
|
Changes made, new PR created in #116 as branch here is RO. Continue discussion/review there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR duplicated across from plietar/librespot#260 in response to #93:
This is initial support for JACK. It creates ports at startup and
keeps it connected while librespot is running. So when librespot
playback is stoped it writes silence (zeroes).
It uses jack crate (rust-jack) which needs libjack. To compile in
jack support use --features jackaudio-backend. And run librespot
with --backend jackaudio.