-
Notifications
You must be signed in to change notification settings - Fork 456
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 Jack StreamReader #1241
Add Jack StreamReader #1241
Conversation
Thanks, I had to updated the A general question from my side: I would like to test the PR, but I don't know how to setup a Jack server and how to feed audio into a Jack stream. Can you please provide me a basic a how-to for this? |
Great, thanks for the review! I will address all comments and provide some instructions on how to set up a Jack test environment in the next few days. |
Otherwise clients will bail due to a zero-length PCM format header.
Remove unnecessary member var and rename variables for more clarity.
Jack sometimes outputs a log of messages and AIXLOG is not thread-safe at the moment, so enabling Jack logging leads to quite a few missing log messages or messages with invalid log-level or tag.
Do you have a preferred Linux distribution that you would like to test this on? |
I'm using Linux Mint on my dev machine. |
To test this, you can install Jack and a music player that can output to Jack, for example mpv: sudo apt-get install --no-install-recommends jackd mpv Then start a Jack server with "dummy" backend (we don't need Jack to access the soundcard) and choose a sample rate and buffer size, for example:
Then, in another shell but with the same user, play an audio file via that Jack server: $ mpv --ao=jack <filename> mpv will create a Jack client called "mpv" by default, with a number of output ports according to the number of channels in the soundfile called "out_0", "out_1", ... If you define the SnapCast Jack streams with |
Please find attached the
|
Thanks for the modifications! I can see that they work, but they don't solve my use-case: splitting a 24+ channel Jack output into 24 individual SnapCast streams with exact time sync. Would you be open to more discussion/experimentation and possibly code-changes in other parts of SnapCast to make this possible? The submitted code actually works well in my setup... but it would be interesting to find out why it's breaking at your end. |
With a "normal" and continuous soundfile or music being played via Jack? That's interesting. I saw some hard syncs, but also with the ALSA streamreader and output of Jack audio via the ALSA loopback device. I think the handling of silence in audio streams (with the default |
Just ran again the unpatched version, it actually looks like this, including the FLAC decoder error (don't know where this comes from):
And same setup with patch:
|
Ah, thanks! I only tested with |
This brings it into line with all other StreamReaders.
Merged, thanks! |
Excellent, thanks for reviewing, testing and your feedback! |
This PR adds a Jack StreamReader to SnapCast.
I have successfully tested this with a Jack2 server on Linux and would like to get more testing feedback and possibly a code-review before finalizing this.
doc/configuration.md
contains information on how to use thejack
stream.Please note: I'm more at home with C and haven't got much C++ experience, so I would welcome any pointers about weird code constructs or things that could be expressed more cleanly in C++.