Saturday, September 27, 2008

zenwalk 5.2 in Toshiba Satellite (L305D-S5869)

These were on-sale recently (9/25) at Fry's and seemed like a good deal although it's understood the Linux factor might be difficult with ATI video and so on. Still for $400:

15.4 WXGA
AMD Athlon 64 X2 Dual Core
1024 MB PC6400 SDRAM
Radeon 3100HD (RS780) w/VGA out
Atheros AR5007EG (wifi)
Realtek RTL8102E (ethernet)
Realtek ALC268 (sound)
120GB 5400 RPM SATA 2.5"
3xUSB 2.0
No bluetooth or videocamera

Booted into pre-installed Windows Vista first. The return policy is 15 days for laptops and specifies software and hardware must remain unmodified. After verification of hardware features, I blew out the unbelievably bloaty factory load, dropped in a boot disk, formatted, and mke2fs /dev/sda1. Nice.

Slackware 12.0

I had a Slack 12.0 DVD gathering dust available and Slackware is my favorite. However, errors appeared on installation and it seemed an extensive parameter set was required to tame them:
#boot nosmp noapic irqpoll
To me, these problems meant that, if I continued with the Slack install on the newer hardware, I might be compiling and patching over the weekend, or that I should download and burn Slack 12.1 and begin there. I also had a copy of Slackware-based Zenwalk (formerly Minislack) 5.2 which possessed a newer kernel and a supposedly candy-coated installation process. Choices.

Zenwalk 5.2

Installed smoothly with only irqpoll needed as a parameter.

Atheros AR242x 64 (5007 chipset)
The instructions here were helpful for understanding this newer card. Zenwalk provides ath5k, but it wasn't going well. The Madwifi site has information on ath5k here, and it appears the ath5k module will eventually be effective. Currently however, the steps which worked were:

1. in /etc/modprobe.d/blacklist, blacklist the "ath5k" module
2. reboot and lsmod - make sure the ath5k is gone
3. download madwifi-hal- , or the newest one there, make, and install.
4. reboot again and lsmod
5. iwconfig ath0

WEP is trivial, merely need the two iwconfig commands "essid" and "key restricted" to make it work. WPA, on the other hand, is a separate post. It only took 10 minutes to configure, but the description is too long for this overview. If one has a distro which requires kernel modification for WPA, the process becomes longer. This site seems to explain it t I'm also currently building a chart for easier understanding based on this site.

screen brightness and gamma
The default settings for screen brightness and backlighting install maxed at 100%, and the Fn buttons don't seem to work except in Windows - battery life, screen life, eyestrain. Without going into X, one has command-line control over the brightness. Look in /proc/acpi/video/VGA/LCD/brightness to see the possible brightness settings for the card, such as 25, 50, 75%, and so on. I like 25%, so:
#echo -n 25 > /proc/acpi/video/VGA/LCD/brightness
It appears we cannot change the backlighting outside of X, though I haven't researched. Once in X however, open a terminal and select any number between 0.00 and 1.0 for gamma, eg:
xgamma -gamma 0.75

Realtek ALC268 Sound
Some duplicate alsamixer settings were seen. For example, alsamixer showed two microphone capture bars when only one channel was connected. I went to the Realtek downloads site, clicked a link there to the "HD Audio Codec Driver", and agreed to licensing language. After download and unpacking, it turned out this was the latest release of ALSA, so it basically installs the latest ALSA, but apparently with a newer HD driver. The alsamixer showed proper inputs following this ALSA update. and so, after setting levels, it was time for # alsactl store.

Radeon 3100HD RS780MC
Initially, Zenwalk loaded the vesa driver in /etc/xorg.conf, providing resolutions of 800x600. Common sense and #gtf seemed to indicate higher resolutions were available. In /etc/xorg.conf, I replaced "vesa" with, alternately, "ati", "radeon", and "radeonhd"; these did nothing but break X. I then relented for the proprietary driver "fglrx" described on most blogs as bloaty and slow, but operational. The driver was avialable here by selecting the Linux x86_64 -> Radeon -> ATI Radeon HD 3xxx Series and pressing "go". One note about installing this - I received checksum errors when I attemped to install it with #. ati*; I had to explicitly invoke bash #bash ati*. However, following this installation, I simply replaced "vesa" with "fglrx" in the Device section of /etc/X11/xorg.conf, rebooted, and everything worked. With the vesa-fglrx swap, the /etc/X11/xorg.conf file looks like this:
Section "Device"
Identifier "Videocard1"
VendorName "ATI Technologies Inc"
BoardName "Video device"
Driver "fglrx"
BusID "PCI:1:5:0"
Option "RenderAccel" "true"
Adjustments to the fglrx module "Options" can come some other weekend; resolution and display appear sharp currently.

additional fglrx considerations for the Radeon 3100HD R5780MC
The fglrx driver, although supplied by Radeon, does appear to have significant Googleland complaints for slowness. For me, it renders well, but very slowly: I'm experience update lines even scrolling through a simple text page on Mousepad, etc. So, it appears something either a)very inefficient, or b)very underpowered, is taking place in terms of memory usage with the fglrx driver. From Google, it appears there are a few things to investigate: 1) does flglrx load as a module? (lsmod |grep fglrx). Mine does not appear in lsmod, and this apparently means xorg.conf loads a substandard fglrx_drv.ko module. Lsmod failed to locate this module either. Odd. 2) Settings in /etc/X11/xorg.conf for the fglrx driver, under "Options" may be important. 3)Settings (don't know syntax or location) for whether the ATI card uses SIDEPORT mode (card uses its own memory),UMA mode (card shares system memory), or another unnamed mode where it uses a mix of SIDEPORT and UMA. One thing for sure, a lifesaver in these forum boards is fglrxinfo or fglrxinfo -v:
# fglrxinfo
display: :0.0 screen: 0
OpenGL vendor string: Mesa project:
OpenGL renderer string: Mesa GLX Indirect
OpenGL version string: 1.4 (2.1 Mesa 7.0.3)

glxinfo is also important. On my system, glx is not enabled, though this may be a different problem than the overall slowness of screen panning and scrolling that I'm experiencing. A good forum thread for these issues is here, not for solutions but for the many aspects of the problem.

netpkg repos
Each time zenwalk is released, the repositories update to the most current release so that, if one needs a certain package, they generally have to update the rest of their system to be in sync with it. Suppose I like my release and just want to keep it into perpetuity. As long as 1) I have the installation disk 2) have netpkg'ed all the programs from that release I want (they download to /var/packages), and 3) have downloaded a copy of PACKAGES.TXT.gz, I can point netpkg to /var/packages and use the older release. A couple of simple modifications are required with two configuration files since netpkg doesn't inherently recognize URLs of the type "file:///". This link describes the changes to the two files, /usr/libexec/netpkg-functions and /etc/netpkg.config files, which I repeat here.
  • /usr/libexec/netpkg-functions, at or about line 144:

  • if [ $( echo "$url" | egrep -e "ftp:.*|http:.*|file:.*" ) ]; then
  • or about line 205:

  • if [ ! "$(echo $mirror | egrep 'http://|ftp://|file://')" ] ; then
  • /etc/netpkg.conf add another line such as

  • Internet_mirror = file:///var/packages
    Put a copy of PACKAGES.TXT.gz into /var/packages, and you've got a self-contained distribution.

    unsolved: multiple instantiation of mplayer, thunar, etc
    Perhaps because of multiple processors, there's currently a problem when using DVD's. Multiple instances of related applications appear, eg 2 x MPlayer or 2 x Thunar. Working around this by disabling automatic HAL events for the time being. Manually opening one instance of the application for now.

    Saturday, September 20, 2008

    Clickable JavaScript-less thumbnails

    A project required some clickable JPGs, and I somehow became determined to attempt it without the boggy overhead of JavaScript. The plan was to generate thumbnails with a Bash script and then manipulate the rest with Cascading Style Sheets (CSS).
    Note: At the bottom of the entry here, however, I found a lightweight and probably foolproof java script. Additionally, in the search for the CSS solution, I ran across a notable introductory CSS tutorial here, and one that explains how to create rounded corners here.

    thumbnail generation

    In lieu of a Bash script, I downloaded a small thumbnail generator application, jpgtn. It compiled but threw errors on first use:
    $ jpgtn -H -s 128 -d "./thumbs/" -p "tn_" *.jpg

    Using strace an unstated dependency on seemed to be the problem:
    access("/etc/", R_OK) = -1 ENOENT (No such file or directory)
    Although was indeed lacking, the module had long been deprecated. The problem was operator error: I specified "jpg" in the command, and that limited jpgtn to processing only files with a lowercase ".jpg" extension. Other extensions -- JPEG, jpeg, JPG, or even, TXT -- caused jpgtn to exit with an error. The program also exits with an error if a "thumbs" sub-folder has not previously been created. So, verified or renamed all the JPG's with a lowercase "jpg" extension, and created a "thumbs" subfolder, jpgtn processed the photos into "thumbs" very rapidly.

    mouseover text

    For ease, mousing over the thumbnail should provide a text description of it,, but I wanted to do this without the pain of java, and within CSS. Several solutions appeared. The first good description of how to understand CSS mouseover options was here, but it appeared to deal mostly with links. A more complete description using span was found here, but this involved editing the style sheet in some way I didn't understand. The site ultimately with a page by page solution was this one. The author apparently wished to insert some effects on his MySpace page. MySpace apparently allows CSS but not java.

    Using the code from the site, I put a thumbnail on the page with the mouseover text "Statics Class 2005", in the following way:

    <div class="popuptext0">
    <a class= "hoverTest" href="stats.jpg">
    <img src="tn_stats.jpg"> <br>
    <span class="popUpSpan">Statics Class, 2005 </span>
    div.popuptext0 {width:150px; height:auto}
    a:hover img {filter:none;}
    a img {border:0px !important;}
    a.hoverTest {width:150px; height:auto; }
    a span.popUpSpan {visibility:hidden;}
    a:hover span.popUpSpan {visibility:visible; display:block; border:1px silver solid}
    a span.popUpSpan {color:black; font-size:13px}
    a:link, a:hover {text-decoration:none !important;}

    This worked fine - it named the photo and recalled the larger photo when clicked. But what about having multiple thumbnails across a page, in gallery format, with text available, how to arrange this?

    lightweight JavaScript solution

    Eventually, I found a partial JavaScript solution which was lightweight, meaning it didn't require pages of code. Additionally, it automatically generated the thumbnails for me. I found a micro script at dynamicdrive which did the trick and didn't require many resources. Problem solved, pretty easily.

    Friday, September 5, 2008

    Slackware 12.0 - Wine Install

    It appears Slackware doesn't include Wine. In early September of 2008, there was a dedicated Wine package available for Slack 10.1 here, but this package made for 10.1, may not have worked with the kernel in Slack 12.0. I thought it best to go with source and compile. The latest Wine package download info is typically found at this portion of the WineHq site. I selected the latest release, which was Wine 1.1.4 in early September 2008.


    Dependencies are supposed to be the bane of installing Wine. I was unable to locate a dependency list at the WineHQ site to preempt vigilance with configure. Nevertheless, it seemed it would be easy to watch configure, note misses, download and install them, and then re-run configure. It seemed that easy.

    I untarred the package and proceeded to the first run of configure, Several apparent problems which didn't appear to be dependency problems displayed as configure scrolled its checks. These scrolling messages seemed to indicate various audio features were unavailable. Here's a few of hundreds that appeared:
    checking machine/soundcard.h usability... no
    checking machine/soundcard.h presence... no
    checking for machine/soundcard.h... no
    When configure finished its run, it also provided a message which may have been dependency related:
    configure: libcapi20 development files not found, ISDN will not be supported.

    Additionally, I looked in /include/config.h to check further for missing dependencies. All told, I didn't think I'd need the audio stuff that was scrolling or the ISDN support the message indicated, so I went to the remaining standard installation steps:
    $ ./configure
    $ make depend
    $ make
    # make install
    These steps seemed to go well, though in the back of my mind I was a feeling my dependency laziness might bite me later.


    After installation, I began with $ winecfg and received another apparent error message:
    $ winecfg
    wine: created the configuration directory '/home/doofus/.wine'
    Could not load Mozilla. HTML rendering will be disabled.
    wine: configuration in '/home/doofus/.wine' has been updated.
    Not sure what this meant either, but I kept going, unzipping and installing a Windows gradekeeper program. It started without any problems. So far, so good, though I may yet find that these HTML and audio messages provide some limitations.