r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.

  • Home
  • About
  • Old Site
  • Search
  • Email

How To: Fix Wireless Connection Drops on the Intel 4965 Chipset in Jaunty 9.04

r3dux | April 29, 2009

There’s a problem with the iwlagn wireless driver that ships with Jaunty by default, and you’ll find that when wireless connectivity drops you’ll have errors like these in your dmesg log:

[126774.231915] iwlagn: Microcode SW error detected. Restarting 0×2000000.
[126774.252811] iwlagn: MAC is in deep sleep!

Now, you can reset the connection easily enough with sudo ifdown wlan0 && sudo ifup wlan0, but thankfully the fix is already in the updated version of the iwglan driver in backports, so just go:

sudo apt-get install linux-backports-modules-jaunty

A swift reboot later and wireless ain’t gonna drop out on you any time soon – hurrah!

Comments
2 Comments »
Categories
How-To, Linux
Tags
backports, iwlagn, Wireless
Comments rss Comments rss
Trackback Trackback

How To: Fix Stuttering Sound in 9.04 Jaunty Jackalope

r3dux | April 24, 2009

Just upgraded my 8.10 Intrepid Ibex Ubuntu distro to 9.04 Jaunty Jackalope, and bar a slight keyboard configuration issue (paraphrased as: “current layout not found – will leave keyboard config alone”) and having to take a close look at my GRUB menu.lst before deciding to take the package maintainers version (new ver includes updated entries of your current ver – but backup your current menu.lst just in case!) everything went fine. In fact, 9.04 feels more fluid & responsive in some aspects, so all good so far.

The only problem I’ve noticed (and fixed) so far is that using my external Creative soundcard, and likely the Intel onboard card, sound stutters a bit. This is due to ALSA’s “glitch-free” (I kid you not) drivers, having, er, glitches when used through PulseAudio. I guess you could remove PulseAudio, if you really wanted to, but there’s a simple one line fix – just edit the file /etc/pulse/default.pa and add following line:

load-module module-hal-detect tsched=0

Then, either restart PulseAudio with /etc/init.d/pulseaudio restart or reboot – and job done – no more glitching sound.

A quick gnome-based sound test is to run the Sound application in System | Preferences (i.e. gnome-sound-properties) and just click the [Test] button on Sound Events | Sound Playback.

From some further reading, it seems tsched=0 is a kludgy workaround that can cause higher CPU usage for sound playback, and the real problem lies with the Ubuntu kernel being high latency.. (see Ubuntu Forum link below, post #43 onwards). I think I’d rather higher CPU usage than the sound breaking up on me, and playing some mp3s in VLC (just because the new Amarok’s still busy scraping together collection details from the NAS :) ) takes 2% of a single core on my laptop. When running at the lowest possible speed of 800Mhz.

I don’t think that’s gonna be a problem…

Sources: lglinux, ubuntu forums

Update:
Even with the above fix, sound would sometimes be a pain on an upgraded 9.04 – mute channels you had to unmute in alsamixer, xine and Gstreamer engine config woes, mplayer has sound but vlc doesn’t, or vice versa, or neither have sound but firefox does… I decided to just wipe the entire system (backing up the /home partition first for a file-system change over) and start again clean.

I think the glitches were from upgrading 8.04 to 8.10 to 9.04 and everything being a mish-mash of legacy code and deprecated configs held together with gaffer-tape and bubblegum… It wasn’t pretty. But with a fresh system slapped on EXT4 partitions, I get zero sound issues, the system boots and runs quicker than I’ve ever seen it go, and it only took a little while of checking some boxes in synaptic to get things back to pretty much where I left off. I’d definitely recommend installing 9.04 fresh – nothing else has that minty new-OS zing, or lack of seriously annoying glitches. Final Note: Be aware that if you go for EXT4 as your filesystem you will have to set some options and cross your fingers if you want to resize the partitions using the tools available in Jaunty, and that there can be a problem with delayed allocation and 0-byte files if the box falls over before committing data. If that doesn’t sound like it’s for you, XFS is fast and safe – and knocks EXT3 into a tinfoil-hat.

Update 2:
I somehow managed to get it so Nautilus and Firefox would play sound (through PulseAudio), but VLC or MoviePlayer or anything else wouldn’t… no idea how – perhaps by having the audacity to use my frackn machine? So obviously some programs are using pulseaudio, which seems to work, and others are trying to use ALSA, which isn’t working because pulseaudio is raping it… Anyway, I tried about 5 things to fix the sound – here’s some details:

1.) From the Simple Guide to Sound on Hardy, Intrepid & Jaunty, I ran:

sudo apt-get install asoundconf-gtk alsa-oss libasound2 libasound2-plugins padevchooser gstreamer0.10-pulseaudio ubuntu-restricted-extras

and rebooted. Did this help? No. And most of it was installed already.

2.) I upgraded ALSA to 1.0.19 (while 1.0.18 is the one in official jaunty repos at the mo) using the script here. Did this help? Not immediately. But it won’t have hurt.

3.) I installed vlc-plugin-pulse – and after changing the audio output to Pulseaudio server, VLC would produce stuttery sound, which is a start.

3.) I read a bunch of this stuff: Multiple Sound Solution, some more, and then even more.

4.) I went System | Preferences | Default Sound Card and chose MY SOUND CARD – *not* pulse audio (you can also do this from the command line with: asoundconf set-default-card CARDNAME – to find out which cards are available, run: asoundconf list). I then went to System | Preferences | Sound and changed all my settings away FROM Pulseaudio TO Alsa Mixer for my soundcard (the reason I say my soundcard is that I’ve got an onboard Intel soundcard, and an external USB Creative one I prefer to use because it has optical input/output) – if you hit the [Test] button with ALSA used for playback and it doesn’t play, that’s your glitch.

5.) ALSA decided it would play, I changed VLC back to ALSA output from Tools | Preferences | Audio – and *bang* – no more suck-ass, stuttery, crackly pulseaudio sound. Pure clean audio from all applications.

I wish I could be more specific about exactly what fixed it for me when I was having no sound – but I genuinely don’t know exactly what combination of steps fixed things. One minute ALSA mixer wouldn’t play, the next it would – it’s some kind of pulseaudio/alsa conflict, and using ALSA gives me the best sound, when Pulseaudio doesn’t hijack it… There are steps to remove pulseaudio, and at the present time, as much as I like the goal of it it’s not doing the job, so the next conflict I get I’m going to go the full hog and purge.

As a last resort if you have no sound make sure none of your mixers are muted by running alsamixer -c 0 for your first soundcard, alsamixer -c 1 for your second etc.. and make sure none of the playback mixers have MM (i.e. Muted) on them at the bottom, pressing ‘M’ on them will unmute and change it to the bizarely named ’00′ – to do this from a nicer GUI, just install gnome-alsamixer.

Last Chance Saloon Update:
If you’ve got sound in some things but not all, check your gstreamer-properties (by typing that very thing at the console) and make sure you’ve got your audiosinks right. gstreamer-properties is just a front-end for the gstreamer part of gconf-editor btw. I’ve discussed it a bit here.

Last LAST Chance Saloon Update on 16/02/2010: If you’re sure it’s pulseaudio which is messing your application up, launch it without going through pulseaudio via pasuspender NAME-OF-YOUR-APPLICATION. I came up against this when trying to fix ScummVM sound the other day under Karmic 9.10.

Good luck!

Comments
7 Comments »
Categories
How-To, Linux
Tags
9.04, ALSA, Glitch, gstreamer, Jackalope, Jaunty, PulseAudio, Stutter, Ubuntu
Comments rss Comments rss
Trackback Trackback

Crystal Castles – Untrust Us

r3dux | April 22, 2009

Stumbled across this track in my collection the other day and it’s been kinda going round in my head the last few days…

Crystal Castles (not to be confused with the game of the same name which I vaguely remember playing on my Spectrum as a child), make “ferocious, asphyxiating sheets of warped two-dimensional Gameboy glitches and bruising drum bombast [which] pierce [the] skull with sheer shrill force, burrowing deep into the brain like a fever” – so now we know..


crystalcastlesalbumcover

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Kinda sounds like an electronic version of Native American chants to me. Whatever it is – I like it, and thought that maybe you would too…

Comments
No Comments »
Categories
Music
Tags
Crystal Castles, Untrust Us
Comments rss Comments rss
Trackback Trackback

How To: Compress a Directory of Files into Individual Archives

r3dux | April 16, 2009

I’ve got a stack of files all thrown together in the same directory, and I wanted them compressed – simple enough, eh? Only thing is I wanted each file compressed to its own archive, so I can see at a glance what’s there, and if for some reason an archive gets corrupted, it’s just one file lost and I can replace it instead of having to dick around repairing corrupted “blob” archives that contain the entire bunch of files. And I want to be able to specify all files with a given file extension to compress.

Although I wouldn’t be surprised if you could do this in 4 lines of Perl, I don’t know flippin’ Perl (yet), so I wrote a bash script to do the job.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#
# Purpose: Script to compress all files of given extension to individual archives using 7z
# Usage  : zipeach.sh <extension-without-prefix-dot> i.e zipeach.sh n64
# Author : r3dux
# Date   : 16/04/2009
#
#!/bin/bash
 
count=0           # File counter
got7z=$(which 7z) # Use "which" to check if there's a copy of 7z on the system
 
# If there's no copy of 7z - we're not going to be doing much compressing... Exit stage left.
if [ "$got7z" = "" ]; then
    echo "No copy of 7z found on system! Try running: sudo apt-get install p7zip-full"
    exit 0
fi
 
# If we have 7z, and have been given a file extension parameter...
if test "$1"; then
 
	# Stop the script from entering an infinite loop should user mistakenly enter 7z as filetype to compress...
 	if [ $1 = "7z" ]; then
 	    echo "Recursion neatly sidestepped - no 7z filetypes ya scurvy seadog! =P"
 	    exit 0
 	fi	 	
 
 	echo "Starting Zipeach..."
 
 	# For each file with the given extension in the current directory...
	for file in ./*.$1; do
 
		# If a file exists with given extension...
		if [ -e "$file" ]; then
 
			# Compress the file with maximum compression (-mx9) and use multiple threads for multiCPU machines (-mmt)
			# NOTE: Remove -mmt flag to run this on a single CPU box...
			7z a -mx9 -mmt "$file".7z "$file"
 
			# Increment our file counter
			let count+=1
		else
			# If no file of required extension has been found then notify user and quit
			echo "No files of extension .$1 found in current directory!"
			exit 0
 
		fi # End of if file exists condition				
 
	done # End of for each file loop
 
	# Exit when all files compressed
	echo # Cheap blank line =P
	echo "Zipeach completed. $count files of extension .$1 found and compressed."
  	exit 0 
 
else
	# No extension parameter given? No worky...
	echo
	echo 'Please run the script with an extension to compress i.e. "zipeach.sh n64" to compress each .n64 file into its own 7z archive.'
	exit 0
fi

Bash, as it turns out, is a fiddly, finicky beast in that you really have to think about what the command-line will see under different circumstances and enclose variables in inverted commas or not in very precise ways (see this article to understand what I mean). All that if / fi stuff too… very odd.

To use the script, copy and paste it into a text file (in my case I’ve called it zipeach.sh), save it, make the file executable using chmod +x zipeach.sh and move it to /usr/bin or something so it’s in your path using sudo mv ./zipeach.sh /usr/bin/ – then run it inside any directory you want to zip files to individual archives by calling it with zipeach nds (for example) to compress all the .nds (Nintendo DS roms) in a folder into individual archives. Or use this link ;)

Anyway, job done – suggestions? improvements? props? death-threats? Let me know below!

Oh, and cheers to James McDonald for his WP-Syntax hack to stop all the embedded code appearing on a single (incredibly long) line!

Comments
12 Comments »
Categories
Coding, How-To, Linux
Tags
7z, Archives, Bash, Compress, Files, Individual, zipeach
Comments rss Comments rss
Trackback Trackback

The Linux File System Explained

r3dux | April 15, 2009

linuxfilesystemstructure

This tasty diagram cribbed from linuxconfig.org, and comes from a nicely informative article located here.

Comments
No Comments »
Categories
Linux
Tags
File System, Structure
Comments rss Comments rss
Trackback Trackback

« Previous Entries

Translate

Categories

Archives

Tags

10.04 360 ActionScript ActionScript 3.0 Adobe Art Ballarat Bash Compiz Controller CS4 CUFDIG302A Effect Fail Film Fire Flash Gaming Hack How-To install Jaunty Josh Joplin Group Linkage Linux Motion mount Music NAS Particle Photoshop Problem PS3 r3dux.org Retro Slides Softmod Sound Systems Ubuntu Video VirtualBox Wii Windows XBox

Gamercard

Prepare for Awesome



“Significantly trying to achieve the insignificant.”

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox