rozważania o CNC

Listopada 21, 2024, 12:38:20
Witamy, Gość. Zaloguj się lub zarejestruj.

Zaloguj się podając nazwę użytkownika, hasło i długość sesji
Strony: [1]   Do dołu
  Drukuj  
Autor Wątek: Linux on Acer TravelMate 5320  (Przeczytany 13532 razy)
markcomp
Administrator
*****
Offline Offline

Wiadomości: 15132



WWW
« : Września 29, 2009, 09:15:25 »

Linux on Acer TravelMate 5320



http://sysphere.org/~anrxc/local/Travelmate-5320/travelmate-5320.html
Cytuj
Installing Arch GNU/Linux on Acer TravelMate 5320

Last updated May 01, 2009

    * Aug 29 all sections updated with latest information
    * May 01 sysctl.conf updated, better responsiveness
    * Dec 30 acer-wmi proper rfkill support
    * Dec 24 info on alsa changes and OSS fixes
    * Dec 07 laptop-mode section added
    * Dec 06 suspend section revised
    * Dec 01 extra Keys section revised
    * Nov 27 backlight (brightness) section added
    * Nov 12 framebuffer section added
    * Nov 10 GM965 thermal support info, UVC in kernel
    * Jul 15 tv-out finally fixed and working
    * May 31 acer-wmi, acpid handler, HAL keyboard info
    * ...

 

Travelmate-5320
Hardware Spec.

  Processor        Intel Celeron M540 1.86GHz (1MB L2 cache)
  Chipset          Intel Mobile PM965/GM965/GL960
  Sound            Intel HD Audio (Realtek ALC268) with int. microphone
  Video            Intel GMA965 - X3100 with S-Video (TV-Out) and ext. VGA
  Networking       Broadcom BCM5787M Gigabit Eth. and Broadcom BCM94311 Wlan
                   * Extra: Atheros Wlan (PCMCIA) and D-Link 0100TX Eth. (USB)
  Modem            Conexant HD Audio modem (Soft Data Fax Modem with SmartCP)
  Memory           1GB DDR2 RAM
  HDD              Western Digital WD800BEVS-22RST0 80GB
  Optical          Slimtype DVD A DS8A1P DVDRW, DL 24x
  Display          15.4 inch WXGA TFT 1280x800 max, CrystalBrite display
  Touchpad         Synaptics PS/2
                     USB              4 x 2.0 USB ports
                     PCMCIA           1 x PC-Type II port
                     PC Express       1 x PC-Express port /54
                     CardReader       TI 5-in-1 (SD/MMC/MS/MS PRO/xD)
                     WebCam           Acer CrystalEye webcam (064e:a101 Suyin Corp.)
                     Bluetooth        Broadcom BCM2045NMD (0a5c:2110)
                     FireWire         TI PCIxx12 OHCI compliant IEEE1394 controller
                     IrDA             Manufacturer Unknown
 

If you're wondering; this laptop works fine with GNU/Linux and you should have no doubts about buying it/switching to GNU/Linux. Just make sure to choose a distribution that had a release recently. Before starting with this guide please check your own hardware thoroughly because Acer ships these models with sometimes diffrent components (atheros wifi, no webcam...). I was also informed by another owner that some models lack a bluetooth chip even though the bluetooth button is present... keep that one in mind it could save you some frustration.


Output of lspci:

    00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 03)
    00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 03)
    00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (rev 03)
    00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)
    00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)
    00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03)
    00:1c.2 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 (rev 03)
    00:1a.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Contoller #4 (rev 03)
    00:1a.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)
    00:1a.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)
    00:1d.0 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)
    00:1d.1 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)
    00:1d.2 USB Controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03)
    00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)
    00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)
    00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M) LPC Interface Controller (rev 03)
    00:1f.1 IDE interface: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03)
    00:1f.2 SATA controller: Intel Corporation 82801HBM/HEM (ICH8M/ICH8M-E) SATA AHCI Controller (rev 03)
    00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03)
    02:00.0 Ethernet controller: Broadcom Corporation NetLink BCM5787M Gigabit Ethernet PCI Express (rev 02)
    04:00.0 Network controller: Broadcom Corporation BCM94311MCG wlan mini-PCI (rev 01)
    0f:06.0 CardBus bridge: Texas Instruments PCIxx12 Cardbus Controller
    0f:06.1 FireWire (IEEE 1394): Texas Instruments PCIxx12 OHCI Compliant IEEE 1394 Host Controller
    0f:06.2 Mass storage controller: Texas Instruments 5-in-1 Multimedia Card Reader (SD/MMC/MS/MS PRO/xD)
    0f:06.3 SD Host controller: Texas Instruments PCIxx12 SDA Standard Compliant SD Host Controller
 

Kernel

At the moment I'm running a 2.6.30.5 kernel provided by Arch. It's very well configured, very modular and everything works ok with it. I have no intention of compiling my own for now, so I don't provide a kernel config file like similar artciles do.
Installation

I partitioned the hard drive like this (during installation):

  Disk:
      /dev/sda
  Partitions:
      /dev/sda1 - 40MB  - ext2 - /boot
      /dev/sda2 - 19GB  - ext3 - /
      /dev/sda3 -  1GB  - swap - swap space
      /dev/sda4                  extended
      /dev/sda5 - 20GB  - ext3 - /home
      /dev/sda6 - 30GB  - ext3 - /mnt/storage
      /dev/sda7 - 10GB  - ext3 - /mnt/backup
 

I booted the core CD and walked trough the setup. With Arch Linux you partition your drive(s), edit crucial config files like /etc/{rc,resolv,lilo}.conf ..., and install core packages. Once the system was running I uptaded the pacman (Arch package manager) database and installed everything else; X.org, graphic and audio drivers, kdebase, FVWM2, libs... everything you need on a workstation.
System Configuration
X11

    - My current xorg.conf
    - My HAL policy files for input configuration in X.org >= 1.6

For initial setup I run xorgconfig, then edited xorg.conf to fine tune it. Graphics run fine with the vesa driver, however I did install the opensource intel driver (xf86-video-intel) and that's what I'm using now. I'm not very happy with glx performance, glxgears gives only 800FPS, I expect at least a 1000+ (note that glxgears is not a real benchmark), obviously some tweaking was needed, but nothing helped. I patiently followed all new intel/mesa/dri/xorg releases. Things are looking better with each new one, and with kernel 2.6.28 we got a new memory manager (GEM) and new acceleration architecture (UXA), as of Linux 2.6.30 performance is still not better than it was with TTM and EXA but 2.6.31 should finally bring some long awaited improvements. In the mean time ET and OpenArena run more or less ok with 30FPS average, but not enough for any semi-serious gaming.

TV-Out / External VGA

Both cloned and extended displays are possible with this chip/driver. However until xf86-video-intel-2.3.2 TV-Out was not working (VGA did). For a static configuration you can take a look at my xorg.conf, but xrandr is widely used today for dynamic, on the fly setup and (re)configuration. Some examples:

      $ xrandr --output TV --auto
      $ xrandr --output TV --set TV_FORMAT PAL; xrandr --output TV --mode 1024x768
      $ xrandr --output TV --set TV_FORMAT PAL; xrandr --output TV --mode 1024x768 --right-of LVDS
 

Backlight

This is a new section, required because this whole backlight control turned into a mess. ACPI controls it, acer-wmi (see ACPI section) controls it, newer X.org versions also have support for it and then you have modern stuff like hald also messing with your values. For starters let's see how you can change your brightness:

      Trough ACPI
        echo 10-100 /proc/acpi/video/GFX0/DD03/brightness
        echo 0-9 /sys/class/backlight/acpi_video0/brightness
      Trough acer-wmi
        echo 0-9 /sys/class/backlight/acer-wmi/brightness
      Trough X.org
        $ xrandr --output LVDS --set BACKLIGHT ...
       Or
        $ xbacklight -set xx
      Trough your keyboard Fn+BrUp/Dn (acer-wmi)
        - see ACPI and Extra Keys sections
      Trough HAL with dbus, not worth mentioning.
 

With Linux 2.6.27 and X.org 1.5/7.4 you had a situation where your brightness changes several times while booting as all mentioned stuff loads. Last one of these being X, so I decided to tackle it there, but X also has another problem; Every time the screen goes off or resets (DPMS, xrandr, suspend...) brightness level jumps to maximum. This can be solved by enabling legacy control. You can setup your .xinitrc to first set your desired level (xbacklight) and then enable legacy control (command below), so your brightness level will be preserved at all times. With X.org 1.6 this is no longer needed on my machine.

      $ xrandr --output LVDS --set BACKLIGHT_CONTROL legacy
 

Framebuffer

Since I'm writing about graphics I should mention how to get widescreen (1280x800) resolution on the console, using plain vesafb. According to VESA modes on Wikipedia, 352 (1440x900) also selects 1280x800 (8-bit) on some laptop displays, which also applies here. My lilo.conf is available for reference. You can check your settings with vbetool:

      $ vbetool vbefp panelid

        size:1280 800                       
        type:5
        bpp:8 8 8 0
 

Fonts

Initially fonts were fuzzy and quite hideous. With a little tweaking I got good results even without BCI enabled. For the first time I moved away from DejaVu and settled with Liberation fonts from RedHat. My desktop is set at 96 DPI, with anti-aliasing and sub-pixel hinting (rgb, full) enabled. Depending on your usage of fonts you'll problably want to exclude some fonts from AA. Everyone has their own idea how fonts should look like so it's up to you to test diffrent settings. There are various approaches; you can edit your .fonts.conf, .Xresources or use some GUI like KDE's control center. They all do the same thing. A guide that helped many people is a classic Font HOWTO on TLDP. My .Xresources:

      Xft.antialias: 1
      Xft.dpi:       96
      Xft.hinting:   1
      Xft.hintstyle: hintfull
      Xft.rgba:      rgb
 

Synaptics

The driver is now part of X.org (xf86-input-synaptics), old project page can be found here, as for setting it up feel free to copy the config from my xorg.conf or HAL policy file. All the touchpad buttons work, including the middle one + all directions. Once you setup synaptics you also get tapping and scrolling functionality on the touchpad it self.

Extra Keys

This section now presumes that you use evdev and input hotpluging, with newer HAL enabled X.org versions. I sent a patch to HAL developers a while back and now this model is fully supported. Legacy mappings can be made if you setup acer_laptop as your keyboard model in xorg.conf. Kernel recognises all keys except display on/off (Fn+F6) which is hardwired and working. Only a few keys are not mapped by the kernel, take a look at rc.local section in this file to see how to map them with setkeycodes. Once you start X, all keys should be mapped and have a coresponding X binding. You can then use a program like xbindkeys to map keys to actions, or setup keybindings in your WM or DE directly.

Note; wifi LED and button work fine with b43 wireless driver. Please read the Wireless section for details.


ACPI

Everything works fine (battery, button, processor, thermal...).

You should install acer_acpi to get full support for rest of your hardware, once installed you can control various things like brightness/bluetooth/wifi states trough /proc/acpi/acer/ . As of Linux 2.6.25 acer-acpi is a part of the kernel, known as acer-wmi and is exposed exclusivly trough /sys filesystem. Starting from Linux 2.6.28 acer-wmi has proper rfkill support for wireless and bluetooth devices:

      Current state
        $ cat /sys/devices/platform/acer-wmi/rfkill:rfkill*/{name,state}
      Disable bluetooth
        $ echo -n 0 > /sys/devices/platform/acer-wmi/rfkill:rfkill1/state
 

You could also install acpitool or ACPI Client which replicate behaviour of the old 'apm' command, thus giving you temperature, battery... and all kinds of other info.

Processor frequency and voltage scaling is not possible with this CPU. But you can at least make use of throttling control to save some battery power by sending the CPU to sleep for short amounts of time. Take a look at the files in /proc/acpi/processor/CPU0/ to see your options and echo a number to the throttling file to force it (check the acpid section for more tips). Also note that newer Linux kernels no longer have a fixed 1000Hz timer tick. The result (in theory) is huge power savings because the CPU stays in low power mode for longer periods during system idle. For other ways of saving power read sections below this one, and visit the LessWats project.

Suspend

You can choose between uswsusp, tuxonice and direct kernel suspend/hibernate. Uswsusp is completely software based, doesn't require any kernel modifications and gives you the possibility to use quirks and compress (+ encrypt) images during hibernation. I use it in combination with pm-utils, which is now the standard power management framework on every distribution and supports all three mentioned suspend methods.

Suspend works fine with acpi s3, I submitted the patch and in future uswsusp releases it will be supported out of the box. No other quirks or workarounds are needed. However the psmouse module was causing the machine to freeze while resuming (it seems to be a common problem with Acer machines). The pm-utils framework is helpful here, with pm-utils hooks you can (among other things) remove modules prior to suspending and reload them after resuming. I also submitted the needed quirks (acpi s3) to a hal-info developer so pm-utils should work out of the box in cases where tuxonice or direct kernel support is used.

Note; with Linux 2.6.30, X.org 1.6 and xf86-input-evdev 2.2.5 the psmouse module no longer causes lock-ups on my machine.

Note; with newer X.org and evdev (X11 section) the keyboard stops working after resuming from suspend/hibernate. If you have the same problem you can check my evdev patch that overrides keyboard disabling. As an alternative you can check my pm-utils hook that resets the driver (must be executable). Beware that it can introduce other problems, for example with XKB.

acpid

To setup acpid take a look in /etc/acpi, I maped the power key to do a clean shutdown, Fn+Sleep to suspend, Lid closing to lock the desktop and AC events control the CPU throttling or start laptop-mode (which then controlls throttling). My handler file is here.

laptop-mode

Laptop-mode-tools is a laptop power saving package for Linux systems (a shell script and a bunch of config files really). I configured acpid to call it when I switch to/from battery power. It can enable the Laptop Mode feature of the kernel, control CPU throttling, HDD power management, remount your partitions and setup the system do to less frequent writes, enable power saving for Intel HDA sound cards and Intel's SATA controllers, stop/start services and programs, remove modules... and a whole lot more (+ restoring the system to original state when AC is plugged in). One of the features is automatic hibernation when the battery is low. Unfortunately I have a battery (from SANYO) that doesn't send events and has no alarm support. Since that was very important to me I came up with another solution. I repackaged laptop-mode-tools to include this script, which is then started from rc.local on boot.

Note; I wrote to the author and in newer versions of laptop-mode-tools (>= 1.49) a module helper is included that does the same thing.

You could also do all of this with pm-utils alone, using pm-powersave and power.d hooks. But it doesn't make much sense to write a bunch of scripts/hooks when it's all in the laptop_mode script as it is.


Multimedia
Sound

This particular Intel HDA is supported since alsa 1.0.15, fortunately udev will load the modules (snd_hda_intel...) for you. First you must run alsamixer to unmute the channels, then store your config with alsactl store, that's it. Built in microphone also works, you should max out your Capture channels in alsamixer and then try to record something with a utility like arecord:

      $ arecord -f cd -d 3 -t wav -N test.wav
 

This was added to /etc/modprobe.conf:

      options snd-hda-intel model=acer
 

I noticed that applications which rely on OSS always see PCM channel as muted and they can't control it. Another issue was with games that use OSS, like enemy-teritory, they had no sound. This was added to the system init (rc.local):

      # OSS emulation mixer fix
      #   PCM alsa control isn't auto. mapped to OSS equivalent
      echo 'PCM "PCM" 0' > /proc/asound/card0/oss_mixer
      # Enemy Teritory sound fix
      echo "et.x86 0 0 direct" > /proc/asound/card0/pcm0p/oss
 

Note; since alsa 1.0.17 (Linux 2.6.27) my microphone didn't work. By reading the changelog I learned about some changes/fixes that went into 1.0.18a which is due to be realeased with Linux 2.6.28. I got tired of waiting and did some debugging... In the end I removed the prior mentioned line from modprobe.conf and let the driver probe the BIOS for model info/capabilities. The result is a working microphone, a few new channels in ALSA/alsamixer (Headphone, Front, Front Mic Boost...) and somewhat louder sound. It's worth mentioning that the acer model was broken into acer and acer-dmic in alsa 1.0.18a so if you run into some trouble with your microphone it's worth a shot to change your model.

I didn't test audio-in.

Webcam

This webcam is supported trough the UVC driver, once installed I tested it with ffmpeg and kopete it was also reported to work with Skype... you can also check luvcview which I guess gives some more control over the picture. Since Linux 2.6.26 UVC is part of the kernel, module is uvcvideo.

Card Reader

Although I didn't have any memory card to test, the hardware is recognised and supported. Be sure that the correct modules are loaded depending on the card you're inserting (tifm_core, tifm_sd, tifm_7xx1, mmc_core, sdhci, sdhci_pci...).


Networking

Provided ethernet card works ok with the tg3 module. I also have an external USB card that works fine with the pegasus module.

Modem

This HSF modem from Conexant is supported with drivers from Linuxant. You can test it with full version drivers they provide, however they are capped at 14k. If your modem works ok you should consider buying a license from them that would allow you to run your modem at 56k and get fax support. Price is fairly reasonable... around 20$ per device.

For general information about using soft modems on linux you should check the Linmodems page.

I also have a GPRS capable mobile phone that I use as a modem where WiFi is not available. To use it with a USB cable you should have CDC-ACM support in your kernel as well as general PPP support. Then you use an app like wvdial to connect to your mobile provider.

Wireless

This card is covered with a driver from the b43 project, complete with injection support. Depending on the kernel you're using read their instructions carefully about which driver to use and which firmware to cut.

I also tried using the card with bcm43xx, it was not very stable and the wireless LED didn't work. With b43 the LED powers on when you bring up the interface with ifconfig. One warning, for now b43 driver doesn't coexist well with Bluetooth device powered on. I experienced this my self. I hope it will be sorted out soon.

I also own an Atheros PCMCIA card, those chips on the other hand have great support. People at the MadWifi project are doing a great job. If you're buying wifi hardware consider something with an Atheros chip.
My kismet.conf looks like this:

    ...
    ncsource=wlan0:type=mac80211,name=broadcom
    ncsource=wlan1,type=mac80211,name=atheros
    #ncsource=ath0,type=madwifi_g,name=madwifi
    ...
    # I switch these depending on cards running at the moment
    enablesources=broadcom
    #enablesources=atheros
    #enablesources=madwifi
    #enablesources=atheros,broadcom
    #enablesources=madwifi,broadcom
    ...
 

Bluetooth

Once bluetooth, hci_usb and the rest of the modules are loaded; You need to install bluez-libs, bluez-utils and optional some GUI utility, like kdebluetooth set of tools. There are many guides available, one that set me going in no time was Gentoo's Bluetooth Guide. For more specific usage like using your mobile phone as a modem or remote control you can check the docs on BlueZ.

IrDA

I loaded nsc_ircc module which found a device (I didn't figure out exact manufacturer yet) but also reported that only SIR mode is supported by it. I also installed irda-utils package and tested irdadump util, when I put a mobile phone close it picked it up:

  ... S=6 s=5 Sony Ericss hint=9124 [ PnP Modem IrCOMM IrOBEX ] (28)
  ... S=6 s=* katana hint=0400 [ Computer ] (22)
 

I have yet to figure out how to do something useful with it. I'm used to connecting my phone via USB cable so this is not a priority. Could it be used as a remote control? (phone doesn't have BT).

Firewire

I can see that the device has been picked up, modules like ieee1394 and firewire_core are loaded. I have no devices available to make a connection, but I've been told that the protocol is well supported by GNU/Linux and should present no problem.


Misc
i2c / lm_sensors / hddtemp

I was surprised that lm_sensors picked up only the cpu sensor (cputhermal module), For now lm_sensors is not worth the trouble since you can also get thermal readings from ACPI. I recently read on Phoronix that there is a new app available which can get thermal readings from GMA965 graphic cards. They are working on getting the code into lm_sensors.

If you install hddtemp you can also get thermal readings from SMART, it works ok with this HDD model. You can get those with smartctl as well, so it's problably not worth the trouble.

Leds

A friend of mine has some fancy laptop with led indicators of network traffic. So I decided to setup something similar, I installed tleds (read the instructions carefully if installing on a newer kernel). Basicly it blinks keyboard LEDs (ScrollLock & NumLock) indicating outgoing and incoming network packets on a selected network interface.

I added to the init:

      /usr/local/bin/tleds -qcd 150 ath0
 

sysctl

For the record my sysctl.conf looks like this:

    #
    # Kernel sysctl configuration
    #
   
    # Packet forwarding
    net.ipv4.ip_forward=0
   
    # Magic-sysrq key
    kernel.sysrq=1
   
    # TCP SYN Cookie Protection
    net.ipv4.tcp_syncookies=1
   
    # Custom memory settings
    vm.swappiness=1
    #vm.overcommit_memory=2
    vm.vfs_cache_pressure=50
 


Screenshot

screenshot1

Final Note

I would sugest to use some of these stickers instead of that ugly sticker that comes shipped with the laptop: http://www.openstickers.com/


You can find my contact info on my home page http://sysphere.org/~anrxc/, I would be glad to hear from you with some suggestions or solutions, or possibly be of some help to you (but please note that I have no time for Ubuntu users to lazy to read any kind of documentation). Thank you, anrxc.

http://cypruscapers.davepowell.org/blog6.php/2009/01/21/ubuntu-8-10-on-acer-travelmate-5320

Zapisane

MARKcomp77

http://oferta.forum-cnc.pl/
Sterowniki.Silniki

Strony: [1]   Do góry
  Drukuj  
 
Skocz do:  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC
Manuscript design by Bloc Strona wygenerowana w 0.038 sekund z 19 zapytaniami.