OpenELEC Forum
Looking for a way to integrate jack audio - Printable Version

+- OpenELEC Forum (https://forum.openelec.tv)
+-- Forum: Generic Forum (https://forum.openelec.tv/forumdisplay.php?fid=5)
+--- Forum: MISCELLANEOUS (https://forum.openelec.tv/forumdisplay.php?fid=23)
+--- Thread: Looking for a way to integrate jack audio (/showthread.php?tid=78451)

Pages: 1 2 3 4 5


Looking for a way to integrate jack audio - nicolaberndt - 10-06-2015

Hello openelec-forum. First post so first of all many thanks for all the hard work! Smile

During the last year I developped a raspberry-based streaming device for a commercially available amplifier, this one: http://www.abacus-electronics.de/146-0-Preamp+14.html

At the moment I am working on integration of brutefir for audio-convolution. There are quite some users who wish the device to also integrate kodi. Personally I think, making the device play nice with openelec would be a far better solution for many obvious reasons like the quality of openelec compared to what I could come up with, frequent updates and so on. The problem with that is that the audio-card used on the raspberry (an IQAudio-DAC) has no audio input. If openelec had the jackd audio damon installed, one could use the network-portion of jackd for outputting via a simple alsa jackplug plugin that would reroute the audio-output to go to a jack-capable receiver, in this case, the preamplifier's raspberry module. I use such setup at home with perfect results for years now, doing convolution on all channels.

Who would I have to talk to in order to find out if and how this could be achieved?

With best regards,
Nicola


Looking for a way to integrate jack audio - ultraman - 10-06-2015

All such requests depends on a user number who will use it. If this is very small then to include something like this is not very likely. But some things can be done through addons.
What exactly is needed? Which package (source)? Any special configuration?


Looking for a way to integrate jack audio - nicolaberndt - 10-07-2015

ultraman, thx for looking into this.

It is actually not a big thing. Needed is
jackd
http://www.jackaudio.org/ - the audio server daemon, needs no special configuration upon compilation, opus net IS NOT needed, as I use the builtin netmanager.

libasound_module_pcm_jack.so
wich is used to create an alsa to jack bridge: alsa-plugins: http://www.alsa-project.org/main/index.php/Main_Page

An entry in asoundrc or asound.conf
This one creates 5 Channels. There can be various as there are adressed via their names. It would make sense to have some to chose from. I would use 5 for my own setup, the preamplifier naturely can only offer 2 channels atm and other ppl might like to have 7.1 channels..

Code:
pcm.jacksurround5ch {
type jack
playback_ports {
0 system:playback_1
1 system:playback_2
2 system:playback_3
3 system:playback_4
4 system:playback_5
}

capture_ports {
0 system:capture_1
1 system:capture_2
2 system:capture_3
3 system:capture_4
4 system:capture_5
}
}

Then jackd has to be started like this jackd -d net -P5 -C5
-d net chooses the netmanager as output driver wich then automatically finds it's counterpart in the network.
-P5 creates 5 playback channels (connecting to the remote jack-server)
-C5 creates 5 capture channels seen by xbmc


Looking for a way to integrate jack audio - ultraman - 10-08-2015

Seems I managed to compile jackd and libasound_module_pcm_jack.so.


Looking for a way to integrate jack audio - nicolaberndt - 10-08-2015

Oh, that's great, thx!

How to test that now? If you can somehow send me a system with that included, I can test that here or I give you details on how to do so. Basically you simply have to set up the listening jack server on another machine and see if it transports the audio.. If you want to do so, I'd dig up my scripts and write you how it can be done.


Looking for a way to integrate jack audio - ultraman - 10-08-2015

jackd can be started automatically when system starts.
asound.conf file must be created manually as /storage/.config/asound.conf

What is the point of libasound_module_pcm_jack.so? Where should go?

And with this can Kodi outputs music too?


Looking for a way to integrate jack audio - nicolaberndt - 10-08-2015

We'll have to figure if jackd starts without an asoundconf, but I am rather sure, it will.

The libasound_module_pcm_jack.so is an alsa-plugin that offers any application alsa-ports to play into and then re-routes this input to become a jack-output, wich you can than feed into whatever jack-aware application or a jack-server (jackd). So in my usage-scenario it goes like this:
kodi -> alsa/jack-bridge (libasound_module_pcm_jack.so) -> netjack-sender -> network -> netjack-receiver -> brutefir > soundcard

My libasound_module_pcm_jack.so lives in /usr/lib/alsa-lib
I don't (yet) know openelec enough, but there should be a similar directory. What would make install suggest you?

And, yes, with only that you get full uncompressed 32 Bit Audio over the network, glitchless. Smile

So how can I get my hands onto this for testing?


Looking for a way to integrate jack audio - ultraman - 10-08-2015

nicolaberndt post=149315 Wrote:So how can I get my hands onto this for testing?
I can make you one test image. RPi or RPi2?


Looking for a way to integrate jack audio - nicolaberndt - 10-08-2015

Pi2!

Smile


Looking for a way to integrate jack audio - ultraman - 10-09-2015

https://drive.google.com/folderview?id=0B4FdVu0-fJt6bEpFU255SGtrbms&usp=sharing#list

Everything is in, asound.conf must be renamed only, jackd is started. But Kodi doesn't see any new audio output.