Sat, 26 Sep 2009
Splitting albums with cue files
Keywords: split cue flac mp3 linux ubuntu
In order to split a flac file of an entire album into its constituent parts:
$ sudo aptitude install cuetools shntool flac $ shnsplit -o flac -t '%a %n %t' -f *.cue *.flac
You can do something similar with other lossless formats.
To do the same with an mp3 file:
$ sudo aptitude install mp3split $ mp3split -c *.cue *.mp3
Obviously you'll need to be a little more specific if you have more than one album in a directory.
Mon, 09 Mar 2009
Keywords: linux ubuntu 8.10 intrepid ibex ATI Technologies Inc RV370 [Radeon X300SE] X300
And yet another of the things that broke when I upgraded Ubuntu to 8.10 was the 3D graphics acceleration. lspci identifies my card as
01:00.0 VGA compatible controller: ATI Technologies Inc RV370 5B60 [Radeon X300 (PCIE)] 01:00.1 Display controller: ATI Technologies Inc RV370 [Radeon X300SE]
The X log file (/var/log/Xorg.0.log) tells me:
(II) fglrx(0): driver needs X.org 1.4.x.y with x.y >= 99.906 (II) fglrx(0): detected X.org 7.4.2.0 (EE) fglrx(0): atiddxDriScreenInit failed, GPS not been initialized. (WW) fglrx(0): *********************************************** (WW) fglrx(0): * DRI initialization failed! * (WW) fglrx(0): * (maybe driver kernel module missing or bad) * (WW) fglrx(0): * 2D acceleraton available (MMIO) * (WW) fglrx(0): * no 3D acceleration available * (WW) fglrx(0): ********************************************* * $ glxinfo name of display: :0.0 X Error of failed request: BadRequest (invalid request code or no such operation) Major opcode of failed request: 159 (GLX) Minor opcode of failed request: 19 (X_GLXQueryServerString) Serial number of failed request: 10 Current serial number in output stream: 10 $
It seems this was finally fixed this year with Catalyst 9.2. In accordance with the instructions I downloaded the installer from AMD and then installed it:
# apt-get remove --purge xserver-xorg-video-radeon fglrx-kernel-source fglrx-modaliases
# sh ati-driver-installer-9.2-x86.x86_64.run --buildpkg Ubuntu/8.10
# dpkg -i xorg-driver-fglrx_8.582-0ubuntu1_i386.deb \
xorg-driver-fglrx-dev_8.582-0ubuntu1_i386.deb \
fglrx-amdcccle_8.582-0ubuntu1_i386.deb \
fglrx-modaliases_8.582-0ubuntu1_i386.deb \
libamdxvba1_8.582-0ubuntu1_i386.deb \
fglrx-kernel-source_8.582-0ubuntu1_i386.deb
I suppose it's only to be expected that after rebooting X wouldn't start. The X log file told me:
(II) LoadModule: "amdxmm"
(II) Loading /usr/lib/xorg/modules//amdxmm.so
(II) Module amdxmm: vendor="X.Org Foundation"
compiled for 1.4.99.906, module version = 1.0.0
ABI class: X.Org Server Extension, version 1.1
Backtrace:
0: /usr/X11R6/bin/X(xf86SigHandler+0x79) [0x80c3009]
1: [0xb7fde400]
2: /usr/lib/xorg/modules//amdxmm.so(amdxmmInit+0x245) [0xb61a4845]
3: /usr/lib/xorg/modules/drivers//fglrx_drv.so [0xb76a3bdc]
4: /usr/lib/xorg/modules/drivers//fglrx_drv.so(atiddxScreenInit+0x7b4) [0xb7699e94]
5: /usr/X11R6/bin/X(AddScreen+0x19f) [0x807137f]
6: /usr/X11R6/bin/X(InitOutput+0x206) [0x80aa536]
7: /usr/X11R6/bin/X(main+0x279) [0x8071b19]
8: /lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7bdc685]
9: /usr/X11R6/bin/X [0x8071101]
Saw signal 11. Server aborting.
(II) Screen 0 shares mem & io resources
(II) Screen 1 shares mem & io resources
(EE) fglrx(0): === [swlDalHelperSetControllerConfigForRemap] === CWDDC ControllerSetConfig failed: 6 - 0
Wonderful. But easily fixed:
# mv /usr/lib/xorg/modules/amdxmm.so /usr/lib/xorg/modules/amdxmm.so.busted
Presumably, something's not going to work now, but at least it's better than it was, and 3D acceleraton works. I can even watch video.
For some, possibly unrelated, reason at this point the volume control knob on the keyboard stopped controlling the volume until I set the Default Mixer Track in System/Preferences/Sound to HDA Intel (Alsa mixer).
Tue, 06 Jan 2009
To get amarok to use the SPDIF output, first use alsamixer and unmute the IEC958 output.
Then in the Configure Engine section of amarok, use the xine engine, the alsa output plugin, and change the alsa device configuration from:
Mono: default 4 Channels: plug:surround40:0 Stereo: default 6 Channels: plug:surround51:0
to
Mono: plug:spdif 4 Channels: plug:spdif Stereo: plug:spdif 6 Channels: plug:spdif
[/software/amarok] permanent link
Mon, 05 Jan 2009
Getting ssh to work over wireless on HP 2133
Ssh over wireless hangs into and out of the HP 2133. Changing the MTU doesn't help. What does help is running:
iwpriv eth0 set_vlanmode 0
Wed, 03 Dec 2008
Keywords: linux ubuntu 8.10 intrepid ibex sane hp scanjet 5370C avision
Another of the things that broke when I upgraded Ubuntu to 8.10 was the scanning. To be fair, it had barely been working since the upgrade to 8.04, but with 8.10 scanimage just crashed. I debugged it a little and discovered that by uncommenting "option disable-calibration" in /etc/sane.d/avision.conf I could avoid the crash, but after scanning in one direction the scanner wouldn't return to its resting position.
Eventually, I decided that if I was going to fix the crash I'd have to build a debugging version of the code, and that if I was going to do that I should get the latest version available. It turns out that was in a CVS repository and was fairly easy to obtain and build:
cvs -z3 -d:pserver:anonymous@cvs.alioth.debian.org:/cvsroot/sane co sane-backends ./configure --sysconfdir=/etc --prefix=/usr/local/pkg/sane make make install
And BINGO! The crash was fixed, and I didn't had to change any code at all.
I still had the problem, which was also there in 8.04, that the preview in xsane has diagonal stripes. Do I decided to do away with xsane and replace it by a small shell script which I imaginatively named scan:
#!/bin/sh out=$1 shift LD_LIBRARY_PATH=/usr/local/pkg/sane/lib/sane:$LD_LIBRARY_PATH /usr/local/pkg/sane/bin/scanimage -d avision -v -p --resolution=300 "$@" > /tmp/out.pnm convert -quality 90 -verbose /tmp/out.pnm $out gimp $out
So now, when I scan album art, for example, (which is what I most commonly scan nowadays), I can just type scan front.jpg and the cover is scanned and thrown up in gimp for me to crop and save. This has been working well so far.
Tue, 02 Dec 2008
Keywords: linux ubuntu 8.10 intrepid ibex pulseaudio problems solution success multimedia keys volume
I recently upgraded my desktop box from Ubuntu 8.04 (Hardy Heron) to 8.10 (Intrepid Ibex). (I've written down the names so I can look them up when I need to. At least they seem to have settled on some sort of alphabetical system nowadays.)
Anyway, one of the things that broke during the process was sound. And for me it didn't just work, which is bad and wrong. So I searched the web and discovered that 8.10 is now using pulseaudio by default and that I wasn't alone with my sound problem, with many people claiming that pulseaudio just wasn't yet ready for primetime.
So I read up a little on pulseaudio, found out lots of things I didn't really want to know, tweaked all sorts of stuff and eventually got sound out of amarok, but not flash or any of the video players. And not after I had rebooted until I messed with things again. The "solution" involved killing pulseaudio and forcing things to use alsa or oss or something, and it also broke the remaining working multimedia buttons including the volume control, the rest already having been seen off by the upgrade.
Eventually, I really needed to hear something that was on flash, so I searched the web again, and came across a page on the ubuntu forum. I followed it, I set the resample-method to the highest quality, and everything just worked again.
Well, mostly.
Some of the tracks I played caused pulseaudio to crash. So I reduced the resample-method by one notch and things seem OK there so far. I got the volume and mute multimedia keys on my keyboard to work by setting the Default Mixer Track in System/Preferences/Sound to the appropriate "Playback: ALSA" device. I got the rest to work by running the Gnome Multimedia Key's script in the amarok script manager (the author must have been a greengrocer in a previous life).
Of course, the display, the scanner and other stuff were all just as broken as before. But that's another story.
(I'm not sure whether adding the new repositories is strictly necessary - no packages were installed from them - but I can't be bothered to mess with it any more.)
Sun, 23 Nov 2008
I use Gallery to display my photos. I'm mostly happy with it and have developed the following work-flow to help me add pictures with the minimum of fuss.
- Copy the pictures onto my server. I generally do this via scp or an NFS mount.
$ cp -a /media/CAMERA/DCIM /mnt/server/pics/new
- Run my autorotate program to name the files based the date and time the pictures were taken, split them into directories based on the date, and rotate the pictures based on the EXIF orientation information.
$ autorotate /pics/new/**/*(.) # this is zsh syntax
- Then I run nautilus on the created directories (in /pics/new) to look at the pictures and delete the ones I don't want. Using the icon view and setting the icon size to 400% makes it quite usable for this. I can also run my rot script here to rotate any photos that were incorrectly rotated or which came from a camera without orientation information. Finally, I make sure all the photos are in the folders I want them to be in.
- Then I log into gallery and go into my pending directory. Here I upload the directories using Add Items / From Local Server.
- Then I can move the directories to where I want them to live and choose the highlight pictures. Nautilus is also good for this.
- I like the majority of my albums to be arranged chronologically, and for the album to have the date and time of the first photo in it. To easily do this I then run my set_gallery_album_dates program.
$ set_gallery_album_dates
- When I am happy, I check the albums and then set the permissions so that they are viewable. Since this is a right pain I will generally go to the top level album and remove the permissions then add them again making sure the apply changes to sub-items box is ticked. I check this has worked by temporarily setting the display mode (in the bottom right hand corner) to guest.
- Finally, I clean up the old files. I've spent too much time double checking old directories full of pictures against what's in the gallery.
$ rm -r /pics/new/* /pics/sorted/*
- And the very last step, unmount the memory card, put it back in the camera and format it.
[/software/gallery] permanent link
Sat, 22 Nov 2008
Sometimes EXIF date information on pictures can be incorrect, usually because the clock on the camera is set incorrectly. To adjust a set of pictures with incorrect EXIF date information I run a command similar to:
$ exiftime -v+1y -fw *
This will add one year to all the EXIF date tags in all the pictures in the current directory. The modifiers are y, m, w, d, H, M, and S and they can be adjusted forwards with + or backwards with -.
For complete details, see the man page.
[/software/gallery] permanent link
Fri, 21 Nov 2008
To watermark a picture I run a command similar to:
$ composite -gravity Center -quality 90 -dissolve 50 watermark.png pic.jpg pic-w.jpg
[/software/gallery] permanent link
Fri, 18 Jan 2008
I don't often have to set up a new system, but every time I do I completely forget the very useful way that debian and ubuntu can save the set of installed packages and reinstall them later. So here it is for next time:
# dpkg --get-selections > /packages.lst # dpkg --set-selections < /packages.lst