Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ALSA-plugin JACK
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Sat Jul 20, 2013 8:17 am    Post subject: ALSA-plugin JACK Reply with quote

Hi everyone,

I'm using the ALSA plugin for JACK to connect the non-JACK devices. But, I'm not using always JACK. I just run it sometimes when I want to play instruments. Is there a way of having a condition in the .asoundrc to say: "when JACK is not running, use normal ALSA, when it is, use the jack plugin." not to change the .asoundrc every time I want to swap.

Thanks.
Back to top
View user's profile Send private message
Drasica
Apprentice
Apprentice


Joined: 16 Apr 2006
Posts: 181

PostPosted: Tue Aug 13, 2013 9:01 pm    Post subject: Reply with quote

I'm having a little bit of trouble envisioning your setup. When using JACK do you send to a sound mixer or something? I'm a little confused why you need the to change the .asoundrc file every time, since most apps that have a Jack plugin have something in the menu that lets you change where the audio is destined.
Back to top
View user's profile Send private message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Mon Aug 19, 2013 5:08 pm    Post subject: Reply with quote

Quote:
pcm.!default
{
type plug
slave { pcm "jack" }
}

pcm.jack
{
type jack
playback_ports
{
0 system:playback_3
1 system:playback_4
}
capture_ports
{
0 system:capture_1
1 system:capture_2
}
}


I don't want to use JACK all the time just because I think (not sure, just assumed) JACK is using more resources and my PC is quite slow itself.
Back to top
View user's profile Send private message
Drasica
Apprentice
Apprentice


Joined: 16 Apr 2006
Posts: 181

PostPosted: Mon Aug 19, 2013 5:47 pm    Post subject: Reply with quote

You still didn't tell me much about your setup, so I'm going to assume that you're using the ALSA driver for JACK and sending to an internal sound card. (Another possible option would be using the FFADO drivers and sending it to a firewire mixer or something like that).

To be honest, I don't really understand why the .asoundrc file you posted is necessary. I feel like simply starting JACK with the driver set to ALSA should take care of all of that for you.

If you want a program to sent to JACK, you can toggle things manually in the audio program's menu instead of modifying an .asoundrc file, which is less of a pain IMO. For example, you can go to the settings in Audacious or QSynth and tell it to send to JACK instead of ALSA. Most people just set their key audio applications to default to JACK in the program's menu, and simply don't have audio from more general things (i.e. a web browser) while doing special audio recording/mixing stuff. If you want/need ALL applications to route to jack while jack is running, you could do an alsa loopback, which would capture all things destined for general ALSA and then send it to JACK. I used to do this before I installed Pulse. You could easily create a script to do loopup and loopdown. The downside with this is that all applications you do not manually change to JACK (or cannot) will just show up in the jack list as a single aggregated ALSA I/O.

Using JACK all the time is not really ideal if you have a modern PC, I use JACK to play all my audio through a firewire mixer. It doesn't actually use up many resources, but if the PC is slow there might be a lot of xruns, which will cause a ugly audio artifacts and may necessitate frequent restating of JACK, which is annoying.
Back to top
View user's profile Send private message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Mon Aug 19, 2013 6:57 pm    Post subject: Reply with quote

Quote:
If you want a program to sent to JACK, you can toggle things manually in the audio program's menu instead of modifying an .asoundrc file


There are thousand of programs not supporting JACK.

Quote:
The downside with this is that all applications you do not manually change to JACK


I'd rather having control on single applications.

Quote:
but if the PC is slow there might be a lot of xruns


Which is my case.

Quote:
You still didn't tell me much about your setup, so I'm going to assume that you're using the ALSA driver for JACK and sending to an internal sound card. (Another possible option would be using the FFADO drivers and sending it to a firewire mixer or something like that).


Yes, I'm using ALSA for JACK and all to an internal sound card.
Back to top
View user's profile Send private message
Drasica
Apprentice
Apprentice


Joined: 16 Apr 2006
Posts: 181

PostPosted: Mon Aug 19, 2013 8:20 pm    Post subject: Reply with quote

UnoSD wrote:

There are thousand of programs not supporting JACK.


That is true, but you said you wanted it for instruments. Many applications on Linux with a musical influence have a JACK plugin. All of the midi generators or synths or music players I have used have a JACK plugin (albeit not always well coded).

UnoSD wrote:

I'd rather having control on single applications.


Unless the application has a JACK plugin you can't get single control. That is the whole point of having it plug into JACK. You can either do aggregate loopback control, or have no control at all. Or write your own JACK plugin for the application.
Back to top
View user's profile Send private message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Tue Aug 20, 2013 12:11 pm    Post subject: Reply with quote

I'm using sometimes backing track for the guitar from websites, so it is useful for me to be able to Flash/ALSA -> JACK.

Maybe we misunderstood: I meant, each ALSA application on different JACK input, and my understanding was that the "aggregate loopback" mix all the ALSA into one input, does it?
Back to top
View user's profile Send private message
Drasica
Apprentice
Apprentice


Joined: 16 Apr 2006
Posts: 181

PostPosted: Tue Aug 20, 2013 5:47 pm    Post subject: Reply with quote

UnoSD wrote:
Maybe we misunderstood: I meant, each ALSA application on different JACK input, and my understanding was that the "aggregate loopback" mix all the ALSA into one input, does it?


You understood correctly, it does lump it all in one place. And what I am saying is that unless you code an JACK plugin for every application, an ALSA aggregate loopback is the best you can do. There is no way to get fine grained control over an application unless it supports JACK. There is, unfortunately, no magic work-around to an application not supporting JACK.

UnoSD wrote:
I'm using sometimes backing track for the guitar from websites, so it is useful for me to be able to Flash/ALSA -> JACK.


You can do this with the aggregate still, just remember to not play sounds through any other ALSA apps. Underwhelming, but it is what I do. I think at least one browser does have a JACK plugin (but it is pretty bad iirc). I do not recall if there is tab level control, it believe it just gives you control on the browser level.

PulseAudio might have tab level control, but I have only ever done aggregate Pulse->Jack. I do not know if it is possible to individually send pulse->jack (I don't think so), but it would give you slightly better control since you can do volume/mute/etc. with the Pulse mixer before it's sent to JACK.
Back to top
View user's profile Send private message
UnoSD
Apprentice
Apprentice


Joined: 27 Jun 2011
Posts: 273

PostPosted: Wed Aug 21, 2013 1:16 pm    Post subject: Reply with quote

With my asoundrc configuration through the ALSA-plugin I can have different applications on different JACK ports.

I was trying PulseAudio few years ago and was quite unstable, I might try it now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum