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

add support for jack audio connection kit #115

Closed
wants to merge 1 commit into from

Conversation

sashahilton00
Copy link
Member

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.

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.
@sashahilton00
Copy link
Member Author

Code review requested

use jack::prelude::{AudioOutPort, AudioOutSpec, Client, JackControl, ProcessScope, AsyncClient, client_options, ProcessHandler, Port };
use std::sync::mpsc::{sync_channel, SyncSender, Receiver};

#[allow(dead_code)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Member Author

@sashahilton00 sashahilton00 Feb 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that -32768 <= sample < 32768 these two ifs can never happen.

@sashahilton00 sashahilton00 mentioned this pull request Feb 2, 2018
@sashahilton00
Copy link
Member Author

Changes made, new PR created in #116 as branch here is RO. Continue discussion/review there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants