söndag 25 januari 2009

More problems: FFADO and jackd

I'm trying to make the new firewire audio drivers working (ffado instead of freebob, which was the old driver) on Hardy. At first I though I'd be compiling ffado and re-compiling jackd from source, but instead I found that there are .deb packages here! (Before finding these, I checked the dependencies using Synaptic.)

After installing the packages, I fired up qjackctl and chose the driver called "firewire" instead of "freebob" in the setup window. It gave me a familiar error at first, the cause and remedy of which I have already described - only this time it was a more human redable edition.


03646216877: [31mError (ieee1394service.cpp)[ 163] detectNbPorts: Could not get libraw1394 handle.
This usually means:
a) The device-node /dev/raw1394 doesn't exists because you don't have a
(recognized) firewire controller.
b) The modules needed aren't loaded. This is not in the scope of ffado but of
your distribution, so if you have a firewire controller that should be
supported and the modules aren't loaded, file a bug with your distributions
bug tracker.
c) You don't have permissions to access /dev/raw1394. 'ls -l /dev/raw1394'
shows the device-node with its permissions, make sure you belong to the
right group and the group is allowed to access the device.
[0mfirewire ERR: Error creating FFADO streaming device


Progress! So after modprobe raw1394 and chmod a+rw /dev/raw1394, I tried again.

(A more permanent solution to the permissions part might be opening /etc/udev/rules.d/40-permissions.rules and finding the line saying KERNEL=="raw1394", GROUP="XXXX"
where XXXX is the name of the group with permissions to write to raw1394. In the console, do adduser USERNAME XXXX to add your non-root user to this group.)

When I tried again, I got another error, this time without any explanation. I eventually realized I had forgot to plug in my audio interface. Clever! With this done, jack seemed to start, only to stop again, with the following cheerful message:


(...)
libiec61883 warning: iec61883_cmp_create_p2p_output: Failed to set the oPCR[0] plug for node 1.
libiec61883 warning: iec61883_cmp_create_p2p_input: Failed to set the iPCR[0] plug for node 1.
firewire ERR: Could not start streaming threads: -1
DRIVER NT: could not start driver
cannot start driver
starting server engine shutdown
stopping driver


I got a similar problem trying to use the freebob driver.

This will do for now, I need to get some sleep. Any and all suggestions are welcome!

lördag 17 januari 2009

Hydrogen drum kits, audio latency, jack crashing

I've been recording a bit in Ubuntu 8.04 (Hardy) using Ardour and Hydrogen, a splendid drum machine / sequencer. The audio interface is, as I have mentioned, an Edirol FA-66.

Hydrogen drum kits
It's been a while since I last checked the list of Hydrogen drum kits, so I was pleased to see that there are more than the few I knew of. You can find them here:

Officially distributed drumkits
A blog post with a bunch of different kits
Asma Davul, a turkish drum

The blog post above actually links to a drum kit I made called Aqoustic. It was a first attempt, using samples of a friend's drums. Not very high quality. The blogger calls it "another homemade jobby". Urban Dictionary tells me "jobby" is scottish for poo. Fair enough!

Audio latency
I have been using jack in real time mode with a buffer size of 512kb.

One thing I've noticed that's different from when I recorded with a mere SoundBlaster Live card on my desktop computer is that the latency between different programs seems to be gone. When syncinc Ardour and Hydrogen for recording drums, I don't have to trim the resulting audio region, which I needed to do before because of the lag.

When recording from an external source - in this case: electric guitar through a Boss ME-50 - the latency varies. Sometimes I seem to get minimal latency, again with no need to trim the recorded audio. Curiously, when I turn up the monitor mix knob on the FA-66 to hear what I play while I record, there is a noticeable latency.

Jack server crashing
After a while of doing takes on several tracks, the jack server crashed. Not with a bang, but with a whimper. Qjackctl froze and Ardour reported that the connection to jack was lost. When trying to restart it, I got an error message (which I will paste here later). This latter error was resolved by resetting the firewire bus using a program called gscanbus and then starting jack. However, it didn't take long before jack crashed again. I will have to find out what causes this problem. I have yet to try different buffer settings, maybe that will give me something.

I hope it's not a hardware issue. I have decided to buy the FA-66, although I haven't been able to test it first as much as I had hoped to. I have done little recording with Ableton Live in Windows, and I didn't notice any anomalies then. This should mean that my problems in Linux are solvable.

Using firewire audio: raw1394 permissions with jackd

When firing up the Jack Audio Connection Kit (a necessary thing, connecting the audio interface and the software I want to use with each other) using qjackctl, at first I usually get an error (this is in Ubuntu 8.04 - Hardy - with the rt kernel). Sadly, I never copied the error message, but I will reproduce it and paste it here later to give the whole picture.

The error either has to do with a necessary driver (the kernel module raw1394) not being loaded, or with user permissions for the firewire bus, as the non-root user has to get write access. These two issues are easily solved thus:

modprobe raw1394
chmod a+rw /dev/raw1394

The first line loads the kernel module, the second line changes the permissions to the raw1394 device to a+rw (access+read/write, if I am not mistaken). I have tried to make the latter change permanent by making my non-root user the owner of the file with chown [USERNAME] /dev/raw1394, but with no succcess.

Now the jack daemon should have no problems starting.

Miscellaneous stupid problems

These issues are not related to music making, but to general settings on my laptop (a Sony Vaio VGN-SR29VN).

1. Keyboard layout messed up after having used a USB keyboard
When having used a USB keyboard, the automatic num lock setting (in both Ubuntu and the abominable Vista) is ON. Not being aware of this + not being used to a keyboard without a number pad = frustration. Lucky that the solution was so easy - Ctrl+NumLk to switch off num lock.

2. Keymap misbehaving with USB keyboard
After booting up Ubuntu Hardy with an external keyboard, I can't use accents (like é, which is a character in my name, so it's quite important to me). Typing "setxkbmap se" in the console does the trick. But I was already using the Swedish keymap! Maybe this is not a problem in Intrepid, I haven't checked yet.

3. Wireless networking with the Intel WiFi Link 5100 - in Hardy and in Intrepid
I had almost forgot that I had yet to configure the wireless network interface. In my computer, the interface is an Intel WiFi Link 5100, which, as I've learned after googling around, can be used with the iwl3945 kernel module. For those new to fiddling around with kernel modules, I can definitely recommend modconf, the module manager with graphical menus.

Apparently, the iwl3945 module comes with Ubuntu 8.10 (Intrepid), but not with 8.04 (Hardy). So when I want to record music (with the realtime capable kernel) I have to use Hardy, but if I want to be able to use dual screens or my wireless connection I need to use Intrepid if I don't want to hack around too much. Hardly ideal, but hey, at least everything works decently somewhere...

Speaking of wireless connections, I've found that wicd is better than network-manager for managing connections. For instructions on how to install it in Ubuntu, read this! (you'll need to scroll down a little bit.