Blog

Hope this helps!

Ubuntu stuff

I've had my share of troubles with my upgrade from ubuntustudio 8.04 to ubuntu 10.4. I ended up doing a clean install, but that wasn't the end of it- here is what I had to do to get things working properly again.

Wrong resolution in xorg.conf

After the install, there was no way in heaven that I could select the native resolution of my monitor (an LG L1930S). Normally I'd have added a modeline to xorg.conf, but xorg.conf was gone- it was made obsolete because now everything was auto-detected, so xorg.conf was no longer needed. Right. Except if the auto-detection does not work. Anyway, here's the xorg.conf file that gave me back 1280x1024 resolution.

Soundcard not detected properly

That is, it was detected- but there was no sound. Everything appeared to work, up to the point where the volume meters showed activity when audio was playing. There just was no sound. And there was nowhere the sound could be made available. I searched and found that more people had this problem, so I followed these instructions:Getting ubuntu 10.4 to play nice with m-audio audiophile 2496

Recording browser audio

PulseAudio is supposedly the State of the Art, and supposedly you want it. Sure, networked audio is pretty sweet. Also, the prospect of finally being able to record audio straight from my browser by routing pulseaudio through Jack appealed to me. This functionality was in fact what convinced me to upgrade to 10.04 LTS. The problem is, however, that once things have booted, pulseaudio has already grabbed the audio device, so JACK no longer can. Additionally, when trying to kill pulseaudio, it respawned. Other than that, there were annoying messages every time I started up QJackCtl that it was suspending pulseaudio- and sure enough, audio halted. I mean, come on people! In the end I wrote up the following: Setting up pulseaudio over jack under ubuntu 10.4 to allow recording browser audio.

Unfortunately, although it's nice to record browser audio and all, this was all still a far cry from the pro audio that I'm aiming for. I finally got fed up with pulseaudio and threw it out- after all, if I'm running JACK anyway, I can route all ALSA audio through that as well (just like I could with PulseAudio) and NetJack would take care of the rest. Actual functionality added by PulseAudio: ZERO. Add the less-than-impressive latencies to that, and you quickly guess where this is going.

Getting rid if PulseAudio

As PulseAudio didn't seem to do anything to get me to my desired pro-audio setup, I finally got fed up with it and got rid of it. Apparently the Lucid people don't believe in choice, because their volume comtrol applet is tied to PulseAudio- so dumping PulseAudio left me without volume control for ALSA - the gnome-volume-control-applet apparently depended on pulseaudio and it didn't work. I found a similar applet in volti but it couldn't handle the independent left/right DAC channels of ICE1712 chipsets. I patched it and sent the mods to the author, who will be releasing them in version 0.2.3.

Ultimate low latency

With PulseAudio finally out of the way, I could continue my quest for low-latency, high-performant audio. I had already installed the 2.6.31-11-rt realtime kernel (getting an extra error during boot-time compared to 2.6.32 generic), and set up my /etc/security/limits.conf for low latency. Lo and behold- the highest scheduling latency I experienced was about 2 msec. I started up JACK and ran with 5 msec latency for a while. ROCK SOLID- or so it seemed- so I made it part of my startup script. I could start browsers, move windows, you name it- all great. However, every time I started a terminal, an extra ALSA port appeared in the JACK connections window under QJackCtl, which weren't cleaned up when killing the terminals. Also, I ran into another strange issue. When I started a terminal, then QJackCtl, and then killed the terminal, sound would start buzzing. Such sound quality would definitely not impress any studio clients. The only thing that fixed it for real was killing JACK and restarting it. Asking around on IRC confirmed this- I wasn't the only person experiencing this problem. "You should not kill JACK clients". Easier said than done- sometimes JACK CLIENTS SIMPLY DIE. But of course, as a techie I could try not to kill them. I could live with that.

Until I chose "Switch user". All processes kept running- Ubuntu restareted the gnome welcome screen, and I there was a constant crackle in the sound from that point on. Once logged back in, it persisted. So people, can we just fix this please? Obviously, as a "regular user" I don't want to worry about all this. It has to Just Work, without buzz, or crackle- and if perchance a client dies, the server has to recover gracefully from that.

Running Ardour

So I ran Ardour. And HD24connect. Connected up 16 audio channels from HD24connect to Ardour, pressed play and had audio. Brilliant! Clicked mute/unmute on channel 1, seemed to work. Opened the mixer window. Clicked mute there a few times. BANG.

"JACK has either been shutdown or it
disconnected Ardour because Ardour
was not fast enough. Try to restart
JACK, reconnect and save the session."
And CPU usage rocketed to 100%. Filed a bug, and was asked to get the latest version. Mind you, not the latest version available in my repository- no, the latest sources. Essentially, I was asked to set up a full build environment for the product, run a compile and try again. All right, I'm a developer too, so I can do that. (Can you imagine any pro software company asking their clients to build their software for them? Didn't think so...)

It cost me well over an hour to get a build together. I ran it, same problem. Meanwhile, the bugtracking system still said "Reproducibility: have not tried". Now listen, I understand perfectly that you've got a lot of users. And as a techie I'm OK with building your software to see if it makes a difference. But if you know in advance that it's gonna cost me an hour to build your software, and you can't be bothered to spend 5 minutes to try and reproduce the problem, then that's a little bit disappointing to say the least. Had I been a "normal" user, would you even have bothered to look at the bug?

Fixing the scroll lock

Hitting the scroll lock does nothing. Not even lighting the LED (which would be a great way to create a keyboard backlight). This can be solved by doing
xmodmap -e 'add mod3 = Scroll_Lock'
To make this permanent for all subsequent sessions add
add mod3 = Scroll_Lock
to your ~/.xmodmaprc file. The first time you login you will be prompted for loading your xmodmap file; check "Do not ask again" and the changes will be permanent (for your user).

Proxies and password changes

Whenever your password changes and you're behind a proxy, you'll need to
change your password in multiple places. While not using an authentication
proxy, you may want to consider updating the following on each password 
update:

- System->Preferences->Network Proxy, Details...
- .bashrc
- /etc/environment
- IM proxy settings
- Reset Mozilla (firefox/thunderbird) proxy settings
- Synaptic

You might also want to add the following stuff to .bashrc:

export no_proxy=`echo $no_proxy|sed -e 's/,$//'`

# Set stuff for wget
echo \# This file is generated by .bashrc. DO NOT EDIT! >.wgetrc
echo proxy_user=$proxy_user >>.wgetrc
echo proxy_passwd=$proxy_passwd >>.wgetrc
echo user-agent=Mozilla/5.0 \(X11\; U\; Linux x86_64\; en-GB\; rv:1.9.2.8\) Gecko/20100723 Ubuntu/10.04 \(lucid\) Firefox/3.6.8 >>.wgetrc

# Set stuff for subversion
cat ~/.subversion/servers |sed -e "s/^http-proxy-username.*$/http-proxy-username=$proxy_user_escaped/;s/^http-proxy-password.*$/http-proxy-password=$proxy_passwd/;s%^http-proxy-exceptions.*$%http-proxy-exceptions=$no_proxy%" >~/.subversion/servers.in
mv ~/.subversion/servers.in ~/.subversion/servers