External audio with USB 1.1 and Gentoo Linux PPC…

In the event that anyone decides to use a junked iBook in a Linux environment, I’m hoping that this article might save someone a lot of experimentation.

The Problem:
Started having trouble getting packet information through Soundmodem after a system upgrade to Kernel version 2.6.36-gentoo-r8. I began to investigate the sound card using Audacity then arecord/aplay to see if audio was even getting through ALSA into the external USB audio interface (snd-usb-audio). The audio was almost unintelligible through the distortion and crackling. After some playing around, I realized that audio recorded through the internal card (snd-powermac) was fine but USB audio was crap. The iBook conveniently has no TRS inputs. Therefore, I’m required to use USB.

The Solution:
I opted to upgrade the kernel from scratch. I disabled the EHCI (USB 2.0) support in the kernel since the iBook has no USB 2.0 support. Secondly (and this is where I think the problem really stemmed from), I enabled both the Big Endian/Little Endian option for the OHCI (USB 1.1) driver after reading about Endianness.

My /etc/modprobe.d/alsa.conf file looks something like this:

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss
alias char-major-116 snd
alias char-major-14 soundcore

options snd cards_limit=1

# ALSA portion
alias snd-card-0 snd-usb-audio
alias sound-slot-0 snd-card-0

# card #1
options snd-usb-audio nrpacks=1 index=0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
alias /dev/dsp snd-usb-oss

Piping hot ball of Tar.

For those who have gotten into the idea of typing commands as little as possible, here’s out to pipe the output from tar straight into a gzip file.

tar cvf - myfile.jpg | gzip > myfile.tar.gz
tar cvf - folder | gzip > folder_backup.tar.gz

Take note of the second example and notice how folder does not contain the trailing forward slash. The forward slash denotes everything inside the folder while leaving it off copies the entire folder itself into the archive. This way causes the extraction process recreate the folder while to former will only extract the files within the folder.

I found the F (-mtime +3)!

forgetting is the bane of my existence. don’t ask why. i’ve forgotten this syntax enough times that i should have it tattooed on my upper arm. in fact, I think i’ve posted it on my own site before and forgotten about that.

find /path/to/files* -mtime +5 -exec rm {} \;

the first argument is, of course, the path to the files that you’re looking to rid yourself. The first flag, -mtime, tells find to look for files older than a certain number of days. the whole “+5” would indicate five days from today (would -5 be five days in the future then? something to look up later). The second flag, -exec, will tell find to execute the following command when it gets a positive result. in this case, we’re “removing” (rm