how to separate the click-track?

24 replies [Last post]
Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

hello!

i have Edirol UA-25 soundcard and i want to use it for live-performance - output loops to main output and have metronome click in my headphones.
how can i disable metronome click in main output while still having it in the headphone output?

Seb
Seb's picture
User offline. Last seen 12 hours 6 min ago. Offline
Joined: 2006-04-07
Posts:

that's easily done with qjackctl: just (dis)connect ardour's "click" out (from)to the (un)desired outputs!

seablade
User offline. Last seen 15 hours 16 min ago. Offline
Joined: 2007-01-22
Posts:

Use a seperate bus for your headphone outputs. Route to the appropriate hardware output. And route the click to the same output.

Seablade

christophski
christophski's picture
User offline. Last seen 6 hours 30 min ago. Offline
Joined: 2009-04-22
Posts:

I also have an Edirol UA-25. It seems to me that the headphone output is the same as the main output, so I don't think it is possible to do this.
It could possibly be done by having two sound cards, but you will have to look into that because I don't know.

seablade
User offline. Last seen 15 hours 16 min ago. Offline
Joined: 2007-01-22
Posts:

I assumed that you COULD route to the outputs individually, if you cannot as the post above says, then this cannot be done with this interface in stereo. You could however route the loops to the Left side of the main outputs, and the click to the Right side, and only give the Left to the PA. Would result in that case with click in one ear and loops in the other unless you wired up an adaptor for your headphones.

Seablade

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

ok, thank You for the advices!
christophski, seems like You are right - the UA-25 sound card does not separate the output for headphones and main output.
actually, i could use UA-25 for loop output and built-in soundcard for metronome output.
in alsamixer, when i press F2, it shows that there are 2 soundcards: 0 - HDA-Intel [the built-in] and 1 - USB-Audio [UA-25]
can You share some knowledge, how can i make Ardour to work with 2 soundcards?
Seablade, i suppose that Your first post contains the answer to this question. please accept my apologies, but i do not understand, how do You mean that, because of my complete beginner status in Ardour and Linux as well.

seablade
User offline. Last seen 15 hours 16 min ago. Offline
Joined: 2007-01-22
Posts:

Simple answer, Jack doesn't like working with more than one soundcard sorry. If you wanted to run a metronome ALSA app separately from jack that is a possibility.

My first post was made assuming that the main outs and headphone outs could be controlled separately by your hardware, which according to your post and one above, this is not the case. As such your best bet is my second post.

Seablade

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

thanks!
yes, after some search and reading about my soundcard, unfortunately it turned out, that main output and headphone output are not controlled separately.
i have done some search in the web and there are instructions, how to set up ALSA with several sound cards. i do not know for sure, if i have done it right, but both sound cards are working - VLC player uses built-in sound card, Ardour uses USB sound card.
i do not have that much understanding, how this sound creation process is organized in Linux - how exactly ALSA, Jack and Ardour (or any other software) interacts each with other and what exactly are the tasks for each element, so i have a question - is there any other alternative besides Jack, that i can use so that Ardour uses both sound cards? or is it the situation that Ardour is not created to use several sound cards?
my goal is to be able to play loops in perfect synchronisation with metronome, that i need in my headphones. i think, that the best way to do it, is having one application (e.g. Ardour) that plays them both. are there any other ways, options and alternatives to achieve this goal?

paul
paul's picture
User offline. Last seen 1 hour 46 min ago. Offline
Joined: 2006-03-16
Posts:

@viesturs: ALSA is the software that provides (1) low level kernel drivers to interact with the audio interface hardware and (2) a software library to "smooth out" interaction with the drivers.

JACK is layer that provides a simpler (and arguably more powerful) abstraction to applications for routing audio from A to B. Unlike ALSA, which is concerned only with getting audio to/from the audio interface hardware, JACK allows applications to route audio to/from the hardware, other applications, the network ... anywhere, basically. Applications using JACK do not interact with the audio h/w, and there is no difference for them whether their outputs are another app, the audio h/w, the network or some combination of all of these. They just see a uniform, simple programming model where audio flows to/from "ports", and they don't have to care about what these "ports" represent.

Ardour uses JACK. As such it doesn't know anything about your audio h/w. To use multiple soundcards, you'd need to get JACK to use multiple soundcards - Ardour doesn't care. But ... what you want to do is fundamentally misguided. There are a lot of people out there who think that if they need more channels for some reason, the thing to do is to buy another soundcard. Its very hard to get people clear that this just isn't the right thing to do. If you want N channels of audio, you really need an N channel soundcard. Second best backup plan is to have 2 soundcards that can share their sample clock. But using two soundcards without a shared clock is just ... not what you want.

However, JACK does provide a way to do something like this. Newer versions of JACK include two utility applications called alsa_in and alsa_out that will provide audio I/O from/to some soundcard *other* than the one that JACK itself is talking to. So, you can start up JACK using one soundcard. Then start alsa_in and/or alsa_out so that it uses the other soundcard (it will do all the nasty work of trying to keep things synchronized). Then start up Ardour and connect things up appropriately. You will have ports available that will correspond to both soundcards this way.

But to repeat: this is a hack - its a very very useful hack (and thanks are due to Torben Hohn for his work on these two applications), but if you actually care about audio and need 4 channels for some reason, go get a 4 channel soundcard and do it right.

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

Paul, You have my sincerest gratitude for the explanation. i have obtained at least general understanding, what is what...

i tried to follow Your suggestion to use alsa_out.
in http://ubuntuforums.org/showthread.php?t=1198297 third post from the top are commands, how to download and compile the programm. it worked for me, and i copied alsa_in and alsa_out from "tools" folder to /bin folder.

and that is all - i do not understand, how to start the alsa_out. i typed "alsa_out -d hw:1" in terminal and i get "alsa_out: command not found". what did i do wrong?

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

actually, seems like i am having trouble with Jack itself. it does not start, i get "could not connect to JACK server as client" error message.
this is what i get in the message screen:

12:59:46.230 Patchbay deactivated.
12:59:46.234 Statistics reset.
12:59:46.255 Startup script...
12:59:46.256 artsshell -q terminate
12:59:46.264 ALSA connection graph change.
sh: artsshell: not found
12:59:46.716 Startup script terminated with exit status=32512.
12:59:46.717 JACK is starting...
12:59:46.718 /usr/bin/jackd -R -dalsa -dhw:0 -r44100 -p1024 -n2
12:59:46.734 JACK was started with PID=7768.
no message buffer overruns
jackd 0.116.1
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
JACK compiled with System V SHM support.
cannot use real-time scheduling (FIFO at priority 10) [for thread -1215494464, from thread -1215494464] (1: Operation not permitted)
cannot create engine
12:59:46.756 JACK was stopped successfully.
12:59:46.756 Post-shutdown script...
12:59:46.757 killall jackd
12:59:46.934 ALSA connection change.
jackd: no process found
12:59:47.178 Post-shutdown script terminated with exit status=256.
12:59:48.950 Could not connect to JACK server as client. - Overall operation failed. - Unable to connect to server. Please check the messages window for more info.

i am searching the web for a solution, but all the cases i have found have slightly different output in the message screen. still i tried to suspend pulse-audio, but it didn't work, i changed everything to "default" in setup screen.
is there any way i can fix it?

seablade
User offline. Last seen 15 hours 16 min ago. Offline
Joined: 2007-01-22
Posts:

cannot use real-time scheduling (FIFO at priority 10) [for thread -1215494464, from thread -1215494464] (1: Operation not permitted)

You don't have a properly configured machine for realtime permissions for your users. Google /etc/security/limits.conf and linux realtime permissions.

Seablade

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

thank You for a suggestion, the solution for Jack was to uncheck "realtime" in settings and to add myself to "audio" group. i already had changed /etc/security/limits.conf

seems like Jack is working - it starts without errors and Ardour switches from one soundcard to another, if i change output device in Jack settings and restart both programms. so far so good :)

now i have question about alsa_out
i have looked here for instructions, how to use it:
http://trac.jackaudio.org/wiki/WalkThrough/User/AlsaInOut

following to instructions there, entering following command in terminal should start the programm:
alsa_out -d hw:1

what i get is:
alsa_out: command not found

what should i do differently?

paul
paul's picture
User offline. Last seen 1 hour 46 min ago. Offline
Joined: 2006-03-16
Posts:

@viesturs: you don't have a new enough version of JACK.

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

thank You!
from the KPackageKit (i use Kubuntu) - i have latest qjackctl
and when i enter "jackd --version" in terminal, i receive "jackd version 0.116.1"

which is the version i need to get?

paul
paul's picture
User offline. Last seen 1 hour 46 min ago. Offline
Joined: 2006-03-16
Posts:

@viesturs: 0.118.2 would be ideal.

seablade
User offline. Last seen 15 hours 16 min ago. Offline
Joined: 2007-01-22
Posts:

@Viesturs

I REALLY do not recommend you uncheck realtime in QJackCTL. I would much more strongly recommend you fix the other issues preventing you from running with realtime preemption privileges, as otherwise any time you record you will be much more likely to get xruns(dropouts). Chances are by adding yourself to the audio group from your post, you fixed what was preventing you from running with realtime preemption privileges.

Seablade

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

Seablade, thank You for warning, now "realtime" is checked and there are no errors. seems like You are right - the problem was fixed by adding me as user to audio group.
but anyway, i want to play the sound and metronome, not record anything, so i do not feel it to be crucial, but i want to thank You anyway - i shall keep it in mind for situation, if i will have a need to record something.

Paul, i tried to follow Your suggestion and to get the newest Jack version.
http://jackaudio.org/download has the 0.118.0 version available as tar.gz file, which i downloaded and after 3 hours of trials and errors i finally managed to install it - complete removal of previous version was my biggest problem.
0.118.2 version would be ideal, but unfortunately even official Jack homepage does not have it :)

anyway, i still get the error message "alsa_out: command not found" after i have started Jack and then entered "alsa_out -d hw:0" in terminal

where am i making the mistake? what is the required procedure to start the alsa_out program? are there any one-time actions to be taken after installation (like copying some files somewhere, some settings to be changed or anything else)?

paul
paul's picture
User offline. Last seen 1 hour 46 min ago. Offline
Joined: 2006-03-16
Posts:

@viesturs: my guess is that you don't have the required library for resampling that alsa_in and alsa_out requires. That would be libsamplerate, and you would need the development version of this (since you are compiling JACK against it).

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

Paul, i am sorry, but i do not understand, what You mean by "you would need the development version of this (since you are compiling JACK against it)".

i just checked the package manager - i already have installed libsamplerate, and just in case i also installed libasmplerate development files.

do I need to recompile and reinstall the Jack?

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

i found this thread:
http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=1377954

based on instructions in page 2 of this thread, i managed to get alsa_out working.

in Jack, I arranged the connections and now it seems to be working o.k.

i would like to thank Paul and Seablade for Your help, because Your advices gave me some direction, where to look for a solution! i really appreciate that!

last 2 small questions:
1) how can i change the tempo for the click in Ardour? i can see 4/4 and 120 in secondary clock - first is time signature, second is tempo. i have been looking through the menus and clicking on secondary clock, but no luck to find, how to change them.

2) what would be the easiest and fastest way to switch between sessions? i will use my laptop in concerts to play loops of the synths/keys (our synth/key player currently is abroad, so his parts will be played as a track) and also for metronome. due to different tempos in different songs, i believe that each song should be created as session. i could open all the necessary songs before the concert, but then i need to know, how i can switch among them easily.

seablade
User offline. Last seen 15 hours 16 min ago. Offline
Joined: 2007-01-22
Posts:

1) how can i change the tempo for the click in Ardour? i can see 4/4 and 120 in secondary clock - first is time signature, second is tempo. i have been looking through the menus and clicking on secondary clock, but no luck to find, how to change them.

There is a meter and tempo ruler in Ardour, where you set markers and define what you want the meter and tempo to be at any given point. Obviously the default and initial marker is 4/4 and 120 bpm, but you can change the value of both of these and it will affect the click as well.

2) what would be the easiest and fastest way to switch between sessions? i will use my laptop in concerts to play loops of the synths/keys (our synth/key player currently is abroad, so his parts will be played as a track) and also for metronome. due to different tempos in different songs, i believe that each song should be created as session. i could open all the necessary songs before the concert, but then i need to know, how i can switch among them easily.

Well really switching between sessions live is something I would try to avoid, however you can utilize the snapshot feature and the snapshot dialog on the right hand side of the editor window to switch between snapshots easily if oyu must follow this path.

Seablade

Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

Seablade thank You for a suggestion, and i am sorry, but i did not understand.
"There is a meter and tempo ruler in Ardour".
how do I access it? i tried to go to Options -> Tempo -> Set tempo from region and also Set tempo from edit -> Set global tempo. what happened is that tempo changed to 41,55 and when i repeated that - to 166,19. why and how it happened, i do not know.
can You tell me, where is this meter and tempo ruler?

paul
paul's picture
User offline. Last seen 1 hour 46 min ago. Offline
Joined: 2006-03-16
Posts:
Viesturs
User offline. Last seen 4 years 10 weeks ago. Offline
Joined: 2010-02-05
Posts:

thank You, Paul! that was exactly, what i needed! :))) possibility to search online for a Ardour manual did not come into my mind...