lördag 26 december 2009

Intermission: screen resolution

My laptop has a 13", 1280x800 screen. My main screen at home is a Dell Ultrasharp 2209WA, 22" and 1680x1050. I don't much like to work with dual screens as I always end up clicking outside the screen I'm supposed to be in, windows keep opening in the wrong screen etc. so I just shut of the laptop screen.

Anyway, after the "reform" where xorg.conf was deemed to be user-unfriendly, it is actually harder to manually add a screen resolution. In Gnome's "Display preferences" window, 1680x1050 was not on the list of possible resolutions. After some googling I found this helpful post about how to add a screen resolution manually with xrandr. After step 3, however, I just used the "Display preferences" dialog to choose the newly added resolution, which makes the rest of the steps unnecessary.

The "Display preferences" is apparently a GUI for xrandr. I hope that in the future, it will be able to add modes as well.

By the way, for those who celebrate: merry christmas!

onsdag 23 december 2009

Using a MIDI controller - the Nobels MF-2

I have recently purchased an old MIDI foot controller, a Nobels MF-2 (pictured here). Part 3 of Dave Phillips' "Brief survey" of Linux MIDI applications (from 2004!) directed me towards kmidimon (for monitoring MIDI events) and QMidiRoute (for routing MIDI commands). I still haven't figured out how to hook things up, but the signals from the pedal show up in kmidimon, which is a good sign.

I have yet to read the MF-2 owner's manual (thankfully downloadable from Nobels) and figure out how the pedal itself works. Then I will make an effort to understand this MIDI routing business.

My intention is to control start/stop/overdub in SooperLooper and start/stop active loops in seq24. Any helpful hints are appreciated.

Success with new Jack settings

No wonder there are problems when you are stupid! I was using the obsolete "freebob" driver instead of the newer FFADO "firewire" driver in Jack. Once this was corrected, even Bristol seemed relatively stable. (I'm on Ubuntu Studio (Karmic) using an Edirol FA-66, FYI)

Now I can achieve lower latency, too. With a sample rate of 44.1 kHz and a buffer size of 64 frames/period (latency according to Qjackctl: 4.35 msec) things seem to work well. With a buffer size of 32 (latency: 2.18 msec) Adour disconnects from Jack, and with an even lower setting, my whole system gets very slow. But I've worked with higher latencies than 4.35 msec without being dissatisfied, so this is a win.

At maximum sample rate (192 kHz) I can get down to 4 msec (with 256 frames/period). I can go even lower but then my system gradually gets a bit slow. Somehow Hydrogen doesn't recognize the higher sample rate, or maybe all the samples in the drum kits are recorded with a lower sample rate, because everything gets more high-pitched when Jack is set to a higher rate.

I guess I could tweak the settings more to achieve optimal performance. I don't know what "No memory lock" or "Unlock memory is", and I know even less what the difference between these two is, so I will need to read up on it. Maybe "Periods/buffer" is something to get acquanted with as well. Checking the memory lock boxes has had no apparent effect, though.

Ardour still throws a segmentation fault once in a while, particularly when normalizing a region or when trying to reconnect to Jack once connection was lost (Ardour always dies when I try that at 192 kHz). This is quite annoying, and I hope I can fix it. Hydrogen has also died once for no apparent reason.

In short: I'm back on track. My goal is to have a stable environment for composing, recording and mixing. There are still some things to work out but I'm getting closer!

måndag 21 december 2009

A bunch of problems

Since last time I wrote, I haven't had access to my equipment and I haven't had time for music making. I'm back now and ready to go. Sadly, I've had a fair share of trouble this far:

1. "Ubuntu Studio controls" don't seem to work for me. I need to set the permissions for /dev/raw1394 manually every time I restart.
2. Ardour crashes during normal usage without further explanation.
3. The Bristol version included in Ubuntu Studio isn't compiled with the Jack driver, which is a big mystery to me. After compiling it from source, I can run hook up a midi keyboard to it through Jack. Sadly, it crashes randomly, emitting the most horrendous sound.
4. ZynAddSubFx crashes too.

On top of this, ALSA sound playback fails every half an hour or so - Rhythmbox gives me a weird Gstreamer error ("pad problem") and Spotify (Wine) just stops playing without further notice.

I'm not so enthusiastic about this as I first was... I think I need to find someone who can help me set up a stable audio production environment, this trial-and-error thing is starting to wear me out.


EDIT: After correcting a mistake, everything works better! The enthusiasm is back. See the next post

torsdag 29 oktober 2009

Installing Ubuntu 9.10 (Karmic)

I ended up never installing 9.04 (Jaunty). This time around, I even made my way to a release party (at Gnutiken) to install the latest Ubuntu release. I have to say, it was a painless and quick process and everything seems faster (it might also be because I installed the 64 bit version...).

This time, I installed the regular Ubuntu, instead of Ubuntu Studio. The steps to get things going from here:

1. I installed linux-image-rt (the realtime kernel)
2. I installed some audio software (apt-get install ardour hydrogen gave me most of the necessary stuff like jack and qjackctl).
2. I added my user to the 'audio' group and logged out / logged in.
3. To get access to the firewire device, I did modprobe raw1394 and chmod a+rw /dev/raw1394 (I learned this from my own blog)
4. I set up qjackctl to use the FFADO plugin with a buffer size of 512 and it worked!

I haven't been able to test it much yet, but playback from Ardour seems to work fine enough. Hooray for 9.10!

onsdag 22 juli 2009

Krater - an album-a-day

So, that supposedly useful post I promised you will just have to wait. I will post it some time during the next decade or so...

Irony aside, I have recently recorded an album-a-day. It's called Krater and can be downloaded here. Most of it was done within 12 hours, with a minimal amount of mixing done the next day. I don't really know what to tell you about the music itself, there's some pop music with shaky vocals in Swedish and some instrumental tracks of different genres. I still love the sounds of the Roland TR-808 drum machine.

Stuff used:

Hardware
* Edirol FA-66
* Boss ME-50
* ADK A-51
* Fender Telecaster (thanks Caspar!)
* Peavey Cirrus 4

Software
* Ubuntu Studio (Hardy)
* Ardour
* Hydrogen
* seq24
* ZynAddSubFX
* Qsynth (with Fluid R3 sound font)

Jack crashed a couple of times during recording, but otherwise there were no issues from what I can remember.

What's next then? I still haven't installed Jaunty, but I will do it soon. Apparently there are still problems with the realtime kernel, but there is help!

fredag 27 februari 2009

Plans

Not much has happened since the last time I wrote - I've been busy working, going to shows (most recently the fantastic Anna von Hausswolff and Wildbirds and Peacedrums, both very inspiring) and watching Twin Peaks. I've recorded some bass and vocals for a song, but there is no finished result yet.

I have some plans, though: two solo "albums" or EP:s this spring: one with my "pop" songs, with quite a lot of melodies and guitars, some toy keyboards and some sampling; one with more austere bass-oriented songs that I could perform with only bass and vocals if I wanted. As per usual, the end results will probably differ a lot from what I've planned, but there it is. Also, I will try to establish some routines and schedule time for playing/practicing/recording. Now that I'm not in a band anymore it's hard to find the time to really work with music.

As for my Linux-related plans, I intend to play around some more with the Hydrogen beta, and also make more use of the seq24 sequencer and the Specimen sampler. If I would stumble upon a cheap midi foot controller, I would try putting it to use with SooperLooper or something.

My next post will be a little more subtantial, with a collection of useful links to Linux music related issues.

lördag 7 februari 2009

Full upgrade with Khashayar's PPA

I've finally learned that PPA means "Personal Package Archive". Khashayar has pointed me to his archive: https://launchpad.net/~khashayar/+archive/ppa where he has built a bunch of packages for more recent versions of alsa, jack, libffado, ardour etc. than those in the official Hardy repository. I figured I don't have much to lose so I followed the steps and did a full upgrade.

Everything seems to be working fine. When I switch between applications, the playback stutters a bit, but let's not jump to conclusions... Playback, recording and editing in Ardour works fine. I love the development build of Hydrogen so far (with an improved GUI and where you can mix the sounds from different drum kits into a custom kit). Even the latency problems when monitoring seem to be gone.

Maybe now I can start thinking more about music than about packages and settings. THANKS a lot, Khashayar!

Here's what I recorded in January - it's a little test piece with some drums from Hydrogen and three guitar tracks. Not really ear candy perhaps, but this is the kind of stuff I do. Sometimes.
Download as MP3
Download as OGG

Here's something I recorded just now. Same instruments, a bit of aimless noodling. Just a test.
Download as MP3
Download as OGG

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.