Multimedia players through jack in ubuntu karmic and lucid

Post fully complete "how to" guides and tutorials here. This is a great place to get feedback on stuff you might put in the wiki.

Moderators: khz, MattKingUSA

Pablo
Establlshed Member
Posts: 1182
Joined: Thu Apr 17, 2008 9:57 pm

Multimedia players through jack in ubuntu karmic and lucid

Postby Pablo » Tue Feb 23, 2010 9:22 pm

This thread tries to gather the tricks to jackify some popular media players to have them working with Jack instead of resorting to alsa-jack or pulse-jack plugins, or just using another card.

I am not discovering nothing, just gathering. Thanks to you who posted here and there how to jackify your favourite one and of course and above all, to all the developers involved.

These instructions are tested in ubuntu / ubuntustudio 9.10 and 10.04 although the method will be similar in some cases for other versions / distributions. When the contrary is not said, all the packages are installed from the ubuntu official repos, through synaptic or similar method.

The idea behind this guide is not evaluating players, but rather, say, "if one of these is your favourite one, here you have how to jackify it". I hope the list grows.

In some cases, the player outputs will auto-connect to the system:playbacks, some others we will have to connect them manually in qjackctl or patchage. Some of them will only show their ports while playing and they will disappear when the transport is stopped. Some others are more jack-friendly and their ports will be visible as long as the applications is on. For the first ones there is a trick so we can make connections: Play and pause, the same trick we can use with Audacity.

Audacious

karmic:
Install "audacious-plugins-extra". Launch jack, launch audacious, right click on the top frame, preferences, Audio, select: Jack output plugin.

lucid:
audacious-plugins-extra doesn't exist. the jack plugin is included in audacious-plugins which is an audacious dependency. In short, the jack plugin is there out of the box. Of course, you have to select the jack output plugin as the above instructions

Rhythmbox


karmic and lucid:
Install "gstreamer0.10-plugins-bad"

Run (Alt + F2 o from terminal) 'gconf-editor'. Search .../system/gstreamer/0.10/default/ give the vaule: 'jackaudiosink' to the names: 'audiosink', 'chataudiosink' and 'musicaudiosink'. If we don't want rhythmbox to autoconnect to the system:p'laybacks, write: 'jackaudiosink connect=none'

Alternatively, as Auto points out, simply run "gstreamer-properties". In the Audio tab, Default Output, select the Custom plugin and enter "jackaudiosink" (no quotes) in the Pipeline field.

Exaile

karmic and lucid:
Exaile uses gstreamer too, so do the same as with Rhythmbox. In adition, go to Edit->Preferences->Playback and make sure that "Audio Sink" is jack.

VLC


karmic and lucid:
Install 'vlc-plugin-jack'.

In Tools->Preferences->Audio, choose Jack output.

If we wish that the outs auto-connect to the system playbacks, we edit:

gedit ~/.config/vlc/vlcrc

Search for these lines:

# Automatically connect to writable clients (boolean)
#jack-auto-connect=0
Change the second line to:
jack-auto-connect=1


Mplayer / gmplayer

karmic and lucid:
From the terminal, we can specify the jack output with:

mplayer -ao jack foo

for an audio or video file called "foo"

We can have this permanently by editing:
gedit ~/.mplayer/config

And adding the line:

ao=jack
This way we can use mplayer from CLI, just doing

mplayer foo

karmic:
However, this is not enough for launching mplayer by rightclicking on the file, (at least in gnome, this invokes gmplayer). So we edit:

gedit ~/.mplayer/gui.conf

and replace:
ao_driver = "pulse,alsa,sdl:aalib"
with:
ao_driver = "jack"

(In both files we can also write, "jack, alsa" or "jack, pulse" instead of "jack", so that alsa or pulse is a second option if jack is not active)

lucid: We just need the mplayer-gui package. There is no ~/.mplayer/gui.conf

Aqualung

karmic and lucid:
Nothing to do. If Jack is active it will work with Jack, if not, with pulse or alsa.

Amarok


karmic:
Amarok uses xine audio engine. libxine in ubuntu doesn't include jack support. We can add Motin's PPA for karmic:

https://launchpad.net/~motin/+archive/u ... ed-in-main

Just follow the instructions and add this repository to your list and get the signing key

In synaptic, reload and search and update "libxine1-plugins". This will install some related dependencies.

In amarok, Settings->Configure Amarok-> Playback -> Sound System Configure -> Audio Output -> Music, select Jack Audio Connection Kit and raise it to the top with the "Prefer" push button.

We can do the same for the rest of audio outputs, although I think amarok will only care for the Music one. This way we configure xine for other kinds of output (see kaffeine).

lucid:
Not tested.

Kaffeine

karmic:
It also uses xine. If we chose Jack for the Video output in the amarok configuration (actually, xine configuration) it will just work.

lucid:
Not tested

flashplayer (youtube, vimeo, myspace...)


karmic and lucid:
it could be a deb somewhere, but we also can do:

Install:

build-essential
git-core
autoconf
automake
libtool
libasound2-dev
libjack-dev
libsamplerate0-dev
libssl-dev

Form a terminal:

mkdir src (optional)
cd src (optional)
git clone git://repo.or.cz/libflashsupport-jack.git
cd libflashsupport-jack
sh bootstrap.sh
make
sudo make install

For ubuntu lucid, I needed to do a symbolic link, like this:
sudo ln -s /usr/local/lib/libflashsupport.so /usr/lib/firefox-3.6.3/

For karmic, this might be needed too:
sudo ln -s /usr/local/lib/libflashsupport.so /usr/lib/firefox-3.5.9/

If somethins goes wrong with firefox, while these tweaks:
killall firefox
and, possibly:
killall firefox-bin

And launch it again


Mixxx


karmic:
We need portaudio19 with jack support. If we enable Motin's PPA (see Amarok) we can update "libportaudio2"

In Mixxx, Options->Preferences, "Jack Audio Connection Kit" as Sound API.

lucid:
No extra repo needed as Jack is already included in main! Choose Jack in the preferences as explained above.

Collateral benefits

karmic:
Thanks to this portaudio version we have jack support for Mscore :D


Not achieved:


TOTEM:

karmic:
It uses gstreamer, but strangely for me, the hack to gstreamer that works with rhytmhbox and exaile doesn't work with totem. Any ideas?

lucid:
It works

FIREFOX plugins :

I can't get them working inside firefox. As an alternative, I open multimedia files with /usr/bin/vlc (Preferences). Any ideas?

Any more players? Any comments?

Cheers! pablo
Last edited by Pablo on Fri May 28, 2010 9:12 pm, edited 3 times in total.

User avatar
Capoeira
Establlshed Member
Posts: 1167
Joined: Tue May 12, 2009 1:01 pm
Location: Brazil

Re: Multimedia players through jack in ubuntu karmic

Postby Capoeira » Fri May 28, 2010 2:41 am

always good to have this list

thorgal
Establlshed Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: Multimedia players through jack in ubuntu karmic

Postby thorgal » Fri May 28, 2010 8:57 am

Hola Pablo! nice list :)

For all non studio tools like these multimedia players and others, I've been using ALSA exclusively since I could set up a stable ALSA2Jack bridge (which I described elsewere). Jack can go down, it will not affect apps using ALSA, and vice-versa: ALSA apps can go down, it will not affect jack. I would be a little upset if rhythmbox or mplayer or worse, a youtube video via flashplayer, brought the whole jack graph down :twisted:

the only thing that sucks butt in this list is PortAudio (audacity, and what-not). I believe (and that's my opinion) that all audio apps ported or developed to linux should run a native audio backend (ALSA or Jack). PortAudio just sucks due to the temp. nature of the audio client it creates. The only reason they use it is OS portability. It should be a compile time thing:

if (windows) compile windows audio backend;
else if (linux) compile linux audio backend;
else if (OSX) blabla;

if they can program, they can abstract the app audio backend (into relevant class hierarchies, etc).

User avatar
AutoStatic
Establlshed Member
Posts: 1668
Joined: Wed Dec 09, 2009 5:26 pm
Location: Beverwijk, The Netherlands
Contact:

Re: Multimedia players through jack in ubuntu karmic

Postby AutoStatic » Fri May 28, 2010 10:39 am

I wholeheartedly agree thorgal. I also think your method is the most stable and elegant. Unfortunately the snd-aloop doesn't come with the Ubuntu rt kernels so you'll have to compile it yourself which is a bit of a PITA. So myself I use the alsa-jack plugin (from Motin's PPA) and set up an .asoundrc file accordingly that pipes all alsa output to JACK. And Pablo, it's easier to configure apps that use GStreamer as their backend with the gstreamer-properties app. Just run it from the CLI or make a launcher for it.

thorgal
Establlshed Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: Multimedia players through jack in ubuntu karmic

Postby thorgal » Fri May 28, 2010 11:07 am

I don't think the hack I am using is the most elegant but it is very convenient for straight ALSA playback or capture. But I also like the gstreamer feature that creates a separate jack client for each app. My method is somewhat a "sink" and "source" design a la PulseAudio. And yes, I tried the snd-aloop compilation against kernel headers provided by sidux to help you guys sorting out what could cause the problems. To my great disappointment, it crapped like what you had observed and I can only suspect a kernel packager patch that modified the ALSA version number in some non trivial way. modinfo reports the same kernel version number but what counts here is the ALSA version number hardcoded at compile time in some of the core modules. I don't know, maybe there's a slight version mismatch between the driver module and the other core modules. OK, I am highjacking the thread ... :oops:

Pablo
Establlshed Member
Posts: 1182
Joined: Thu Apr 17, 2008 9:57 pm

Re: Multimedia players through jack in ubuntu karmic and lucid

Postby Pablo » Fri May 28, 2010 9:09 pm

Hi!

I have edited the how-to as there are several changes for lucid.

The snd-aloop trick is a good one, but unfortunately, it is not easy setting this up in ubuntu :(
I find alsa-jack plugin rather buggy. Pulseaudio jack audiosink is another option I haven't tried.
Auto, thanks for your suggestion, I have added it.

On a side note, I noticed that, as jack clients, mplayer behaves better than VLC.

Cheers! Pablo

Dynamata
Posts: 4
Joined: Mon Jun 14, 2010 6:09 am

Re: Multimedia players through jack in ubuntu karmic and lucid

Postby Dynamata » Mon Jun 14, 2010 6:27 am

I followed the instructions in the section: flashplayer (youtube, vimeo, myspace...) & lost audio in all my web browsers - Firefox,Opera,Chrome. How do I fix it? :shock:

thorgal
Establlshed Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: Multimedia players through jack in ubuntu karmic and lucid

Postby thorgal » Mon Jun 14, 2010 7:48 am

hi there,

when you say "I lost all my audio", do you mean when jack is NOT running ? Because the version of this flash plugin lib is only valid when jack is running, it is not meant to support all types of audio layer.
try going back to the source directory, and type:

Code: Select all

sudo make uninstall


hopefully, the devs would have added an "uninstall" option in the Makefile. Otherwise, browse the file called Makefile and try to understand where the compiled library was installed, remove it and restart firefox / opera, etc, that is: if jack is NOT running :)

If you do not plan on having jack running all the time, you will have to find an alternative. There are a few, some easy to implement, some not: pulseaudio, ALSA loopback, OSS - aka /dev/dsp, etc.

If OSS was not obsoleted, it could be the most practical as apps using it just expect to find a /dev/dsp device node and read from and write to. Whether it were created by a real OSS driver, or were an emulation of some kind (ALSA oss or oss2jack), the audio app would not make a difference. But it IS obsolete and is really not recommended.

The viable alternative is pulseaudio, IF you want to use it as your desktop sound system. It can cooperate with jack. The flash plugin support lib can work with pusleaudio.

The real nerdy alternative, which implies that you run jack all the time, is the ALSA loopback trick. But if you have jack running all the time, you may as well continue with the libflashplayer support lib you compiled from git ;)

Yeah, this is the state of linux audio: tons of audio layers, some overlapping, some not, some trying to be the universal linux audio framework, some focussing on pro audio only, etc, etc. A mess :)

If I can give you a piece of advice:
- if your computer is used for music prod, go the jack way, without exception
- if you are talking about an ordinary desktop use, go ALSA or pulseaudio and forget about youtube and such during your occasional jack sessions.

Dynamata
Posts: 4
Joined: Mon Jun 14, 2010 6:09 am

Re: Multimedia players through jack in ubuntu karmic and lucid

Postby Dynamata » Mon Jun 14, 2010 10:33 pm

No Browser audio with or without Jack.

I tried:

t@mythtv:~/src$ sudo make uninstall
make: *** No rule to make target `uninstall'. Stop.

I deleted makefile without success so I deleted the libflashsupport-jack folder, that didn't work so I restored it.

In the Audio tab of the JACK connection box [flash out 1&2] are connected to [system playback 1&2], my Audiophile sound card isn't there (it is, under the ALSA tab). In Patchage flash is also connected to system, except 2 Audiophile boxes are there. I tried drawing lines between [system playback 1&2] & [Audiophile] but they wouldn't stick (green boxes link to green boxes & blue to blue, very technical)

My audio was working fine when this all started, I was following tutorials on JACK & Rosegarden here:

http://www.youtube.com/watch?v=fMz6fDGBnA4
http://www.youtube.com/watch?v=65PjTKt8xFc

& couldn't get any sound from Rosegarden, I wanted to be able to watch the YouTube tutorials while working on JACK/Rosegarden without losing OS audio.

When streaming from the Web, soon as JACK opens the player continues but audio stops. Streaming audio from the hard drive, the player stops.

I posted here:

http://ubuntuforums.org/showthread.php? ... ost9456738

& followed a link to linuxmusicians forum. I originally installed Ubuntu 9.10 in another PC to try mythtv then transferred the HD to my current PC when WinXP screwed up (surprisingly it worked) then later upgraded to 10.04 (took 8 hours!).

I was composing music in WinXP with Overture (notation), Band in a Box & Ableton Live using VST plugins & wanted to try Ubuntu Studio, can I integrate it into Ubuntu or do I have to install from scratch? In the meantime I would like to get my Web audio back. :?
Last edited by Dynamata on Tue Jun 15, 2010 3:01 am, edited 1 time in total.

Pablo
Establlshed Member
Posts: 1182
Joined: Thu Apr 17, 2008 9:57 pm

Re: Multimedia players through jack in ubuntu karmic and lucid

Postby Pablo » Tue Jun 15, 2010 12:50 am

See ubuntustudio forum.

Dynamata
Posts: 4
Joined: Mon Jun 14, 2010 6:09 am

Re: Multimedia players through jack in ubuntu karmic and lucid

Postby Dynamata » Tue Jun 15, 2010 2:35 am

Yeah, I posted to ubuntustudio forum & thought I hadn't got a reply but I have been using Opera & when I read the same post in Firefox, I realised Opera isn't showing the page numbers & the reply was on page 2. :)

Dynamata
Posts: 4
Joined: Mon Jun 14, 2010 6:09 am

Re: Multimedia players through jack in ubuntu karmic and lucid

Postby Dynamata » Tue Jun 15, 2010 7:17 am

Here's the thing, I asked someone to swap the audio out cables from onboard to Audiophile & assumed they'd done it. I tried hw:intel & it worked! the speakers were still plugged into the Motherboard audio, all Browsers now have audio. I spent 3 nights on this, how sick do I feel, like Sherlock Holmes sez "when you have eliminated the impossible, whatever remains, however improbable, must be the truth". Anyway thanks for helping. 8)

thorgal
Establlshed Member
Posts: 739
Joined: Mon Apr 07, 2008 6:04 pm

Re: Multimedia players through jack in ubuntu karmic and lucid

Postby thorgal » Tue Jun 15, 2010 8:05 am

I told my wife not long ago something that I learned from experience. She had a problem with windoze and lost quite some hair on it before calling me for help. After a good laugh, I said:

check the h/w first! s/w second ... now she knows, and so do you as far as I can tell from your post :D

HillView
Posts: 1
Joined: Fri Nov 27, 2015 12:56 pm

Re: Multimedia players through jack in ubuntu karmic and luc

Postby HillView » Fri Nov 27, 2015 9:09 pm

thorgal wrote:hi there,

when you say "I lost all my audio", do you mean when jack is NOT running ? Because the version of this flash plugin lib is only valid when jack is running, it is not meant to support all types of audio layer.
try going back to the source directory, and type:

Code: Select all

sudo make uninstall


hopefully, the devs would have added an "uninstall" option in the Makefile. Otherwise, browse the file called Makefile and try to understand where the compiled library was installed, remove it and restart firefox / opera, etc, that is: if jack is NOT running :)

If you do not plan on having jack running all the time, you will have to find an alternative. There are a few, some easy to implement, some not: pulseaudio, ALSA loopback, OSS - aka /dev/dsp, etc.

If OSS was not obsoleted, it could be the most practical as apps using it just expect to find a /dev/dsp device node and read from and write to. Whether it were created by a real OSS driver, or were an emulation of some kind (ALSA oss or oss2jack), the audio app would not make a difference. But it IS obsolete and is really not recommended.

The viable alternative is pulseaudio, IF you want to use it as your desktop sound system. It can cooperate with jack. The flash plugin support lib can work with pusleaudio.

The real nerdy alternative, which implies that you run jack all the time, is the ALSA loopback trick. But if you have jack running all the time, you may as well continue with the libflashplayer support lib you compiled from git ;)

Yeah, this is the state of linux audio: tons of audio layers, some overlapping, some not, some trying to be the universal linux audio framework, some focussing on pro audio only, etc, etc. A mess :)

If I can give you a piece of advice:
- if your computer is used for music prod, go the jack way, without exception
- if you are talking about an ordinary desktop use, go ALSA or pulseaudio and forget about youtube and such during your occasional jack sessions.


Hopefully, the devs would have added an "uninstall" option in the Makefile. I tried sudo make uninstall but it didn't work.
You can read about my bathmate progress on peblueprint.com

Sharoun
Posts: 1
Joined: Thu Feb 16, 2017 6:14 pm

Re: Multimedia players through jack in ubuntu karmic and lucid

Postby Sharoun » Thu Feb 16, 2017 6:15 pm

Ideally, the devs would have included a "uninstall" choice in the Makefile. I attempted sudo make uninstall yet it didn't work.
You can read about my adele weight loss progress on adeleweightloss.com


Return to “HOW TOs, Tips & Tricks”

Who is online

Users browsing this forum: No registered users and 1 guest