Page 2 of 3

Re: First track gets recorded into the second one

Posted: Sun Jul 07, 2013 11:27 pm
by luster
I'd try setting the recording device to the mic (usbcodec) but setting the playback to the onboard device.

[Edited to add: of course, mute the loudspeakers and use headphones to listen to the earlier track(s), otherwise the mic will pick up the loudspeakers' output.]

Now, I'd elect to do this ^^^ in JACK. Remember to hit pause first, then record, otherwise you will not see Audacity in JACK area. Once it is set up, I'd unpause and begin recording. But that's just me.



I've had fast and excellent help from the Audacity_team. You might try posting there. I had a recent post somewhere that was quickly responded to by the Audacity_team. I'll try to find it...

I see it. I posted here:

http://forum.audacityteam.org



My post was:

http://forum.audacityteam.org/viewtopic ... 48&t=66867

Re: First track gets recorded into the second one

Posted: Tue Jul 09, 2013 1:06 am
by Nachei
I am not at home right now and won't be able to try your suggestions for a few days, but as soon as I can, I'll report the results here (I'll try to make it by the weekend).

I'm curious... why do you prefer Jack? Does it make any difference in a case like this? In my view it only adds one layer of complexity, but maybe "it's just me", too, only because I started using Audacity without Jack, and spent a long long time without even knowing that such a program existed. Also, I find that Ardour manages it more automatically (logic, after all, because it does not have a non-Jack mode).

Re: First track gets recorded into the second one

Posted: Tue Jul 09, 2013 2:28 am
by luster
I'm curious... why do you prefer Jack? Does it make any difference in a case like this? In my view it only adds one layer of complexity...
You're troubleshooting an issue here. You may need to make several changes in connections before you're done with the troubleshooting. I prefer JACK in a case like this because it's easier, in my opinion, than setting up Audacity to automatically choose something I might change a moment later. It's also visual.

This is how Audacity looks in my JACK connection patchbay (Catia, from KXStudio) initially, after "pause plus record" (so that Audacity appears [as "PortAudio"] in the patchbay):

start_Audacity_systemconnections.png
start_Audacity_systemconnections.png (99.02 KiB) Viewed 1641 times



And this is how Audacity (again, appearing as "PortAudio") looks after I switch the input from "System" to "Yoshimi".

Audacity_connect_Yoshimi.png
Audacity_connect_Yoshimi.png (101.42 KiB) Viewed 1641 times



Basically, I'm having Audacity send its output to "System" (my speakers) so that I can hear my first track as I play (and record) a synthesizer along with it. At the same time, I'm having Audacity take its input from Yoshimi only so that Audacity won't "hear" the first track as it plays (and therefore won't record it onto my new track) while I play along with the first track.

On another track, I might want to hook up and record something else, another synth [edited here because this approach probably won't work].


And be aware that this is a very cumbersome* way of going about making a multi-track recording, but if such a set up worked for you without the bleed-through you are/were experiencing, you'd be on the way to figuring out what to do in Ardour or any other DAW or recording program.



*I often use a setup such as this for practice with instruments, learning covers, composing instrumentation parts, general audio note-taking, and experimenting with new hardware/concepts, etc., I use a setup like this as an audio scratch pad. For making something full-blown/serious, I'd use something else. Maybe. Probably :)

Re: First track gets recorded into the second one

Posted: Tue Jul 09, 2013 8:38 am
by luster
The following actions accomplished what I think you want to do:

Preliminary information:
How can I use multiple soundcards with JACK?

JACK is fundamentally designed to be a component in a pro-audio/music creation environment and standard operating practice for such setups involves using only a single digital sample "clock" (something counting off the time between audio samples). This means that trying to use multiple independent soundcards is problematic, because each soundcard has its own sample clock, running independently from the others. Over time, these different clocks drift out of sync with each other, and cause glitches in the audio. You can't stop this drift, although in some cases the effects may be insignificant enough that some people might not care about them.

Thus in an ideal world you should not use multiple independent soundcards but instead use a single device with a single clock and all the inputs, outputs and other features that you need.

Of course, a lot of people don't live in an ideal world, and believe that software should make up for this. Accordingly, JACK offers several ways for you to use more than 1 device at a time.

1. Use the alsa_in and alsa_out clients (Linux & ALSA only)

If you are using JACK on Linux and want to use additional devices that have ALSA driver support (i.e. most PCI, USB and Bluetooth devices), then this is the best option.

alsa_in and alsa_out are two clients written by Torben Hohn that make a single specified ALSA device appear as a set of JACK ports. They both use Erik de Castro Lopo's libsamplerate library to do any resampling required to keep the audio in sync as the clocks of each device drift over time.

To use them, you start JACK as normal. Then you start an instance of alsa_in or alsa_out for each additional device (and "direction") that you want to use. alsa_out will create a set of ports representing the playback capabilities of the device, and alsa_in will represent the capture/recording capabilities. These two clients must be run inside a terminal window - there is no GUI for either of them. They both take arguments very much like those of the JACK ALSA backend, with some additional controls that affect the way that resampling is done. Full details are available in the man pages for each client, which you can read in a terminal window with the command man alsa_in (this page covers both clients, since their arguments are identical).

Note that you can use these clients even if you are running JACK with a FFADO-supported device. The requirement for ALSA support only applies to the extra devices you want to use, not the one that JACK itself is using.

...
Source: http://jackaudio.org/multiple_devices

First, I recorded a track in Audacity. Next, I used the command:

Code: Select all

$ man alsa_in


to determine the settings to use for making the line-in input of one of my unused audio cards appear in JACK so that I could record from it while listening to my regular system audio card.


Then, I used the command:

Code: Select all

$ arecord -l
to determine the name of the card/input I wanted to record from.


Next, I used KMix mixer to unmute and set the levels on that line-in input of that particular card,

paused/record Audacity and set it to receive its input from that card/input,

while setting the output of Audacity to "System" (speakers) as usual.


Finally, I un-paused Audacity and listened to the first track as I recorded the second track. There was no bleed-through.



The actual command I used was:

Code: Select all

$ alsa_in -j line_in_nvidia -d hw:NVidia,0,1 -v -c 2

(Note: the option -v is useful for testing purposes)


This gave me the following JACK outputs which I connected as shown:
record_and_play_separate_Audacity.png
record_and_play_separate_Audacity.png (51.34 KiB) Viewed 1638 times
It's cumbersome. And there's no doubt a better way to do it. But if you can get this to work without bleed-through, you know that the hardware can work and just need to adapt a similar approach to your specific needs.

Re: First track gets recorded into the second one

Posted: Wed Jul 10, 2013 7:07 pm
by Nachei
Thank you so much for your detailed explanation, which opens a new line of investigation. I did not know about alsa_in and alsa_out, I was afraid I might not have them installed because my distro is pretty minimal (Puppy Studio), but I've checked and do have them, so I've added the new tests to the things to do when I'm back to having my G-Track and some time available. No matter how cumbersome if it finally works!

The possibility of a conflict between devices (inner sound card vs G-Track's inbuilt interface), is something I had investigated a bit too. As my computer is a laptop, it's not easy to take physically the sound card out, so I made a bit of research on blacklisting modules -so that the computer ignored its internal card-. But the tutorials I found in Internet never worked. This alsa_in alsa_out approach seems very promising, I'll write here what comes out of it...

Re: First track gets recorded into the second one

Posted: Mon Jul 15, 2013 5:20 pm
by luster
See this thread:

http://www.linuxmusicians.com/viewtopic ... 27&t=11284

Particularly the post by Pablo, where he says:
Some people recommend zita-ajbridge over alsa_in/out, if you want to check it out. http://apps.linuxaudio.org/apps/all/zita-ajbridge

From http://kokkinizita.linuxaudio.org/linuxaudio/
Zita-ajbridge provides two applications, zita-a2j and zita-j2a. They allow to use an ALSA device as a Jack client, to provide additional capture (a2j) or playback (j2a) channels. Functionally these are equivalent to the alsa_in and alsa_out clients that come with Jack, but they provide much better audio quality. The resampling ratio will typically be stable within 1 PPM and change only very smoothly. Delay will be stable as well even under worst case conditions, e.g. the Jack client running near the end of the cycle

Re: First track gets recorded into the second one

Posted: Tue Jul 16, 2013 3:28 pm
by briandc
audacity's settings have to be set for record latency. As most people probably use a fast computer, the default setting should be changed to 0.
the play-through option has to be selected too, in order to hear the first track as you record the second one.

brian

Re: First track gets recorded into the second one

Posted: Tue Jul 16, 2013 10:37 pm
by luster
Thanks, briandc. Zero probably wouldn't have been too bad.

Using information gained from the latency test suggested at:

http://manual.audacityteam.org/man/Latency_Test

I set the latancy correction in Audacity to -24.69ms to achieve within-one-sample recording time matching. This is at 48kHz sample rate on a dual-core 3GHz machine w/8GB RAM, using a Peavey PV8usb mixer as the master audio device in KXStudio 12.04.1. I used a mic > mic input on the mixer for the latency test.

Without that setting, it was off by about 25ms.

Re: First track gets recorded into the second one

Posted: Wed Jul 17, 2013 10:31 am
by briandc
luster wrote:Thanks, briandc. Zero probably wouldn't have been too bad.

Using information gained from the latency test suggested at:

http://manual.audacityteam.org/man/Latency_Test

I set the latancy correction in Audacity to -24.69ms to achieve within-one-sample recording time matching. This is at 48kHz sample rate on a dual-core 3GHz machine w/8GB RAM, using a Peavey PV8usb mixer as the master audio device in KXStudio 12.04.1. I used a mic > mic input on the mixer for the latency test.

Without that setting, it was off by about 25ms.
No problem! I suppose latency results vary depending on the system and configuration; I'm able to get recoding done without using the adjustment at all. But it's a good feature to have, just in case there's a lag.


brian

Re: First track gets recorded into the second one

Posted: Tue Jul 30, 2013 5:22 pm
by Nachei
Sorry for the delay in answering, I went on vacation to a place with a difficult non-Linux friendly 3G connection and a nephew addicted to Clash of Clans (go figure)...

I finally got to try the alsa in command, and the bleeding persists.

This refutes that the problem could be related to a conflict between devices, so, given that, I haven't tried zita-ajbridge. (In addition, the bleeding is happening also when I record via the computer's mic 3.5 connector, no G-Track in sight. Also, while doing the AB test for alsa in, by mistake once I recorded via the computer's built in mic, and guess what? The undesired track bleeding just the same.)

So my remaining hypothesis is that something is wrong with my inbuilt sound card.

As I mentioned in a previous entry, I was wondering how to blacklist the soundcard's modules so that the computer ignores it, and then doing all the recording and listening via the G-Track. Funnily enough, whenever blacklisting is mentioned at any forum, the question seems to fall instantly into a void of silence, and I would like to know if it is one of those silences of "gosh, that is too complicated to explain", or rather "gosh, that is impossible and proves that he has no idea of what he's talking about, let's be polite and ignore it".
Can anyone give me a hint on this issue? I just need that piece of information to continue my inquiry, if I still can get somebody interested about my sad case after all these days. :)

The other thing that's left for me to do is testing the G-Track in a different computer, when I have access to one. By the moment, in the upcoming days I will try setting up my old Pentium III, useful only for experimentation purposes I guess; maybe it could handle voice recording, but I doubt it could run heavier stuff like Rakarrack...

Btw, thank you also for the bonus info on latency in Audacity. It explains a problem that used to bug me often...

Re: First track gets recorded into the second one

Posted: Wed Jul 31, 2013 4:14 am
by luster
Have you checked all the mixers installed on your system to ensure that all unused inputs are muted?

Re: First track gets recorded into the second one

Posted: Wed Jul 31, 2013 7:42 am
by briandc
I would directly ask the guys at the audacity forum. They answer usually within the same day and are very kind and helpful:

http://forum.audacityteam.org/viewforum ... 56cd34d258

The link above is direct to the linux subforum. I've posted there a few times and they've helped a lot. :)


brian

Re: First track gets recorded into the second one

Posted: Wed Jul 31, 2013 4:47 pm
by Nachei
luster wrote:Have you checked all the mixers installed on your system to ensure that all unused inputs are muted?
Yes, I think I did at some point, but I've tried again anyway just in case. Alsamixer shows two devices:

1) HDA Intel (inbuilt sound card)

I tried setting to 0 (+muting when available) ALL parameters, even Master. The bleeding persists just the same.

2) USB Codec (G-Track)

It only has 1 parameter available, called PCM I think. Whenever I mute it, I cannot listen to the music playing during the recording process; but the bleeding is not modified. Also, I tried to intermittently mute/unmute this Alsa element, and the bleeding in the background is still continuous, no chopping related to my on-off action.

This test of mine assumes that "all the mixers", in your message, refers to all the Alsamixer parameters existing. I also made a stripsearch through the computer's menus, and a find command, in case you meant that there is some other program along the mixing chain, but nothing relevant seems to show. Am I missing something?
briandc wrote:I would directly ask the guys at the audacity forum. They answer usually within the same day and are very kind and helpful
Thank you very much for the direct link. However, the first thing I found there was a red warning saying that Audacity version 1 is no longer supported. I checked and, alas, The Audacities in my different installations are 1.3.9. and 1.3.11-beta (Unicode). Installing a new version of Audacity is a complex task; my both Audacities came bundled with different Puppy Linux distributions. The good part was not having to install anything, but the other side of the coin with Puppy Linux is that, being so lightweight, you usually have a long journey through dependencies hell whenever you want to install something. So I think I'll try exhausting the other simpler options first.

Another thing, regarding blacklisting modules, it is funny to see how my question fell immediately into the 'void of silence' again. Could someone drop a couple of lines on the issue? I don't mean to be bitching, but I wonder why does EVERYBODY keep silence about it. Is it a touchy subject in any way? (As a refresher, my idea was disabling the modules of the inbuilt sound card and use G-Track for everything sound related, in order to detect if the problem stems from that internal sound card being faulty.) Thank you guys.

Re: First track gets recorded into the second one

Posted: Wed Jul 31, 2013 5:00 pm
by briandc
Nachei wrote:
luster wrote:Have you checked all the mixers installed on your system to ensure that all unused inputs are muted?
Yes, I think I did at some point, but I've tried again anyway just in case. Alsamixer shows two devices:

1) HDA Intel (inbuilt sound card)

I tried setting to 0 (+muting when available) ALL parameters, even Master. The bleeding persists just the same.

2) USB Codec (G-Track)

It only has 1 parameter available, called PCM I think. Whenever I mute it, I cannot listen to the music playing during the recording process; but the bleeding is not modified. Also, I tried to intermittently mute/unmute this Alsa element, and the bleeding in the background is still continuous, no chopping related to my on-off action.

This test of mine assumes that "all the mixers", in your message, refers to all the Alsamixer parameters existing. I also made a stripsearch through the computer's menus, and a find command, in case you meant that there is some other program along the mixing chain, but nothing relevant seems to show. Am I missing something?
briandc wrote:I would directly ask the guys at the audacity forum. They answer usually within the same day and are very kind and helpful
Thank you very much for the direct link. However, the first thing I found there was a red warning saying that Audacity version 1 is no longer supported. I checked and, alas, The Audacities in my different installations are 1.3.9. and 1.3.11-beta (Unicode). Installing a new version of Audacity is a complex task; my both Audacities came bundled with different Puppy Linux distributions. The good part was not having to install anything, but the other side of the coin with Puppy Linux is that, being so lightweight, you usually have a long journey through dependencies hell whenever you want to install something. So I think I'll try exhausting the other simpler options first.

Another thing, regarding blacklisting modules, it is funny to see how my question fell immediately into the 'void of silence' again. Could someone drop a couple of lines on the issue? I don't mean to be bitching, but I wonder why does EVERYBODY keep silence about it. Is it a touchy subject in any way? (As a refresher, my idea was disabling the modules of the inbuilt sound card and use G-Track for everything sound related, in order to detect if the problem stems from that internal sound card being faulty.) Thank you guys.
Even though you're using an older version of Audacity, I would ask them anyway. My hunch is that they know what it's all about.

From personal experience, I would also consider two other options, which are even easier: one, install the newer version. Just download the tarball or zip file, open it, read the readme file for dependencies, install the dependencies and then run the install.

The other option might be to install a different distro. On my older computers I use BodhiLinux and antiX. Both of these perform well, very very lightweight. (you can use a CD rather than DVD to make the .iso image, as they are I think about 500MB or less.) Both of these distros have newer versions of Audacity available. In particular, BodhiLinux gives you just the basics, very minimal. Then you use Synaptic and add just the things that you need. It's very quick to do.

Just remember to save your data somewhere else first! ;)

brian

Re: First track gets recorded into the second one

Posted: Thu Aug 08, 2013 2:03 pm
by Nachei
Hey Briandc, I followed your advice and went to the Audacity forum. To tell the truth, I was a bit afraid of being trolled for ignoring the red warning, but the people there have been very friendly. In fact, I'm prudent to say this before I make some groundwork, but I think the problem is solved. Here is the relevant excerpt from their forum:
I've repeated my AB tests and the results are consistent with yesterday's: output sent through G-Track= track recorded with bleeding and chopping, output sent through internal Alsa, track recorded fine. So I guess the problem gets solved like that, if not with the bonus of understanding what is going on...
(Link to the complete thread: http://forum.audacityteam.org/viewtopic ... 48&t=73853 )

For some reason, if the playback is sent through the G-Track, there is bleeding, but if you send it via the computer, the track gets recorded fine (maybe something wrong with my G-Track's internal mixer?). So, after months of frustration, it seems at last I have a configuration with which I can make music without littering myself every step of the way! Hooray!

I'lll add the 'solved' in this thread title in a few days, after I have done some recording. Thank you all guys for your help and your patience. Hope I can be of assistance to you some day too. :D