Tuning X video with modeline

October 30, 2009

After setting my monitor up, I found it didn’t exactly match the other devices on my kvm switch. I could get around this by pressing the “Auto Adjust” button on the monitor, but that meant I’d have to adjust again when I switched to a different machine.

Usually, what I do in these cases is to use xvidtune to fine-tune things. Unfortunately, that didn’t work – it would always fail with “Unable to query monitor info” even when I disconnected the kvm switch and went directly into the monitor.

What that meant is that I’d have to hack the modeline manually. I found a good discussion of modelines here.

A modeline has the following format:

name dotclock hsize hsyncstart hsyncend htotal vsize vsyncstart vsyncend vtotal hsyncpol vsyncpol

I needed to move the image on my monitor to the right (I had a black bar on the right hand side, and the left hand side was clipped off). To move the monitor right, I needed to DECREASE hsyncstart and hsyncend by the same amount. (Then I logged out and logged back in to restart X so the new settings were being used.)

Once the screen was more or less centred, I DECREASED htotal to make the display wider. (And then logged out and logged in again….)

After that, the image was still a little further right than I wanted, so I DECREASED hsyncstart and hsyncend again to get the wider display centered again. One more restart of X and things were groovy.

My current modeline is:
Section "Monitor"
Identifier "Configured Monitor"
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
# Modeline "1280x1024_60.00" MHz HSize HTotal HSyncEnd HSyncDelay VSize VSyncStart VSyncEnd VTotal HSyncPol VSyncPol
Modeline "1280x1024_60.00" 109.00 1280 1322 1450 1700 1024 1027 1034 1066 -hsync +vsync
EndSection

Now things are automatically adjusted when I switch from one box to another.

Note: This won’t work if you aren’t currently displaying something in the mode you want to use. Also, keep a copy of your original values in your xorg.conf file just in case things go awry – it’s possible to put all your controls offscreen, which can make things challenging.


Modeline for Samsung LN32A450C

October 25, 2009

When I switched my video card after the capacitors burnt out on the old one, I found I could no longer do 1366×768 video on a Samsung LN32A450C. Most frustrating was the fact that I’d see the video for about four seconds, before the TV decided it didn’t want to display it and showed “Mode not supported”.

Apparently, this is a common problem with Samsung TVs – and cvt was no help.

Luckily, I found this post – so here is the modeline for the Samsung LN32A450C

Modeline "1360x768" 85.500 1360 1440 1552 1792 768 771 777 795 +hsync +vsync

I just had to add that to my Monitor section of /etc/X11/xorg.conf and the autodetection on Ubuntu 9.04 did the rest. This is actually 1360×768, not the specified 1366×768 that Samsung is supposed to support – but I don’t miss the few pixels on either side.


Ubuntu 9.04 setup – fixing the scroll wheel

October 21, 2009

In Ubuntu with a PS/2 mouse, the scroll wheel stops working when you switch away with a KVM switch. I found some good instructions for fixing the problem on 8.04 here.

There are a few minor changes for 9.04. Here are the steps:

  1. Add the following to /etc/modules
    psmouse
    
  2. Create /etc/modprobe.d/psmouse.conf and give it the following contents:
     # Make my mouse work with KVM
     options psmouse proto=imps
    
  3. Finally, reload the mouse module:
     # sudo modprobe -r psmouse
     # sudo modprobe -a psmouse
    

Setting up the Sharp LL-172C-B Monitor on Ubuntu 9.04

October 21, 2009

Here’s the magic to get the video mode set right for the Sharp LL-172C-B monitor (1280×1024) on Ubuntu 9.04:

First, run CVT to get the modeline:

$ cvt 1280 1024

Copy the output from that into the Screen section of /etc/X11/xorg.conf

Section "Monitor"
    Identifier      "Configured Monitor"
    # 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
    Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
EndSection

Restart X and you’re in business.

Update: I found I needed to tune the values a little bit. See the post here for more details.


Stopping the squeaks with soundmodem as ax.25

October 17, 2009

I tried to set up soundmodem as an AX.25 device in order to run xastir on my machine. Unfortunately, Ubuntu by default has a bunch of services installed that prevent this. (Not so much prevent it as try to shove 100k of data through the 1200-baud soundmodem, which kills it and drives you nutty if the audio is turned up.)

Here’s what I did to get around this:

1. Change /etc/samba/smb.conf to include only the eth0 interface.

interface = eth0

2. Go into /etc/cups/cupsd.conf and turn off broadcasting (instructions here):

# Browsing was on.
#Browsing On
Browsing Off
BrowseInterval 0
# end trying to get around sm0 problem

3. Stop the AVAHI daemon by moving /etc/rc5.d/S18avahi-daemon to /etc/rc5.d/K18avahi-daemon and running /etc/rc5.d/K18avahi-daemon stop

Note that on Ubuntu 9.10, avahi has been moved into Upstart. Stop it with

sudo stop avahi-daemon

then edit /etc/init/avahi-daemon.conf and comment out the

#start on (filesystem
#         and started dbus)

and

#respawn