I keep some reminders to myself here about how I configured Debian on my system to overcome certain hardware issues.
My Panasonic TV has a refresh rate of 59.97Hz (1080p) while my LCD monitor is at 60.0Hz. Combining the two screens via Xinerama or TwinView will cause the system to ignore one of the screen Vsync. It would appear that no matter what I tried, I couldn't cause it to ignore the LCD's, it ignored the only one I really cared about.
Solution? Use two X screens (one per monitor).
I couldn't get my 42” Toshiba flat panel display (a 1080i TV) to work at native resolutions, the best I got from auto-detection was 768×512@75Hz. The fix?
Option "UseEdidFreqs" "false"
/var/log/Xorg.0.log showed that it was the nVidia driver causing problems.
mplayer with verbose output over an SSH session showed it was [xv] that was causing the problem. So I disabled extmod in /etc/X11/xorg.conf and the crashes have stopped. The GUI doesn't look quite the same though, for instance windows cannot have transparency anymore.
Alternatively, just don't use any programs that use [xv], use OpenGL output instead (both VLC and mplayer support this). However, this is quite tricky to do in practice, because you find programs that use [xv] by accidentally locking up your GUI…
You can disable [xv] within exmod by adding an “extmod” subsection to your xorg.conf:
Section "Module"
Load "bitmap"
Load "ddc"
SubSection "extmod"
Option "omit XVideo-MotionCompensation"
Option "omit XVideo"
EndSubSection
Load "freetype"
Load "glx"
EndSectionThe mplayer package which comes with Ubuntu 7.10 doesn't seem to support dvdnav: playback. My attempts to compile mplayer from source with dvdnav support have failed, despite having libdvdnav4 and libdvdnav-dev installed correctly and using the mplayer1.0-rc2-with-dvdnav patch. It would appear that the “ogle” package is an alternative media player which supports DVD menus and most special features of DVDs. However it does not have an option to deinterlace the output, and mandates that xv is used to output the video. I am also unable to truly fullscreen it under Ubuntu 7.10's compiz-fusion installation (I get my deskopt menu bars at the top and bottom). Under metacity it doesn't appear to output anything sane, although there is sound. For now I'm sticking to using “mplayer dvd:” to watch DVDs, and just blinding working my way through all the titles on a disc until I get the ones I want. It's a nuisance, but it's not as annoying as interlacing artefacts.
Despite disabling the screen saver, and supposedly telling mplayer to disable the screen saver during playback, my screen kept turning off when I was watching DivX. The solution?
~/.xinitrc
setterm -blank 0 -powersave off -powerdown 0 xset s off
Once I worked out what to do, doing it was easy. It was all the mistakes along the way that made it hard.
# m-a == module-assistant m-a prepare m-a get rt2570 # This is the USB chipset in many dongle, see http://ralink.rapla.net/ m-a build rt2570
This will show some progress, and then quit to a shell with a line something like this:
Done with /usr/src/rt2570-modules-2.6.18-4-686_1.1.0+cvs20060620-3+2.6.18.dfsg.1-12etch2_i386.deb .
This is important, this is where I was missing the point. All this m-a stuff is just to create a package, you still have to install the package it makes for it to work!
dpkg -i rt2570-modules-2.6.18-4-686_1.1.0+cvs20060620-3+2.6.18.dfsg.1-12etch2_i386.deb
Then removing and reinserting the dongle did the trick!
# dmesg usb 7-3: USB disconnect, address 9 usb 7-3: new high speed USB device using ehci_hcd and address 10 usb 7-3: configuration #1 chosen from 1 choice idVendor = 0x148f, idProduct = 0x2570 usbcore: registered new driver rt2570 RT25usb Driver version 1.0.0
This created a couple of new devices, wlan0 and wmaster0. After making sure the wireless-tools package was installed I had to fiddle with my network interface config until it worked:
/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
allow-hotplug eth1
auto eth1
iface eth1 inet static
#iface eth1 inet dhcp
address 10.0.0.1
netmask 255.0.0.0
gateway 10.0.0.1
allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
address 192.168.1.34
netmask 255.255.255.0
gateway 192.168.1.1
wpa-driver wext
wpa-ssid 24
wpa-key_mgmt WPA-PSK
wpa-proto WPA
wpa-pairwise TKIP
wpa-psk "very_secret_passphrase"
All I need to do to activate Wifi (and wpa_supplicant etc) is ”ifup wlan0”.
Update: I decided to abandon WiFi and bought myself some Homeplugs instead. They worked flawlessly and didn't require any kind of tinkering, a rarity with technology.
Explicitly added my harddrives to /etc/smartd.conf:
/dev/sda -a -d sat /dev/sdb -a -d sat /dev/sdc -a -d sat /dev/sdd -a -d sat /dev/sde -a -d sat /dev/sdf -a -d sat
I was trying to setup Linux software-RAID when I discovered one of my new drives was failing! While this was a good test to see how my SATA controller deals with such things1), it was at an inopportune time because I was still building the array, so there was no redundancy in the system yet. On the other hand, I didn't lose any data.
So, in an effort to educate myself and others about all this stuff, I'm going to put up some pretty verbose logs.
First my setup:
| CPU | Intel Core 2 Duo (1.83GHz) |
|---|---|
| OS | GNU/Linux Debian Etch |
| Motherboard | Abit AB9 Pro |
| Disk Controller | Intel ICH8R component of an Intel 965 Chipset |
| Disk Type | All SATA 3.0 Gbit/s |
| Disk Model | 6x SAMSUNG HD321KJ (“Spinpoint T166”) |
I have installed Linux on the first disk (”/dev/sda”) and intended to use the other 5 for in a RAID array (”/dev/sd[b-f]”).
See S.M.A.R.T. for details on how to interpret the raw attributes.
| Disk | Description | Idle Temperature (C) * Notes | |
|---|---|---|---|
| RAIDlogs: SDA | 30 | Non-RAID, has Linux on it | |
| RAIDlogs: SDB | 30 | RAID | |
| RAIDlogs: SDC | 31 | RAID | |
| RAIDlogs: SDD | 32 | RAID | |
| RAIDlogs: SDE | 37 | RAID | failing |
| RAIDlogs: SDF | 38 | RAID | refuses to complete a selftest, though no error reported as yet |
I was probably just being stupid, but it seemed to me that mplayer wouldn't play MP3 sound.
I added the following repository to my apt config and “upgraded” mplayer from that:
/etc/apt/sources.list
# Win32 (non-free) codecs for mplayer etc deb http://www.debian-multimedia.org etch main
I also injected the following into my mplayer configuration:
~/.mplayer/config
# (These settings intended for use under Compiz)
# Specify default video driver (see -vo help for a list).
vo=gl:yuv=2:lscale=2:cscale=2
dr=1 # Enable direct rendering (for codecs that support it)
noslices=1 # Draw entire frames at once
fs=1
ao=pulse
# Use system-managed fonts
fontconfig=1
slang=en # Preferred subtitle language: English
alang=ja,en # Preferred audio languages: Japanese, then English
autosync=30 # The default (0) means that video framerate is dictated by audio
# rate, which doesn't seem to work well when using "-ao
# alsa:device=spdif"
Ubuntu doesn't come with libdvdcss as a package, so you need to install it manually like so:
sudo /usr/share/doc/libdvdread3/install-css.sh
(Taken from https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs)
I have stability issues which I've yet to track down.
Update: Stability issues were due to a BIOS bug, which was provoked by the GUI it would seem.
I used the following guide: How to: Enable compiz-fusion in Ubuntu Fiesty
And here is a snapshot of my config, exported from the CompizConfig Settings Manager: robm_compiz_pref.profile
No sound when using my custom kernel. Had to reinstall using the instructions from here:
cd /usr/src sudo module-assistant update sudo module-assistant prepare sudo module-assistant auto-install alsa sudo shutdown -r now
But that spewed out a lot of errors about cannot find Makefile_32 or compile assembly stuff. This was because my custom-headers were missing these extra Makefile for some reason.
A post in the Debian forum here had the solution:
cd /usr/src/linux-headers-2.6.24-custom1/arch/x86 ln /usr/src/linux-headers-2.6.24-1-common/arch/x86/Makefile_32 Makefile_32 ln /usr/src/linux-headers-2.6.24-1-common/arch/x86/Makefile_32.cpu Makefile_32.cpu cd /usr/src/linux-headers-2.6.24-custom1/include rm asm ln -s asm-x86 asm
Followed by a retry of the original instructions and all worked!
Using the instructions here I was able to get Flash and others to use PulseAudio and therefore share the sound-card properly. No more Flash stealing all audio until I kill Firefox!
Followed HDA-Intel guide at https://help.ubuntu.com/community/HdaIntelSoundHowto, and it worked. Now I use the following with mplayer to get clean AC3 surround sound:
mplayer -ao alsa:device=spdif -ac hwac3 <filename>
Notes:
In order to get applications other than mplayer to output over the digital link, you need to enable a “switch” in the sound mixer (gnome-volume-control in my case) called “IEC958”. Make sure you have it displayed with Edit > Preferences. Alternatively, use `alsamixer` from a shell.
Mplayer configuration file: mplayer.conf
Afer upgrading to Ubuntu Gustsy, my mixer's IEC958 switch no longer seemed to have any affect, although aplay -D spdif <filename> still worked as did mplayer -ao alsa:device=spdif.
I don't know exactly what caused it, but my solution was:
# Use our custom mixed output, below
pcm.!default
{
type plug
slave.pcm "softvol"
}
ctl.!default
{
type hw
card 0
}
# Mix out to SPDIF
pcm.dmixer
{
type dmix
ipc_key 1022
slave
{
pcm "hw:0,1"
}
}
# Offer whatever controls the hardware has (neither add nor remove any
# features)
ctl.dmixer
{
type hw
card 0
device 1
}
# This configure OSS emulation. Send it through the software mixer too.
pcm.dsp
{
type plug
slave.pcm "dmixer"
}
# OK, so at this point of this config file, dmix will work and be routed
# through SPDIF, but you mixer controls will have no effect what-so-ever on the
# volume (aside from being able to display IEC958 Out (== SPDIF)
#
# We'll fix that below by adding another layer of software mixing
pcm.softvol
{
type softvol
slave
{
pcm "dmixer"
}
control
{
name "Master"
card 0
}
}
Also, I found that my sound didn't work until I ran iecset and put my SPDIF-out port into audio mode:
iecset professional off audio on copyright off original off
I got a webcamera from Malaysia which appears to be one of those no-name Chinese models. The box claims it is a PCCamera, the drivers install a program written by BIGDOG and the lsusb command in Linux tell me it is a “Z-Star Microelectronics Corp. ZC0301 WebCam”. I think I'll go with the USB descriptor.
This is supported by the linux drivers developed at http://mxhaard.free.fr/index.html. This is an Ubuntu package called gspca-source. Once the package is installed you create and insert the kernel-module like so:
(Taken from /usr/share/doc/gspca-source) m-a prepare m-a a-i gspca
Using lsmod you can see that it has been inserted:
$ lsmod | grep gspca gspca 608336 0 videodev 29312 2 zc0301,gspca usbcore 138632 10 zc0301,gspca,usblp,xpad,usb_storage,usbhid,libusual,ehci_hcd,uhci_hcd
After a kernel upgrade the webcam stopped working. I saw this in the kernel log:
$ dmesg ... /build/buildd/linux-ubuntu-modules-2.6.24-2.6.24/debian/build/build-generic/media/gspcav1/gspca_core.c: init isoc: usb_submit_urb(0) ret -28 ...
Trying to rebuild with the modula-assistant command failed due to this error:
scripts/Makefile.build:46: *** CFLAGS was changed in "/usr/src/modules/gspca/Makefile". Fix it to use EXTRA_CFLAGS. Stop.
even patching the Makefile didn't help, you get:
/usr/src/modules/gspca/gspca_core.c:2567: error: unknown field ‘hardware’ specified in initialiser
So I downloaded the latest gspca-source tarball and compiled it myself:
$ wget http://mxhaard.free.fr/spca50x/Download/gspcav1-20071224.tar.gz $ tar zxvf gspcav1-20071224.tar.gz $ cd gspcav1-20071224 $ make
I tested this via manual insertion:
$ sudo modprobe videodev # Needed by gspca $ sudo modprobe zc0301 # Driver for my particular camera $ sudo insmod gspca.ko
Inserted without error, but then repeats this dmesg error:
/home/meermanr/Desktop/gspca/gspcav1-20071224/gspca_core.c: [gspca_set_isoc_ep:945] ISO EndPoint found 0x81 AlternateSet 7 /home/meermanr/Desktop/gspca/gspcav1-20071224/gspca_core.c: init isoc: usb_submit_urb(0) ret -28
some forum threads suggest that this error may mean there is a bandwidth problem on the USB hub in use - it was plugged into a hub on my desk, rather than directly into the PC.
Yup, moving it to a new USB port fixed it. Wonder if there was anything wrong with the module to begin with?!