特殊:Badtitle/NS100:NC20

来自Ubuntu中文
Wikibot留言 | 贡献2009年11月17日 (二) 20:12的版本
跳到导航跳到搜索

{{#ifexist: :NC20/zh | | {{#ifexist: NC20/zh | | {{#ifeq: {{#titleparts:NC20|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:NC20|1|-1|}} | zh | | }}

Ubuntu Karmic on the Samsung NC20

Support Status


Full: 'out of the box':

  • Wired networking
  • Wireless Broadband Access
  • USB
  • Webcam
  • Bluetooth
  • Suspend / resume
  • Audio playback
  • Fn Keys for Brightness and Volume (needs Karmic)
  • CPU Frequency Scaling (needs Karmic)
  • SD Card reader (needs Karmic)

Partial: after driver/kernel updates

  • Video (either with the openchrome driver or the via driver)
  • Microphone (users reported problems with the internal microphone)
  • Wireless networking (frequent driver lockup which requires reboot)
  • Large I/O transfers on the hard drive (causes kernel panic)
  • Via padlock hardware security
  • Wi-Fi On / off switch

Not functional / Unverified:

  • Fn Buttons (Monitor switching, Screen on/off toggle)
  • Multi-touch

Video / Graphics


When you try to run the Ubuntu Karmic live cd the graphical login will not work. The screen starts cycling through primary colors, plus white and grey. Wait until it's finished booting, then drop to a console using 'Ctrl+Alt+F1'. An easy workaround is as to download the the 2 .deb packages here from https://launchpad.net/~xorg-edgers/+archive/drivers-only/+build/1307486 and put them in a USB key. In the terminal of the Ubuntu Karmic live cd mount the usb stick and install the drivers with the following commands:

sudo mkdir /media/disk
sudo mount /dev/sdb1 /media/disk
sudo dpkg -i /media/disk/xserver-xorg-video-via_0.2.904~svn814-0ubuntu0tormod_i386.deb
sudo dpkg -i /media/disk/xserver-xorg-video-openchrome_0.2.904~svn814-0ubuntu0tormod_i386.deb
sudo /etc/init.d/gdm restart

This steps will install the drivers only for the installation process. You should be able now to use the graphical installer. Once the system is installed, you will need to go through these steps again to install the updated drivers on your hard drive. You can also build an updated driver from SVN. <<Anchor(openchrome_svn)>>

Build from SVN

Before starting this tutorial, notice that the openchrome implementation of the driver is far from complete. Check at this website what has been implemented and what not for the VX800 chipset: http://www.openchrome.org/trac/wiki/SupportedHardware In particular, DRI has not been implemented and this will result in a very slow 2D graphics experience and slow playback of videos on the screen. The following instructions are taken from the OpenChrome|wiki entry. * Firstly get the required build tools

sudo apt-get install build-essential subversion autoconf automake1.9 libtool

* Next you need to get the build dependencies

sudo apt-get build-dep xserver-xorg-video-openchrome

* Get the driver's sourcecode

svn checkout http://svn.openchrome.org/svn/trunk openchrome

* Change into the newly created directory

cd openchrome

* Run autogen to set up the driver build

./autogen.sh --prefix=/usr

* Compile openChrome

make

* Install openChrome

sudo make install

* Edit the Xorg configuration You can use the nano editor or any command line editor that you are comfortable with to make the changes

sudo nano /etc/X11/xorg.conf

This is my configuration which is minimal but gives the full 1280*800 resolution with 32-bit colour. The key settings are specifying the openchrome driver and the activedevice option.

Section "Device"
	Identifier	"Configured Video Device"
	Driver	        "openchrome"
	Option 	        "ActiveDevice"	"LCD,CRT"
EndSection

Section "Monitor"
	Identifier	"Configured Monitor"
EndSection

Section "Screen"
	Identifier	"Default Screen"
	Monitor		"Configured Monitor"
	Device		"Configured Video Device"
	DefaultDepth	16
EndSection

* Restart GDM and install Ubuntu. You will need to restart GDM so that you can install Ubuntu. After installing the driver will need to be installed in the same way again or else you could try copying the openchrome directory to removable media and run make install on it after the reboot. [Update: for Karmic Koala this latter step is now unnecessary - the computer boots perfectly after installation.] To restart GDM and begin installation run this command

sudo /etc/init.d/gdm restart


External monitor

By adding to the xorg.conf file the option

	Option 	        "ActiveDevice"	"LCD,CRT"

the external output works just fine in clone mode, that is, you see in the second screen the same display you see on your laptop. Your external monitor might not accept the same resolution of your laptop though. If this is the case, the following command might help:

xrandr --output default --mode 1280x720

which will change the resolution of the display to one which should work with any HDTV. To revert the resolution back, just run

xrandr --output default --mode 1280x800

You can make these changes from your display manager, but you might find convenient to make some alias to access them quickly.


Proprietary graphics driver

VIA proprietary driver should support most of the features missing with the openchrome driver like stable standby, video decoding acceleration and 3d hardware acceleration. Although the drivers are extremely buggy and have not improved on this side in the last year. On the positive side, the 2D desktop experience is quite bearable compared to the same experience with the openchrome driver. First we need some packages in order to be able to compile a kernel package

sudo apt-get install build-essential subversion autoconf automake1.9 libtool linux-headers-generic

The driver can be found at the following website: http://linux.via.com.tw/support/downloadFiles.action Choose "OS: Ubuntu 9.04" and "Platform: VX800" and download the Unified GFX driver Ver 86a-50937 for Ubuntu 9.04(26Oct09) (3.4M)". You should be able to download a file called 5.74.33.86a-u904-50937.tgz which you should unpack and then run the vinstall program that you will find inside. The file contains a kernel driver for the drm manager, a libGL library for 3D, and the via driver for the X server. Unfortunately the drm manager was written for kernel 2.6.28. Therefore you have to download a modified copy written by tom09 at this address: http://ubuntuforums.org/attachment.php?attachmentid=133328&d=1256670424 compile it and then move the via_chrome9.ko file to /lib/modules/`uname -r`/kernel/ubuntu/via_chrome9/via_chrome9.ko Make sure there is only one via_chrome9.ko in your system after this operation, because if the kernel tries to load the wrong one, you will end up without DRI and therefore with a very slow desktop. Last step, replace your /etc/X11/xorg.conf file with something like the following, since by default the via installer will disable the LCD and so nothing will show up on the screen.

Section "ServerLayout"                                                                                        
       Identifier       "Default Layout"                                                                      
       Screen           "Default Screen"                                                                      
       InputDevice      "Mouse"                                                                               
       InputDevice      "Keyboard"                                                                            
EndSection                                                                                                    

Section "Files"
#     RgbPath      "/usr/local/share/X11/rgb"
       ModulePath   "/usr/lib/xorg/modules"  
#     FontPath     "/usr/share/fonts/X11/misc/"
#     FontPath     "/usr/share/fonts/X11/TTF/" 
#     FontPath     "/usr/share/fonts/X11/OTF"  
#     FontPath     "/usr/share/fonts/X11/Type1/"                                                                                                                                    
#     FontPath     "/usr/share/fonts/X11/100dpi/"                                                                                                                                   
#     FontPath     "/usr/share/fonts/X11/75dpi/"                                                                                                                                    
EndSection                                                                                                                                                                          
                                                                                                                                                                                    
Section "InputDevice"                                                                                                                                                               
       Identifier       "Keyboard"                                                                                                                                                  
       Driver           "kbd"                                                                                                                                                       
       Option           "XkbRules"      "xorg"                                                                                                                                      
       Option           "XkbModel"      "pc105"                                                                                                                                     
       Option           "XkbLayout"     "cn"                                                                                                                                        
EndSection                                                                                                                                                                          
                                                                                                                                                                                    
Section "InputDevice"                                                                                                                                                               
       Identifier       "Mouse"                                                                                                                                                     
       Driver           "mouse"                                                                                                                                                     
       Option           "CorePointer"                                                                                                                                               
EndSection                                                                                                                                                                          

Section "Monitor"
       Identifier       "CRT"
       Option   "Enable"        "true"            
        Option  "Ignore"        "true"                                            
EndSection                                                     

Section "Monitor"
       Identifier       "LCD"
       Option    "Enable"       "true"         
        Option  "PanelSize"     "1280x800"     
EndSection                                     

Section "Monitor"
       Identifier       "DVI"
       Option    "Disable"      "true"
EndSection                            

Section "Monitor"
       Identifier       "TV"
       Option  "Ignore" "true"
EndSection                    

Section "Monitor"
       Identifier       "HDMI"
       Option  "Ignore" "true"
EndSection                    

Section "Monitor"
       Identifier       "CRT-2"
       Option     "Ignore"      "true"
EndSection                            

Section "Monitor"
       Identifier       "LCD-2"
       Option     "Ignore"      "true"
EndSection                            

Section "Monitor"
       Identifier       "DVI-2"
       Option     "Ignore"      "true"
EndSection

Section "Monitor"
       Identifier       "TV-2"
       Option     "Ignore"      "true"
EndSection

Section "Device"
        #BusID "PCI:00:01:0"
        Driver  "via"
        VendorName      "VIA Tech"
        BoardName       "via"
        Identifier      "Configured Video Device"
        Option          "AccelMethod"           "EXA"
        Option          "MigrationHeuristic" "greedy"
        Option          "ActiveDevice"          "LCD"
EndSection

Section "Screen"
       DefaultDepth 24
       SubSection "Display"
              Virtual 2000 2000
              Depth  24
       EndSubSection
       Identifier       "Default Screen"
       Device           "Configured Video Device"
EndSection

Section "Module"
      Load  "glx"
      Load  "dri"
      Load  "extmod"
EndSection

Section "DRI"
       Group 0
       Mode 0666
EndSection

Section "Extensions"
        Option  "Composite"                     "Enable"
EndSection

Wireless

Wireless will work out of the box. But there is a glitch. Sometimes the connection will suddenly stop working and running dmesg will show the following message repeated many times

ath5k phy0: failed to wakeup the MAC Chip
ath5k phy0: can't reset hardware (-5)

At this point, the only solution seems to reboot. This is quite annoying as it can happen suddenly and frequently. The problem has been reported already in many forums, although as of kernel 2.6.31-15, it has not been solved yet. See for example the following link: http://bugzilla.kernel.org/show_bug.cgi?id=14561 and if you have any insights, help the developers to fix this bug!


Touchpad (HAL)

THIS IS NOT NECESSARY IN KARMIC! This is a sample touchpad configuration for hal. The configuration file can be located here:

/usr/share/hal/fdi/policy/20thirdparty/11-x11-synaptics.fdi

The configuration enables shmconfig, scroll coasting and palm detect amongst others.

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <device>
    <match key="info.capabilities" contains="input.touchpad">
      <match key="info.product" contains="Synaptics TouchPad">
        <merge key="input.x11_driver" type="string">synaptics</merge>
        <merge key="input.x11_options.SHMConfig" type="string">True</merge>
        <merge key="input.x11_options.LeftEdge" type="string">1632</merge>
        <merge key="input.x11_options.RightEdge" type="string">5312</merge>
        <merge key="input.x11_options.TopEdge" type="string">1575</merge>
        <merge key="input.x11_options.BottomEdge" type="string">4281</merge>
        <merge key="input.x11_options.MinSpeed" type="string">0.1</merge>
        <merge key="input.x11_options.MaxSpeed" type="string">0.75</merge>
        <merge key="input.x11_options.AccelFactor" type="string">0.004</merge>
        <merge key="input.x11_options.PalmDetect" type="string">1</merge>
        <merge key="input.x11_options.PalmMinWidth" type="string">5</merge>
        <merge key="input.x11_options.PalmMinZ" type="string">190</merge>
        <merge key="input.x11_options.CoastingSpeed" type="string">6.0</merge>
        <merge key="input.x11_options.VertScrollDelta" type="string">300</merge>
      </match>
    </match>
  </device>
</deviceinfo>

Function Keys

THIS IS NOT NECESSARY IN KARMIC! <<Anchor(intrepid_kernel)>>

Manually patching the Intrepid kernel

There was a bug in the linux kernel that meant that the function keys repeated infinitely. To fix this in Intrepid, you need to patch the kernel and then recompile manually: For details see the official|ubuntu kernel compilation howto and this blog. For jaunty this has been fixed as of kernel version 2.6.28-12, so you can [[UbuntuHelp:[jaunty_kernel|continue below]]]. Frankly rebuilding the kernel and all its modules (including the backports modules for the wireless driver) is a lot of hassle and takes hours of compilation time especially since you will have to maintain your own kernel flavor from then on. Therefore, if you don't care that much about the brightness keys and just want to get the cpu frequency scaling to work, it is strongly recommended to skip down to the [[UbuntuHelp:[e_powersaver_shortcut| shortcut for the e_powersaver module]]]. get the dependencies and the kernel source:

sudo apt-get build-dep linux-image-$(uname -r)
apt-get source linux-image-$(uname -r)

download the kernel patch and extract it into your home directory. apply the patch (assuming the kernel sources are in ~/linux-2.6.27/

cd ~
patch -p0<atkbd-samsung-nc20.patch

If you just build the patched kernel now, it will clash with the standard distribution kernel and updates will overwrite it. Therefore we'll create a new kernel flavor called nc20: first make a config file based on the generic one:

cp debian/config/i386/config.generic debian/config/i386/config.nc20

While we are at it we might as well activate the e_powersaver module:

echo "CONFIG_X86_E_POWERSAVER=m" >> debian/config/i386/config.nc20

copy these files to finish creating your new flavor:

cd ~/linux-2.6.27
cp debian/abi/2.6.27-XXX/i386/generic debian/abi/2.6.27-7.13/i386/nc20
cp debian/abi/2.6.27-XXX/i386/generic.modules debian/abi/2.6.27-7.13/i386/nc20.modules

Now we need to add the new flavor to some config files:

sed -i 's/getall i386 generic server/getall i386 generic server nc20/' debian/scripts/misc/getabis
sed -i 's/flavours        = generic server/flavours        = generic server nc20/' debian/rules.d/i386.mk

Two more files: debian/control.stub and debian/control For both files we need to copy three sections:

  • Package: linux-image-2.6.27-7-generic
  • Package: linux-headers-2.6.27-7-generic
  • Package: linux-image-debug-2.6.27-7-generic

A section is defined from the line Package to the next line starting with Package. In the copied sections we need to replace “generic” with “nc20″ on all the lines that start with Package. Finally regenerate the config files and start compiling (this will take a while):

chmod u+x debian/scriptsmisc/*
debian/rules updateconfigs
AUTOBUILD=1 NOEXTRAS=1 fakeroot debian/rules binary-nc20

Now there should be shiny new .deb packages for your kernel in your home directory. Install them:

sudo dpkg -i ~/linux*.deb

Unfortunately the atheros driver is not included in your custom kernel yet. Therefore you need to build linux-backports-modules. This is explained|here.


Brightness

THIS IS NOT NECESSARY IN KARMIC! Needs two actions to fix. Firstly you must verify that your kernel contains the patch that was submitted to fix the brightness keys. Then you can enable hal to recognise the nc20. <<Anchor(jaunty_kernel)>> 1. Kernel Patch The patch to fix the bug in the linux kernel has been incorporated into the 2.6.28-12 kernel in Jaunty. This kernel is in proposed as of <<Date(2009-05-03T20:30:16-0135)>> It should be in the mainline 2.6.30 kernel. For intrepid you need to [[UbuntuHelp:[intrepid_kernel|patch and compile the kernel as described above]]]. 2. Hal once you are sure that your kernel has the fixed keyboard patches applied, you can go ahead with configuring hal. You need to edit the following file:

/usr/share/hal/fdi/information/10freedesktop/30-keymap-misc.fdi

Find the section that looks like this:

<match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" contains_outof="NC10;SP55S;SQ45S70S;SX60P;SX30S;R59P/R60P/R61P;Q210;Q310;X05">

And add NC20; so that it looks like:

<match key="/org/freedesktop/Hal/devices/computer:system.hardware.product" contains_outof="NC10;NC20;SP55S;SQ45S70S;SX60P;SX30S;R59P/R60P/R61P;Q210;Q310;X05">

There is a bug raised against hal-info at the moment so this may or may not be fixed when you look at the file.

Wireless

THIS IS NOT NECESSARY IN KARMIC!

Driver installation (intrepid only)
  1. Deactivate the default drivers in System -> Administration -> Hardware.
  2. Install linux-backports-modules-intrepid:
sudo apt-get install linux-backports-modules-intrepid
  1. activate the atheros 5xxxx drivers in System -> Administration -> Hardware.
Set up the key bindings (Jaunty only)

THIS IS NOT NECESSARY IN KARMIC! This is one method and I'm not sure if it is the right thing to do but it works and you get the new notifications that come with Jaunty. Please note that you must have the nc20 added to hal as described above and you need to be running kernel 2.6.28-12 or later. /etc/acpi/wireless.sh does nothing under intrepid therefore this method does not work for intrepid. If someone knows how, please add the info here. 1. Map the keys The following commands alias the XF86WLAN that is generated by the FN+F9 key combination and link it to the /etc/acpi/wireless.sh script that is already present.

gconftool-2 -s --type string /apps/metacity/keybinding_commands/command_1 'sudo /etc/acpi/wireless.sh'

gconftool-2 -s --type string /apps/metacity/global_keybindings/run_command_1 XF86WLAN

2. Allow permissions... By default you would not be allowed to run the wireless.sh script without using sudo or gksudo and providing a password. To allow access to the script you have to create a rule in the sudoers file.

  • Open the sudoers file for editing. By default nano will be the editor that will open
sudo visudo
  • Add this line at the very bottom. It allows access to the script with no password.
%admin ALL=NOPASSWD: /etc/acpi/wireless.sh

Keys that work by default

Fn+F1 suspends to RAM out of the box Fn+F2 shows battery status in Gnome. Fn+Left (volume down) and Fn+Right (volume up) work out of the box. Fn+F6 (mute) works out of the box Fn+F10 enables or disables the touchpad out of the box.


Via Padlock


CPU Frequency Scaling

THIS IS NOT NECESSARY IN KARMIC! In intrepid, you need to [[UbuntuHelp:[intrepid_kernel|activate the module and recompile the kernel as described above]]]. If you don't want to recompile the whole kernel (in case you don't care about the wireless and brightness keys). There is a shortcut: <<Anchor(e_powersaver_shortcut)>>

Compiling the e_powersaver module (Intrepid only)

While not enabled by default in Jaunty the kernel module is present. So you can skip down to [[UbuntuHelp:[enable_e_powersaver|enabling e_powersaver]]]. For intrepid, you need to compile the e_powersaver module manually. There is a shortcut that avoids recompiling the whole kernel. Important: If you take this shortcut, do not enable the function keys in hal! Otherwise you will not be able to use your keyboard after using the function keys. So do not edit:

/usr/share/hal/fdi/information/10freedesktop/30-keymap-misc.fdi

First you need to get the kernel sources:

sudo apt-get build-dep linux-image-$(uname -r)
apt-get source linux-image-$(uname -r)

now switch to the new source directory and configure the kernel:

cd ~/linux-2.6.27
cp /boot/config-$(uname -r) ./.config
echo "CONFIG_X86_E_POWERSAVER=m" >> .config
make oldconfig

now we need the Module.symvers file from the linux-headers and then we can compile and install the modules:

cp /usr/src/linux-headers-$(uname -r)/Module.symvers ~/linux-2.6.27/
make clean
fakeroot make prepare
fakeroot make prepare scripts
fakeroot make M=arch/x86/kernel/cpu/cpufreq/
sudo cp arch/x86/kernel/cpu/cpufreq/*.ko /lib/modules/$(uname -r)/kernel/arch/x86/kernel/cpu/cpufreq/
sudo depmod -a

<<Anchor(enable_e_powersaver)>>

Enabling e_powersaver

After you have the module, add the module name to your /etc/modules file:

echo "e_powersaver" | sudo tee -a /etc/modules

After this you must reboot or load the module manually if you don't want to reboot straight away:

sudo modprobe e_powersaver

You can verify that this is working by adding the cpu frequency monitor applet to a gnome panel. Right-click on a panel, select 'Add to Panel' and finally select 'CPU Frequency Scaling Monitor'. The processor will vary from 851MHz to 1.7GHz. In Intrepid there seems to be a bug which requires the module to be reloaded at the end of boot. This can be done automatically via /etc/rc.local:

sudo gedit /etc/rc.local

now add these two lines before the exit 0

modprobe -r e_powersaver
modprobe e_powersaver

Microphone

THIS IS NOT NECESSARY IN KARMIC! Does not work out of the box but it fixed with Alsa version 1.0.20. After ALSA is installed select 'Mic' as the input source in the gnome volume control application. While this works, as of May 30 Skype will max out the cpu and the sound will appear distorted and stretched when using the internal microphone. It is recommended to use an external mic with Skype for now. It has been confirmed that only the driver needs to be upgraded to 1.0.20 for the microphone to function. These instructions|for the NC10 can be used as a guide to update the driver alone. Alternatively, there is a handy script available here that supports an auto-upgrade to 1.0.20 as of <<Date(2009-05-10T20:35:15-0135)>> This method will also update all of the other Alsa components. The command you need is the following where x.xx is the current revision of the script.

sudo AlsaUpgrade-1.0.x-rev-x.xx.sh -di

SD / MMC Card Reader

THIS IS NOT NECESSARY IN KARMIC! (not tested for intrepid) This fix should be considered as a preview or unstable version of what will most likely be incorporated into a future Linux kernel. I pulled the source out of a patch that was posted to the kernel mailing list by a VIA employee.

  • You will need to have the following packages installed to implement this fix
sudo apt-get install build-essential linux-headers-`uname -r`

1. Extract the files in the archive

tar zxf via-sdmmc.tar.gz && cd via-sdmmc

2. Compile the module

make

If you don't see any errors then you can install the module 3. Install the module

sudo make install

4. Test the module

sudo modprobe via-sdmmc

If all went ok then you can just insert a memory card and it should be auto mounted. 5. Set the module to autoload at startup.

If you want the card reader to be enabled automatically at startup you need to tell Ubuntu to load the module during the boot process. You can do this by adding the modle name to the /etc/modules file. Open that file with a text editor e.g.

sudo nano /etc/modules

and add the name of the module at the end of the file

via-sdmmc

External Resources / Handy Links


NC20 thread on Ubuntu Forums - Contains a wealth of information and is the source for much of this wiki entry. OpenChrome|Ubuntu Community Documentation - Contains information about how to download and install the openchrome driver and what kind of problems you will meet as a result of its incomplete DRI support.