2010-07-10

Slitaz -- Qtopia-x86/arm

qtopia-x86

qtopia-x86-480x640

qtopia-arm http://www.arm9.net/mini2440-linux.asp


# X86 Qtopia-2.2.0 [2010-01-13] - 內含編譯腳本build-all
# ARM Qtopia-2.2.0 [2010-01-13] - 包含所有移植好並改進的源代碼,和編譯腳本build-all


Extract from:

http://doc.qt.nokia.com/qtopia2.2/html/overview.html

Qtopia Overview

* Introduction
* Software Stack
* Qtopia's Qt/Embedded Configuration
* Qtopia, Qt Versions and Binary Compatibility
* Qtopia Platform
o Qtopia PIM Access Library

Introduction

Qtopia is a platform for embedded Linux devices that provides the end-user with a set of core applications such as PIM applications (Address Book, Calendar and Todo) and a Media Player.

Qtopia provides the developer with a clean object-oriented API to write applications for an embedded device. Most of the API presented to the developer is the same API offered by Trolltech for cross-platform development between Windows, Mac and the UNIX/Linux. The same code can be shared and reused on all of these desktop platforms and now Qtopia is just another platform to run Qt applications.

The Qtopia platform encompasses both the software that runs on an embedded device and the software that runs on a end-user desktop. The software that runs on the desktop, called Qtopia Desktop, allows the user to synchronize their data between the embedded device and the desktop. Qtopia Desktop has built-in versions of the PIM application found in Qtopia. Qtopia Desktop allows developers to write plug-ins to synchronize their information. Please refer to the Qtopia Desktop documentation for more information.
[..]

2010-07-09

Slitaz -- Qtopia-2.2.0

240x320

apps

480x640

Env: slitaz-3.0
root@slitaz-3:~# gcc -v
Using built-in specs.
Target: i486-pc-linux-gnu
Configured with: ../gcc-4.4.1/configure --prefix=/usr --libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-nls --enable-languages=c,c++,java --enable-shared --with-system-zlib --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-threads=posix --with-tune=i486 --enable-java-home --with-arch-directory=i386 --with-jvm-root-dir=/usr/lib/jvm/java-gcj --with-jvm-jar-dir=/usr/lib/jvm-exports/java-gcj --with-python-dir=/lib/python2.5/site-packages --with-x --enable-java-awt=gtk --enable-gtk-cairo --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu i486-pc-linux-gnu
Thread model: posix
gcc version 4.4.1 (GCC)
root@slitaz-3:~#

1. x86-qtopia-2.2.0_20100108.tgz
[http://www.friendlyarm.net/dl.php?file=x86-qtopia-2.2.0_20100108.tgz]

2. # tazpkg get-install jpeg-dev
# tazpkg get-install zlib-dev
# tazpkg get-install xorg-libX11-dev
# tazpkg get-install xorg-xextproto

3. edit x86-qtopia-2.2.0/qtopia/src/libraries/qtopia/backend/vobject.cpp
line #419

change
char *dot = strrchr(g,'.');
TO
char *dot = (char*)strrchr(g,'.');

4. edit x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/src/plugins/codecs/wavplugin/wavplugin.cpp
line #435

change
char *ext = strrchr( path.latin1(), '.' );
TO
char *ext = (char*)strrchr( path.latin1(), '.' );

5. REF x86-qtopia/build

6. Doc

file:///home/slitaz/wok/qtopia/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/doc/html/index.html

http://doc.qt.nokia.com/qtopia2.2/html/index.html


root@slitaz-3:/home/slitaz/wok/qtopia/x86-qtopia# ./run &
[1] 1404
root@slitaz-3:/home/slitaz/wok/qtopia/x86-qtopia# Using display 0
Warning: QSocket::writeBlock: Socket is not open
Warning: Unable to open /usr/share/zoneinfo/zone.tab
Warning: Timezone data must be installed at /usr/share/zoneinfo/
Warning: could not register server
Warning: Unable to open /usr/share/zoneinfo/zone.tab
Warning: Timezone data must be installed at /usr/share/zoneinfo/

root@slitaz-3:/home/slitaz/wok/qtopia/x86-qtopia# pwd
/home/slitaz/wok/qtopia/x86-qtopia
root@slitaz-3:/home/slitaz/wok/qtopia/x86-qtopia# ps ax | tail -7
1404 root /bin/sh ./run
1405 root qtopia-2.2.0-FriendlyARM/qt2/bin/qvfb -width 240 -height 320 -depth 16
1408 root qpe
1413 root /home/slitaz/wok/qtopia/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/image/opt/Qtopia/bin/qss -systemvolume 50
1414 root /home/slitaz/wok/qtopia/x86-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/image/opt/Qtopia/bin/quicklauncher
1426 root ps ax
1427 root tail -7
root@slitaz-3:/home/slitaz/wok/qtopia/x86-qtopia# ls -l /usr/share/zoneinfo
drwxr-xr-x 2 root root 4096 Apr 23 11:15 America
-rw-r--r-- 1 root root 2102 Sep 19 2009 CET
drwxr-xr-x 2 root root 4096 Apr 23 11:15 Europe
-rw-r--r-- 1 root root 118 Sep 19 2009 UTC
root@slitaz-3:/home/slitaz/wok/qtopia/x86-qtopia#
.

2010-07-08

Slitaz -- glx / vesa


# glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: Software Rasterizer

root@slitaz:~# glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: Software Rasterizer
root@slitaz:~# glxinfo | grep string
server glx vendor string: SGI
server glx version string: 1.2
client glx vendor string: SGI
client glx version string: 1.4
OpenGL vendor string: Mesa Project
OpenGL renderer string: Software Rasterizer
OpenGL version string: 2.1 Mesa 7.4.4
OpenGL shading language version string: 1.20
root@slitaz:~# lsmod | head -4
Module Size Used by Not tainted
drm 121736 0
agpgart 25980 1 drm
i2c_core 17468 1 drm
root@slitaz:~# glxgears
732 frames in 5.0 seconds = 146.347 FPS
800 frames in 5.0 seconds = 159.927 FPS
820 frames in 5.0 seconds = 163.925 FPS
819 frames in 5.0 seconds = 163.680 FPS
1536 frames in 5.0 seconds = 307.113 FPS
XIO: fatal IO error 104 (Connection reset by peer) on X server ":0.0"
after 11358 requests (10527 known processed) with 0 events remaining.
root@slitaz:~#

Summary - System information
-Computer-
Processor : 2x AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
Memory : 3244MB (111MB used)
Operating System : Slitaz GNU/Linux 3.0
User Name : root (Root Administrator)
Date/Time : Fri 09 Jul 2010 09:16:15 AM UTC
-Display-
Resolution : 1280x1024 pixels
OpenGL Renderer : Software Rasterizer
X11 Vendor : (null)
-Multimedia-
Audio Adapter : HDA-Intel - HDA NVidia
-Input Devices-
PC Speaker
BTC USB Multimedia Cordless Keyboard
BTC USB Multimedia Cordless Keyboard
DM-140GINK Demo DM-140GINK Demo
-Printers-
CUPS libraries cannot be found
-IDE Disks-
PIONEER DVD-RW DVR-K06RS
-SCSI Disks-
ATA WDC WD6400AAKS-2
Generic- Compact Flash

Slitaz -- dump_bios


root@slitaz:~# cat /usr/bin/dump_bios
#!/bin/sh

dd if=/dev/mem of=vbios.dmp bs=16384 skip=48 count=4

root@slitaz:~# tazpkg info 915resolution

Tazpkg information
================================================================================
Package : 915resolution
Version : 0.5.3
Category : system-tools
Short desc : Widescreen support; modify video BIOS of the 800 and 900 series Intel graphics chipsets
Maintainer : erjo@slitaz.org
Web site : http://915resolution.mango-lang.org/
================================================================================

root@slitaz:~# dump_bios 
4+0 records in
4+0 records out
root@slitaz:~# ls -l *.dmp
-rw-r--r-- 1 root root 65536 Jul 8 22:25 vbios.dmp
root@slitaz:~# hexdump -C vbios.dmp | head -20
00000000 55 aa 77 eb 4b 37 34 30 30 e9 4c 19 77 cc 56 49 |U.w.K7400.L.w.VI|
00000010 44 45 4f 20 0d 00 00 00 90 00 91 11 00 00 49 42 |DEO ..........IB|
00000020 4d 20 56 47 41 20 43 6f 6d 70 61 74 69 62 6c 65 |M VGA Compatible|
00000030 01 00 00 00 c0 11 b8 9a 30 35 2f 32 32 2f 30 37 |........05/22/07|
00000040 00 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 |................|
00000050 e9 90 11 00 62 14 90 32 ff cf ef 7f 00 10 00 80 |....b..2........|
00000060 ff ff ff 7f 00 00 00 80 22 00 a5 71 e9 2b b9 e9 |........"..q.+..|
00000070 32 b9 50 4d 49 44 6c 00 6f 00 00 00 00 a0 00 b0 |2.PMIDl.o.......|
00000080 00 b8 00 c0 00 33 06 1d db 00 02 00 48 57 45 41 |.....3......HWEA|
00000090 50 43 49 52 de 10 41 02 00 00 18 00 00 00 00 03 |PCIR..A.........|
000000a0 77 00 01 00 00 80 00 00 4e 56 49 44 49 41 20 47 |w.......NVIDIA G|
000000b0 65 46 6f 72 63 65 20 36 31 35 30 20 56 47 41 20 |eForce 6150 VGA |
000000c0 42 49 4f 53 0d 0a 00 4c 44 29 0d 0a 00 00 00 00 |BIOS...LD)......|
000000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000000f0 00 00 00 00 00 00 00 00 00 56 65 72 73 69 6f 6e |.........Version|
00000100 20 20 35 2e 35 31 2e 32 38 2e 35 36 2e 31 39 20 | 5.51.28.56.19 |
00000110 0d 0a 00 43 6f 70 79 72 69 67 68 74 20 28 43 29 |...Copyright (C)|
00000120 20 31 39 39 36 2d 32 30 30 35 20 4e 56 49 44 49 | 1996-2005 NVIDI|
00000130 41 20 43 6f 72 70 2e 0d 0a 00 00 00 ba 91 98 96 |A Corp..........|
root@slitaz:~# tazpkg search-pkgname dump_bios

Search result for file : dump_bios
================================================================================
915resolution

================================================================================
1 pkg(s) found with file : dump_bios

root@slitaz:~# tazpkg list-files 915resolution

Installed files with : 915resolution
================================================================================
/usr/bin/915resolution
/usr/bin/dump_bios
================================================================================
2 files installed with 915resolution.

root@slitaz:~#

Slitaz -- glx / nvidia-190.42




# glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: GeForce 6150 LE/PCI/SSE2/3DNOW!

2009-11-06 slitaz -- nvidia-190.42
[http://alanyih.blogspot.com/2009/11/slitaz-nvidia-19042.html]

root@slitaz:~# glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: GeForce 6150 LE/PCI/SSE2/3DNOW!
GL_NVX_conditional_render, GL_SGIS_generate_mipmap, GL_SGIS_texture_lod,
root@slitaz:~# glxinfo | grep string
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce 6150 LE/PCI/SSE2/3DNOW!
OpenGL version string: 2.1.2 NVIDIA 190.42
OpenGL shading language version string: 1.20 NVIDIA via Cg compiler
root@slitaz:~# glxgears
Running synchronized to the vertical refresh. The framerate should be
approximately 1/81332 the monitor refresh rate.
9999 frames in 5.0 seconds = 1999.630 FPS
10188 frames in 5.0 seconds = 2037.596 FPS
10211 frames in 5.0 seconds = 2042.021 FPS
11305 frames in 5.0 seconds = 2260.863 FPS
root@slitaz:~#

Summary - System information
-Computer-
Processor : 2x AMD Athlon(tm) 64 X2 Dual Core Processor 5200+
Memory : 3244MB (228MB used)
Operating System : Slitaz GNU/Linux 3.0
User Name : root (Root Administrator)
Date/Time : Fri 09 Jul 2010 12:27:31 AM UTC
-Display-
Resolution : 1680x1050 pixels
OpenGL Renderer : GeForce 6150 LE/PCI/SSE2/3DNOW!
X11 Vendor : (null)
-Multimedia-
Audio Adapter : HDA-Intel - HDA NVidia
-Input Devices-
PC Speaker
BTC USB Multimedia Cordless Keyboard
BTC USB Multimedia Cordless Keyboard
DM-140GINK Demo DM-140GINK Demo
-Printers-
CUPS libraries cannot be found
-IDE Disks-
PIONEER DVD-RW DVR-K06RS
-SCSI Disks-
ATA WDC WD6400AAKS-2
USB 2.0 Flash Disk
Generic- Compact Flash

2010-07-07

Slitaz -- glx / drirc / vblank

# LIBGL_DEBUG="verbose" glxinfo

libGL error:
Can't open configuration file /etc/drirc: No such file or directory.
libGL error:
Can't open configuration file /root/.drirc: No such file or directory.

root@slitaz-3:~# tazpkg info xorg-xdriinfo

Tazpkg information
================================================================================
Package : xorg-xdriinfo
Version : 1.0.2
Category : x-window
Short desc : Query configuration information of DRI drivers
Maintainer : pankso@slitaz.org
Depends : xorg-libX11
Suggested : nvidia
Web site : http://www.x.org/
================================================================================

root@slitaz-3:~# xdriinfo
Screen 0: i965
root@slitaz-3:~# cat .drirc



.drirc

<driconf>
<device screen="0" driver="i965">
<application name="all">
<!-- Always synchronize with vertical refresh to avoid tearing -->
<option name="vblank_mode" value="3"/>
</application>
<application name="glxgears" executable="glxgears">
<!-- glxgears should not synchronize with vertical refresh, show full fps -->
<option name="vblank_mode" value="0"/>

</application>
<application name="tuxracer" executable="tuxracer">
<!-- Tuxracer has some artifacts with hardware TCL -->
<option name="tcl_mode" value="0"/>
</application>
</device>
</driconf>


root@slitaz-3:~# LIBGL_DEBUG="verbose" glxinfo | head -12
libGL: XF86DRIGetClientDriverName: 1.9.0 i965 (screen 0)
libGL: OpenDriver: trying /usr/lib/dri/i965_dri.so
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 4, (OK)
drmOpenByBusid: Searching for BusID pci:0000:00:02.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 4, (OK)
drmOpenByBusid: drmOpenMinor returns 4
drmOpenByBusid: drmGetBusid reports pci:0000:00:02.0
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap,
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer,
GLX_OML_swap_method, GLX_SGI_swap_control, GLX_SGIS_multisample,
GLX_SGIX_fbconfig, GLX_SGIX_visual_select_group
client glx vendor string: SGI
client glx version string: 1.4
root@slitaz-3:~# glxgears
7531 frames in 5.0 seconds = 1506.082 FPS
7635 frames in 5.0 seconds = 1526.809 FPS
7633 frames in 5.0 seconds = 1526.469 FPS
7636 frames in 5.0 seconds = 1527.006 FPS
root@slitaz-3:~#

VS

root@slitaz-3:~# LIBGL_DEBUG="verbose" glxinfo | head -4
libGL: XF86DRIGetClientDriverName: 1.9.0 i965 (screen 0)
libGL: OpenDriver: trying /usr/lib/dri/i965_dri.so
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 4, (OK)
drmOpenByBusid: Searching for BusID pci:0000:00:02.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 4, (OK)
drmOpenByBusid: drmOpenMinor returns 4
drmOpenByBusid: drmGetBusid reports pci:0000:00:02.0
libGL error:
Can't open configuration file /etc/drirc: No such file or directory.
libGL error:
Can't open configuration file /root/.drirc: No such file or directory.

name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
root@slitaz-3:~# glxgears
Running synchronized to the vertical refresh. The framerate should be approximately the same as the monitor refresh rate.
301 frames in 5.0 seconds = 60.166 FPS
300 frames in 5.0 seconds = 59.903 FPS
300 frames in 5.0 seconds = 59.903 FPS
300 frames in 5.0 seconds = 59.899 FPS
300 frames in 5.0 seconds = 59.907 FPS
root@slitaz-3:~#

----

http://dri.freedesktop.org/wiki/ConfigurationInfrastructure

Extract from
Troubleshooting Intel graphics performance issues
[..]
Problem: Sync to VBlank

VBlank synchronization is an optimization technique that balances the output rate of your graphics card with the rate that your monitor displays images on the screen. Your monitor's refresh rate -- also called the vertical blanking interval (VBlank) -- is the maximum speed your monitor can present images. If your graphics card renders faster than this rate, the extra images are rendered for naught, as you'll never actually see them. So if your monitor's VBlank is 60 Hz, and your graphics card is rendering 1000 frames-per-second, then 940 frames are getting drawn for no purpose. So theory synchronizing the two makes a lot of sense.

HOWEVER, things are not so simple, and vblank syncing can actually make performance worse. For a deeper discussion, see http://www.tweakguides.com/Graphics_9.html

To turn off vblank sync, use any of the three methods:

1. Setting vblank using compizconfig-settings-manager: Go to System->Preferences-> Compiz config settings manager -> general options -> Display settings-> Sync to VBlank. Turn it to 'off'.

2. From the compiz gconf configuration:

sync_to_vblank = false

3. Via driconf: 'Synchronization with vertical refresh (swap intervals)' -> set to 'Never synchronize with vertical refresh'.
.

Slitaz -- glx / intel-g45/g43

virtualbox

HOST

# glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: Mesa DRI Intel(R) G45/G43 GEM 20090418 2009Q1 x86/MMX/SSE2

root@slitaz-3:~# tazpkg info mesa-demos

Tazpkg information
================================================================================
Package : mesa-demos
Version : 7.4.4
Category : development
Short desc : Mesa GLX demos progs.
Maintainer : pascal.bellard@slitaz.org
Suggested : nvidia
Wanted src : mesa
Web site : http://www.mesa3d.org/
================================================================================

root@slitaz-3:~# xdriinfo
Screen 0: i965
root@slitaz-3:~# glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: Mesa DRI Intel(R) G45/G43 GEM 20090418 2009Q1 x86/MMX/SSE2
root@slitaz-3:~# glxinfo | grep string
server glx vendor string: SGI
server glx version string: 1.2
client glx vendor string: SGI
client glx version string: 1.4
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) G45/G43 GEM 20090418 2009Q1 x86/MMX/SSE2
OpenGL version string: 2.0 Mesa 7.4.4
OpenGL shading language version string: 1.10
root@slitaz-3:~# glxgears
7267 frames in 5.0 seconds = 1453.307 FPS
7580 frames in 5.0 seconds = 1515.808 FPS
7237 frames in 5.0 seconds = 1447.290 FPS
7592 frames in 5.0 seconds = 1518.343 FPS
7568 frames in 5.0 seconds = 1513.597 FPS
7573 frames in 5.0 seconds = 1514.478 FPS
7509 frames in 5.0 seconds = 1501.655 FPS
root@slitaz-3:~#

Summary - System information

-Computer-
Processor : 2x Pentium(R) Dual-Core CPU E6300 @ 2.80GHz
Memory : 2039MB (176MB used)
Operating System : Slitaz GNU/Linux 3.0
User Name : root (Root Administrator)
Date/Time : Thu 08 Jul 2010 01:08:27 PM UTC
-Display-
Resolution : 1680x1050 pixels
OpenGL Renderer : Mesa DRI Intel(R) G45/G43 GEM 20090418 2009Q1 x86/MMX/SSE2
X11 Vendor : (null)
-Multimedia-
Audio Adapter : HDA-Intel - HDA Intel
-Input Devices-
PC Speaker
Logitech USB Receiver
Logitech USB Receiver
-Printers-
No printers found
-IDE Disks-
-SCSI Disks-
ATA ST3320620AS
ATAPI iHAS324 Y

2010-07-06

Slitaz -- webcam / fswevcam



fswebcam

fswebcam is a neat and simple webcam app. It captures images from a V4L1/V4L2 compatible device or file, averages them to reduce noise and draws a caption using the GD Graphics Library which also handles compressing the image to PNG or JPEG. The resulting image is saved to a file or sent to stdio where it can be piped to something like ncftpput or scp.

root@slitaz-3:~# ls ~/Images/*.jpg
/root/Images/20100706-22:05:00.jpg /root/Images/20100706-22:06:00.jpg
/root/Images/20100706-22:05:20.jpg /root/Images/20100706-22:06:20.jpg
/root/Images/20100706-22:05:40.jpg /root/Images/20100706-22:06:40.jpg
root@slitaz-3:~# tazpkg info fswebcam

Tazpkg information
================================================================================
Package : fswebcam
Version : 20070108
Category : misc
Short desc : Tiny and flexible webcam app
Maintainer : jozee@slitaz.org
Depends : libgd
Build deps : libgd-dev
Web site : http://www.firestorm.cx/fswebcam/
================================================================================

root@slitaz-3:~# cat /etc/fswebcam.conf
# Example configuration for fswebcam
# [2006-09-05: phil@firestorm.cx]

# USAGE: fswebcam -c /etc/fswebcam.conf
# Be very quiet...
#quiet

# Or be very loud?
verbose

# The image source - In this case we are capturing frames from a TV channel
device "v4l2:/dev/video0"
input 0
loop 20
skip 2 # Skip the first two frames.
frames 1
# And capture one.
#background
palette YUV420P
#palette YUYV
#palette MJPEG
#frequency 670.90
resolution 320x240
#resolution 768x576
set brightness=60%
set contrast=13%
# Scale the image down to half it's size.
#scale 384x288
top-banner
font "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf"
title "Quick Webcam"
timestamp "%d-%m-%Y %H:%M:%S (%Z)"
jpeg 95
save /root/Images/"%Y%m%d-%H:%M:%S".jpg
# Load an overlay image. This is placed above everything, including the banner.
#overlay "/home/user/outline.png"

root@slitaz-3:~#

root@slitaz-3:~# fswebcam -c /etc/fswebcam.conf
>>> Next image due: 2010-07-06 22:05:00 (UTC)
--- Opening v4l2:/dev/video0...
>>> Using 'v4l2' source module.
/dev/video0 opened.
src_v4l2_get_capability,81: /dev/video0 information:
src_v4l2_get_capability,82: cap.driver: "STV06xx"
src_v4l2_get_capability,83: cap.card: "Camera"
src_v4l2_get_capability,84: cap.bus_info: "usb-0000:00:1a.0-2"
src_v4l2_get_capability,85: cap.capabilities=0x05000001
src_v4l2_get_capability,86: - VIDEO_CAPTURE
src_v4l2_get_capability,95: - READWRITE
src_v4l2_get_capability,97: - STREAMING
src_v4l2_set_input,173: /dev/video0: Input 0 information:
src_v4l2_set_input,174: name = "STV06xx"
src_v4l2_set_input,175: type = 00000002
src_v4l2_set_input,177: - CAMERA
src_v4l2_set_input,178: audioset = 00000000
src_v4l2_set_input,179: tuner = 00000000
src_v4l2_set_input,180: status = 00000000
Setting Brightness to 18 (58%).
Setting Contrast to 1 (6%).
src_v4l2_set_pix_format,530: Device offers the following V4L2 pixel formats:
src_v4l2_set_pix_format,542: 0: RGB3 (RGB3)
src_v4l2_set_pix_format,542: 1: BGR3 (BGR3)
src_v4l2_set_pix_format,542: 2: YU12 (YU12)
src_v4l2_set_pix_format,542: 3: YV12 (YV12)
Using palette YUV420P
src_v4l2_set_mmap,648: mmap information:
src_v4l2_set_mmap,649: frames=4
src_v4l2_set_mmap,694: 0 length=16777216
src_v4l2_set_mmap,694: 1 length=16777216
src_v4l2_set_mmap,694: 2 length=16777216
src_v4l2_set_mmap,694: 3 length=16777216
--- Capturing frame...
Skipping 2 frames...
Capturing 1 frames..
.
Captured 3 frames in 0.22 seconds. (13 fps)
--- Processing captured image...
Putting banner at the top.
Setting font to /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf.
Setting title "Quick Webcam".
Setting timestamp "%d-%m-%Y %H:%M:%S (%Z)".
Setting output format to JPEG, quality 95
Writing JPEG image to '/root/Images/20100706-22:05:00.jpg'.
>>> Next image due: 2010-07-06 22:05:20 (UTC)
--- Opening v4l2:/dev/video0...
>>> Using 'v4l2' source module.
/dev/video0 opened.
src_v4l2_get_capability,81: /dev/video0 information:
src_v4l2_get_capability,82: cap.driver: "STV06xx"
src_v4l2_get_capability,83: cap.card: "Camera"
src_v4l2_get_capability,84: cap.bus_info: "usb-0000:00:1a.0-2"
src_v4l2_get_capability,85: cap.capabilities=0x05000001
src_v4l2_get_capability,86: - VIDEO_CAPTURE
src_v4l2_get_capability,95: - READWRITE
src_v4l2_get_capability,97: - STREAMING
src_v4l2_set_input,173: /dev/video0: Input 0 information:
src_v4l2_set_input,174: name = "STV06xx"
src_v4l2_set_input,175: type = 00000002
src_v4l2_set_input,177: - CAMERA
src_v4l2_set_input,178: audioset = 00000000
src_v4l2_set_input,179: tuner = 00000000
src_v4l2_set_input,180: status = 00000000
Setting Brightness to 18 (58%).
Setting Contrast to 1 (6%).
src_v4l2_set_pix_format,530: Device offers the following V4L2 pixel formats:
src_v4l2_set_pix_format,542: 0: RGB3 (RGB3)
src_v4l2_set_pix_format,542: 1: BGR3 (BGR3)
src_v4l2_set_pix_format,542: 2: YU12 (YU12)
src_v4l2_set_pix_format,542: 3: YV12 (YV12)
Using palette YUV420P
src_v4l2_set_mmap,648: mmap information:
src_v4l2_set_mmap,649: frames=4
src_v4l2_set_mmap,694: 0 length=16777216
src_v4l2_set_mmap,694: 1 length=16777216
src_v4l2_set_mmap,694: 2 length=16777216
src_v4l2_set_mmap,694: 3 length=16777216
--- Capturing frame...
Skipping 2 frames...
Capturing 1 frames...

Captured 3 frames in 0.19 seconds. (15 fps)
--- Processing captured image...
Putting banner at the top.
Setting font to /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf.
Setting title "Quick Webcam".
Setting timestamp "%d-%m-%Y %H:%M:%S (%Z)".
Setting output format to JPEG, quality 95
Writing JPEG image to '/root/Images/20100706-22:05:20.jpg'.
>>> Next image due: 2010-07-06 22:05:40 (UTC)

[..]
Writing JPEG image to '/root/Images/20100706-22:06:40.jpg'.
>>> Next image due: 2010-07-06 22:07:00 (UTC)
^CCaught signal SIGINT
Received TERM signal... exiting.
root@slitaz-3:~#

2010-07-02

Slitaz -- gtk-recordmydesktop


# tazpkg get-install pygtk
# tazpkg install gtk-recordmydesktop-0.3.7.2-4.fc11.tazpkg

root@slitaz-3:~# tazpkg info recordmydesktop

Tazpkg information
================================================================================
Package : recordmydesktop
Version : 0.3.7.3
Category : misc
Short desc : Desktop recording software
Maintainer : allan316@gmail.com
Depends : libtheora alsa-lib xorg-libICE xorg-libSM xorg-libX11 xorg-libXau xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes zlib
Build deps : alsa-lib-dev xorg-libICE-dev xorg-libSM-dev xorg-libXext-dev xorg-libXdamage-dev xorg-libXfixes-dev libogg-dev libvorbis-dev libtheora-dev
Web site : http://recordmydesktop.sourceforge.net
================================================================================

root@slitaz-3:~# tazpkg info gtk-recordmydesktop

Tazpkg information
================================================================================
Package : gtk-recordmydesktop
Version : 0.3.7.2-4.fc11
Category : misc
Short desc : GUI Desktop session recorder with audio and video
Maintainer : nobody@slitaz.org
Web site : http://recordmydesktop.iovar.org
================================================================================

root@slitaz-3:~# ls -l
-rw-r--r-- 1 root root 15515518 Jul 1 05:45 0630.ogv
root@slitaz-3:~# ls -l /tmp/rMD-session-1841
-rw-r--r-- 1 root root 24567808 Jul 1 05:41 audio.pcm
-rw-r--r-- 1 root root 194045832 Jul 1 05:41 img.out
-rw-r--r-- 1 root root 268 Jul 1 05:39 specs.txt
root@slitaz-3:~# cat /tmp/rMD-session-1841/specs.txt
recordMyDesktop = 0.3.7.3
Width = 1280
Height = 1024
Filename = 0630.ogv
FPS = 15.000000
NoSound = 0
Frequency = 44100
Channels = 2
BufferSize = 4096
SoundFrameSize = 4
PeriodSize = 2048
UsedJack = 0
v_bitrate = 45000
v_quality = 63
s_quality = 10
ZeroCompression = 1
root@slitaz-3:~#
.

2010-07-01

Slitaz -- ffmpeg / x11grab

352x288 (default)

1280x1024

1. install xorg-xextproto xorg-libXfixes-dev xorg-libXext-dev
# tazpkg get-install xorg-xextproto
# tazpkg get-install xorg-libXfixes-dev
# tazpkg get-install xorg-libXext-dev

2. enable-x11grab
edit /home/slitaz/wok/ffmpeg/receipt

# Rules to configure and make the package.
compile_rules()
{
cd $src
./configure \
--prefix=/usr \
--enable-gpl \
--arch=i486 \
--cpu=i486 \
--enable-shared \
--enable-small \
--enable-pthreads \
--enable-postproc \
--enable-x11grab \
--disable-mmx \
--disable-mmx2 \
--disable-ssse3 &&
make &&
make DESTDIR=$PWD/_pkg install
}

3. add -lXfixes
edit /home/slitaz/wok/ffmpeg/stuff/configure

[..]
line #2135
# deal with the X11 frame grabber
enabled x11grab &&
check_header X11/Xlib.h &&
check_header X11/extensions/XShm.h &&
check_func XOpenDisplay -lX11 &&
check_func XShmCreateImage -lX11 -lXext -lXfixes
[..]

root@slitaz-3:/home/slitaz/wok# tazpkg info ffmpeg

Tazpkg information
================================================================================
Package : ffmpeg
Version : 0.5
Category : multimedia
Short desc : Record, convert and stream audio and video.
Maintainer : pascal.bellard@slitaz.org
Depends : bzlib freetype imlib2 alsa-lib jack-audio-connection-kit zlib
Suggested : ffplay
Build deps : imlib2-dev freetype-dev libsdl-dev zlib-dev coreutils-file-format xorg-xextproto xorg-libXfixes-dev xorg-libXext-dev
Web site : http://ffmpeg.org/
================================================================================

root@slitaz-3:/home/slitaz/wok# tazpkg info ffplay

Tazpkg information
================================================================================
Package : ffplay
Version : 0.5
Category : multimedia
Short desc : Very simple and portable media player using the ffmpeg and the SDL library.
Maintainer : pascal.bellard@slitaz.org
Depends : ffmpeg libsdl
Wanted src : ffmpeg
Web site : http://ffmpeg.org/
================================================================================

root@slitaz-3:/home/slitaz/wok# ls -l ../packages/ff*
-rw-r--r-- 1 root root 1299204 Jul 2 09:19 ../packages/ffmpeg-0.5.tazpkg
-rw-r--r-- 1 root root 1411916 Jul 2 09:19 ../packages/ffmpeg-dev-0.5.tazpkg
-rw-r--r-- 1 root root 20468 Jul 2 09:19 ../packages/ffplay-0.5.tazpkg
root@slitaz-3:/home/slitaz/wok# ffmpeg -f x11grab -s cif -r 30 -i :0.0 /tmp/out.mpg
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --arch=i486 --cpu=i486 --enable-shared --enable-small --enable-pthreads --enable-postproc --enable-x11grab --disable-mmx --disable-mmx2 --disable-ssse3
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Jul 2 2010 09:18:59, gcc: 4.4.1
[x11grab @ 0x8062290]device: :0.0 -> display: :0.0 x: 0 y: 0 width: 352 height: 288
[x11grab @ 0x8062290]shared memory extension found
Input #0, x11grab, from ':0.0':
Duration: N/A, start: 1278063783.835441, bitrate: 97320 kb/s
Stream #0.0: Video: rawvideo, rgb32, 352x288, 97320 kb/s, 30 tbr, 1000k tbn, 30 tbc
Output #0, mpeg, to '/tmp/out.mpg':
Stream #0.0: Video: mpeg1video, yuv420p, 352x288, q=2-31, 200 kb/s, 90k tbn, 30 tbc
Stream mapping:
Stream #0.0 -> #0.0
Press [q] to stop encoding
frame= 1198 fps= 30 q=31.0 Lsize= 1650kB time=39.90 bitrate= 338.8kbits/s
video:1639kB audio:0kB global headers:0kB muxing overhead 0.642477%
root@slitaz-3:/home/slitaz/wok# ls -l /tmp/out.mpg
-rw-r--r-- 1 root root 1689600 Jul 2 09:43 /tmp/out.mpg
root@slitaz-3:/home/slitaz/wok# ffplay /tmp/out.mpg
FFplay version 0.5, Copyright (c) 2003-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --enable-gpl --arch=i486 --cpu=i486 --enable-shared --enable-small --enable-pthreads --enable-postproc --enable-x11grab --disable-mmx --disable-mmx2 --disable-ssse3
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Jul 2 2010 09:18:59, gcc: 4.4.1
root@slitaz-3:/home/slitaz/wok#

----

Unknown input or output format: x11grab (Ubuntu)
.

2010-06-29

Slitaz -- webcam


root@slitaz:~# export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so
root@slitaz:~# mplayer tv:// -tv driver=v4l2:width=320:height=240:device=/dev/video0 -vo x11

# tazpkg get-install linux-video
# tazpkg get-install libv4l
# tazpkg get-install v4l-dvb
# tazpkg get-install usbutils

root@slitaz:~# lsusb | grep -i logitech
Bus 003 Device 002: ID 046d:08f0 Logitech, Inc. QuickCam Messenger
Bus 004 Device 002: ID 046d:c517 Logitech, Inc. LX710 Cordless Desktop Laser

root@slitaz:~# tazhw detect-usb

Detected USB devices Kernel modules
================================================================================
Camera
sh: gspca_stv06xx: unknown operand
! Missing module: snd-usb-audio
gspca_stv06xx
quickcam_messenger
sed: unmatched '/'
================================================================================

root@slitaz:~# modprobe gspca_stv06xx
root@slitaz:~# modprobe snd-usb-audio
root@slitaz:~# lsmod | head
Module Size Used by Not tainted
snd_usb_audio 69944 0
gspca_stv06xx 20920 0
gspca_main 21112 1 gspca_stv06xx
videodev 32080 1 gspca_main
v4l1_compat 11120 1 videodev
i2c_core 17468 1 videodev
snd_usb_lib 13192 1 snd_usb_audio
snd_rawmidi 16920 1 snd_usb_lib
snd_seq_device 5544 1 snd_rawmidi
root@slitaz:~# dmesg | tail -12
STV06xx: Configuring camera
STV06xx: st6422 sensor detected
STV06xx: Initializing camera
input: STV06xx as /devices/pci0000:00/0000:00:1a.0/usb3/3-2/input/input3
gspca: video0 created
gspca: found int in endpoint: 0x82, buffer_len=1, interval=16
STV06xx: Probing for a stv06xx device
gspca: probing 046d:08f0
STV06xx: Probing for a stv06xx device
gspca: probing 046d:08f0
usbcore: registered new interface driver STV06xx
STV06xx: registered
root@slitaz:~# ls -l /dev/video*
crw-rw---- 1 root video 81, 0 Jun 29 22:35 /dev/video0
root@slitaz:~#
root@slitaz:~# export LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so
root@slitaz:~# tazhw setup webcam
COMMAND OPTIONS: webcam
installing pkg: hal-info
[..]
Installation of : mplayer-svn-30817
================================================================================
Copying mplayer-svn-30817... [ OK ]
Extracting mplayer-svn-30817... 6328 blocks
Extracting the pseudo fs... (lzma) 20478 blocks
Installing mplayer-svn... [ OK ]
Removing all tmp files... [ OK ]
================================================================================
mplayer-svn (30817) is installed.

root@slitaz:~# Creating config file: /root/.mplayer/config
MPlayer SVN-r30817-4.4.1 (C) 2000-2010 MPlayer Team
MMX supported but disabled
MMX2 supported but disabled
SSE supported but disabled
SSE2 supported but disabled

Playing tv://.
TV file format detected.
Selected driver: v4l2
name: Video 4 Linux 2 input
author: Martin Olschewski
comment: first try, more to come ;-)
v4l2: your device driver does not support VIDIOC_G_STD ioctl, VIDIOC_G_PARM was used instead.
Selected device: Camera
Capabilites: video capture read/write streaming
supported norms:
inputs: 0 = STV06xx;
Current input: 0
Current format: RGB24
tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
v4l2: ioctl enum norm failed: Invalid argument
Error: Cannot set norm!
Selected input hasn't got a tuner!
v4l2: Cannot get fps
v4l2: ioctl set mute failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
v4l2: ioctl query control failed: Invalid argument
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
Movie-Aspect is undefined - no prescaling applied.
VO: [x11] 320x240 => 320x240 Planar YV12
[swscaler @ 0x8e7df10]No accelerated colorspace conversion found from yuv420p to bgra.
[swscaler @ 0x8e7df10]using unscaled yuv420p -> bgra special converter
Selected video codec: [rawyv12] vfm: raw (RAW YV12)
==========================================================================
Audio: no sound
Starting playback...
libv4l2: error dequeuing buf: Invalid argument
v4l2: ioctl set mute failed: Invalid argument
v4l2: 170 frames successfully processed, 253 frames dropped.

Exiting... (Quit)
root@slitaz:~#

----
http://forum.slitaz.org/index.php/discussion/207/webcam-support-in-slitaz%3A-howto

http://cateee.net/lkddb/web-lkddb/USB_GSPCA.html

CONFIG_USB_GSPCA: GSPCA based webcams
General informations

The Linux kernel configuration item CONFIG_USB_GSPCA:

* prompt: GSPCA based webcams
* type: tristate
* depends on: CONFIG_VIDEO_V4L2
* defined in drivers/media/video/gspca/Kconfig
* found in Linux Kernels: from 2.6.27 release still available on 2.6.34 release
* module created: gspca_main
[..]

http://lxr.linux.no/#linux+v2.6.30.6/Documentation/video4linux/gspca.txt
LXR linux/Documentation/video4linux/gspca.txt History Print
1List of the webcams known by gspca.
2
3The modules are:
4 gspca_main main driver
5 gspca_xxxx subdriver module with xxxx as follows
6
7xxxx vend:prod
.

2010-06-27

Slitaz -- kernel module

Extract From
http://doc.slitaz.org/en:guides:bluetooth
[..]
At the moment I am writing this guide the rfcomm module of Slitaz is compiled without tty support. You can check if this is the case with the following commands:

root@slitaz:/home/tux# zcat /proc/config.gz | grep RFCOMM
CONFIG_BT_RFCOMM=m
# CONFIG_BT_RFCOMM_TTY is not set
root@slitaz:/home/tux#

If CONFIG_BT_RFCOMM_TTY is not =y you must recompile the module with tty support. Install linux-source:

tazpkg get-install linux-source

cd in /usr/src/linux-`uname -r`/ and give this command:

make CONFIG_BT_RFCOMM=m CONFIG_BT_RFCOMM_TTY=y M=net/bluetooth/rfcomm

This will build only the rfcomm module with tty support. You will find it in /usr/src/linux-`uname -r`/net/bluetooth/rfcomm/rfcomm.ko. Now you can delete the old rfcomm module and replace it with your module:

rm /lib/modules/`uname -r`/kernel/net/bluetooth/rfcomm/rfcomm.ko.gz
cp /usr/src/linux-`uname -r`/net/bluetooth/rfcomm/rfcomm.ko /lib/modules/`uname -r`/kernel/net/bluetooth/rfcomm/
depmod -a
[..]

2010-06-23

Slitaz -- gtkam / gphoto2



gtkam is a graphical application based on GTK+ for digital still cameras supported by gphoto2. (http://www.gphoto.org/)

Introducing gPhoto2

gPhoto2 is a free, redistributable, ready to use set of digital camera software applications for Unix-like systems, written by a whole team of dedicated volunteers around the world. It supports more than 1200 cameras
[..]
Newer libgphoto2 versions also support Media Transfer Protocol (MTP) based media players since their communications protocol is based on the Picture Transfer Protocol (PTP).

gtkam-0.1.12-2.4.tazpkg
libexif-gtk5-0.3.5-3+b1.tazpkg

root@slitaz-3:~# tazpkg info gtkam

Tazpkg information
================================================================================
Package : gtkam
Version : 0.1.12-2.4
Category : misc
Short desc : GTK+ application for digital still cameras
Maintainer : nobody@slitaz.org
Depends : atk cairo-xcb expat fontconfig freetype glib gtk+ libexif libgio libgphoto2 libpng libtool libusb libusb-compat libxcb pango pixman xcb-util xorg-libX11 xorg-libXau xorg-libXcomposite xorg-libXcursor xorg-libXdamage xorg-libXdmcp xorg-libXext xorg-libXfixes xorg-libXi xorg-libXinerama xorg-libXrandr xorg-libXrender zlib
Web site : http://packages.debian.org/search?keywords=gtkam
================================================================================

root@slitaz-3:~# lsusb -v
[..]
Bus 001 Device 008: ID 040a:0597 Kodak Co. Digital Camera
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x040a Kodak Co.
idProduct 0x0597 Digital Camera
bcdDevice 1.00
iManufacturer 1 Eastman Kodak Company
iProduct 2 KODAK EASYSHARE V1073 Digital Camera
iSerial 3 xxxxxx
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 39
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 3
bInterfaceClass 6 Imaging
bInterfaceSubClass 1 Still Image Capture
bInterfaceProtocol 1 Picture Transfer Protocol (PIMA 15470)
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 16
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0001
Self Powered

2010-06-19

Slitaz -- hibernate / STD


# echo shutdown > /sys/power/disk
# echo disk > /sys/power/state

suspend to disk (STD)
suspend to RAM (STR)

shutdown: save state in linux, then tell bios to powerdown
platform: save state in linux, then tell bios to powerdown and blink
"suspended led"

"platform" is actually right thing to do where supported, but
"shutdown" is most reliable (except on ACPI systems).

Hibernation (aka 'suspend to disk') (HIBERNATION)

Enable the suspend to disk (STD) functionality, which is usually
called "hibernation" in user interfaces. STD checkpoints the
system and powers it off; and restores that checkpoint on reboot.

You can suspend your machine with 'echo disk > /sys/power/state'
after placing resume=/dev/swappartition on the kernel command line
in your bootloader's configuration file.

Alternatively, you can use the additional userland tools available
from [http://suspend.sf.net].

In principle it does not require ACPI or APM, although for example
ACPI will be used for the final steps when it is available. One
of the reasons to use software suspend is that the firmware hooks
for suspend states like suspend-to-RAM (STR) often don't work very
well with Linux.

It creates an image which is saved in your active swap. Upon the next
boot, pass the 'resume=/dev/swappartition' argument to the kernel to
have it detect the saved image, restore memory state from it, and
continue to run as before. If you do not want the previous state to
be reloaded, then use the 'noresume' kernel command line argument.
Note, however, that fsck will be run on your filesystems and you will
need to run mkswap against the swap partition used for the suspend.

It also works with swap files to a limited extent (for details see
[file:Documentation/power/swsusp-and-swap-files.txt]).

Right now you may boot without resuming and resume later but in the
meantime you cannot use the swap partition(s)/file(s) involved in
suspending. Also in this case you must not use the filesystems
that were mounted before the suspend. In particular, you MUST NOT
MOUNT any journaled filesystems mounted before the suspend or they
will get corrupted in a nasty way.

For more information take a look at [file:Documentation/power/swsusp.txt].


/usr/src/linux-2.6.30.6-slitaz/Documentation/power/basic-pm-debugging.txt

basic-pm-debugging.txt

Debugging hibernation and suspend
(C) 2007 Rafael J. Wysocki , GPL

1. Testing hibernation (aka suspend to disk or STD)

To check if hibernation works, you can try to hibernate in the "reboot" mode:

# echo reboot > /sys/power/disk
# echo disk > /sys/power/state

and the system should create a hibernation image, reboot, resume and get back to
the command prompt where you have started the transition. If that happens,
hibernation is most likely to work correctly. Still, you need to repeat the
test at least a couple of times in a row for confidence. [This is necessary,
because some problems only show up on a second attempt at suspending and
resuming the system.] Moreover, hibernating in the "reboot" and "shutdown"
modes causes the PM core to skip some platform-related callbacks which on ACPI
systems might be necessary to make hibernation work. Thus, if you machine fails
to hibernate or resume in the "reboot" mode, you should try the "platform" mode:

# echo platform > /sys/power/disk
# echo disk > /sys/power/state

which is the default and recommended mode of hibernation.

Unfortunately, the "platform" mode of hibernation does not work on some systems
with broken BIOSes. In such cases the "shutdown" mode of hibernation might
work:

# echo shutdown > /sys/power/disk
# echo disk > /sys/power/state

(it is similar to the "reboot" mode, but it requires you to press the power
button to make the system resume).

If neither "platform" nor "shutdown" hibernation mode works, you will need to
identify what goes wrong.

a) Test modes of hibernation

To find out why hibernation fails on your system, you can use a special testing
facility available if the kernel is compiled with CONFIG_PM_DEBUG set. Then,
there is the file /sys/power/pm_test that can be used to make the hibernation
core run in a test mode. There are 5 test modes available:

freezer
- test the freezing of processes

devices
- test the freezing of processes and suspending of devices

platform
- test the freezing of processes, suspending of devices and platform
global control methods(*)

processors
- test the freezing of processes, suspending of devices, platform
global control methods(*) and the disabling of nonboot CPUs

core
- test the freezing of processes, suspending of devices, platform global
control methods(*), the disabling of nonboot CPUs and suspending of
platform/system devices

(*) the platform global control methods are only available on ACPI systems
and are only tested if the hibernation mode is set to "platform"

To use one of them it is necessary to write the corresponding string to
/sys/power/pm_test (eg. "devices" to test the freezing of processes and
suspending devices) and issue the standard hibernation commands. For example,
to use the "devices" test mode along with the "platform" mode of hibernation,
you should do the following:

# echo devices > /sys/power/pm_test
# echo platform > /sys/power/disk
# echo disk > /sys/power/state

Then, the kernel will try to freeze processes, suspend devices, wait 5 seconds,
resume devices and thaw processes. If "platform" is written to
/sys/power/pm_test , then after suspending devices the kernel will additionally
invoke the global control methods (eg. ACPI global control methods) used to
prepare the platform firmware for hibernation. Next, it will wait 5 seconds and
invoke the platform (eg. ACPI) global methods used to cancel hibernation etc.

Writing "none" to /sys/power/pm_test causes the kernel to switch to the normal
hibernation/suspend operations. Also, when open for reading, /sys/power/pm_test
contains a space-separated list of all available tests (including "none" that
represents the normal functionality) in which the current test level is
indicated by square brackets.

Generally, as you can see, each test level is more "invasive" than the previous
one and the "core" level tests the hardware and drivers as deeply as possible
without creating a hibernation image. Obviously, if the "devices" test fails,
the "platform" test will fail as well and so on. Thus, as a rule of thumb, you
should try the test modes starting from "freezer", through "devices", "platform"
and "processors" up to "core" (repeat the test on each level a couple of times
to make sure that any random factors are avoided).

If the "freezer" test fails, there is a task that cannot be frozen (in that case
it usually is possible to identify the offending task by analysing the output of
dmesg obtained after the failing test). Failure at this level usually means
that there is a problem with the tasks freezer subsystem that should be
reported.

If the "devices" test fails, most likely there is a driver that cannot suspend
or resume its device (in the latter case the system may hang or become unstable
after the test, so please take that into consideration). To find this driver,
you can carry out a binary search according to the rules:
- if the test fails, unload a half of the drivers currently loaded and repeat
(that would probably involve rebooting the system, so always note what drivers
have been loaded before the test),
- if the test succeeds, load a half of the drivers you have unloaded most
recently and repeat.

Once you have found the failing driver (there can be more than just one of
them), you have to unload it every time before hibernation. In that case please
make sure to report the problem with the driver.

It is also possible that the "devices" test will still fail after you have
unloaded all modules. In that case, you may want to look in your kernel
configuration for the drivers that can be compiled as modules (and test again
with these drivers compiled as modules). You may also try to use some special
kernel command line options such as "noapic", "noacpi" or even "acpi=off".

If the "platform" test fails, there is a problem with the handling of the
platform (eg. ACPI) firmware on your system. In that case the "platform" mode
of hibernation is not likely to work. You can try the "shutdown" mode, but that
is rather a poor man's workaround.

If the "processors" test fails, the disabling/enabling of nonboot CPUs does not
work (of course, this only may be an issue on SMP systems) and the problem
should be reported. In that case you can also try to switch the nonboot CPUs
off and on using the /sys/devices/system/cpu/cpu*/online sysfs attributes and
see if that works.

If the "core" test fails, which means that suspending of the system/platform
devices has failed (these devices are suspended on one CPU with interrupts off),
the problem is most probably hardware-related and serious, so it should be
reported.

A failure of any of the "platform", "processors" or "core" tests may cause your
system to hang or become unstable, so please beware. Such a failure usually
indicates a serious problem that very well may be related to the hardware, but
please report it anyway.

b) Testing minimal configuration

If all of the hibernation test modes work, you can boot the system with the
"init=/bin/bash" command line parameter and attempt to hibernate in the
"reboot", "shutdown" and "platform" modes. If that does not work, there
probably is a problem with a driver statically compiled into the kernel and you
can try to compile more drivers as modules, so that they can be tested
individually. Otherwise, there is a problem with a modular driver and you can
find it by loading a half of the modules you normally use and binary searching
in accordance with the algorithm:
- if there are n modules loaded and the attempt to suspend and resume fails,
unload n/2 of the modules and try again (that would probably involve rebooting
the system),
- if there are n modules loaded and the attempt to suspend and resume succeeds,
load n/2 modules more and try again.

Again, if you find the offending module(s), it(they) must be unloaded every time
before hibernation, and please report the problem with it(them).

c) Advanced debugging

In case that hibernation does not work on your system even in the minimal
configuration and compiling more drivers as modules is not practical or some
modules cannot be unloaded, you can use one of the more advanced debugging
techniques to find the problem. First, if there is a serial port in your box,
you can boot the kernel with the 'no_console_suspend' parameter and try to log
kernel messages using the serial console. This may provide you with some
information about the reasons of the suspend (resume) failure. Alternatively,
it may be possible to use a FireWire port for debugging with firescope
(ftp://ftp.firstfloor.org/pub/ak/firescope/). On x86 it is also possible to
use the PM_TRACE mechanism documented in Documentation/s2ram.txt .

2. Testing suspend to RAM (STR)

To verify that the STR works, it is generally more convenient to use the s2ram
tool available from http://suspend.sf.net and documented at
http://en.opensuse.org/s2ram . However, before doing that it is recommended to
carry out STR testing using the facility described in section 1.

Namely, after writing "freezer", "devices", "platform", "processors", or "core"
into /sys/power/pm_test (available if the kernel is compiled with
CONFIG_PM_DEBUG set) the suspend code will work in the test mode corresponding
to given string. The STR test modes are defined in the same way as for
hibernation, so please refer to Section 1 for more information about them. In
particular, the "core" test allows you to test everything except for the actual
invocation of the platform firmware in order to put the system into the sleep
state.

Among other things, the testing with the help of /sys/power/pm_test may allow
you to identify drivers that fail to suspend or resume their devices. They
should be unloaded every time before an STR transition.

Next, you can follow the instructions at http://en.opensuse.org/s2ram to test
the system, but if it does not work "out of the box", you may need to boot it
with "init=/bin/bash" and test s2ram in the minimal configuration. In that
case, you may be able to search for failing drivers by following the procedure
analogous to the one described in section 1. If you find some failing drivers,
you will have to unload them every time before an STR transition (ie. before
you run s2ram), and please report the problems with them.


/usr/src/linux-2.6.30.6-slitaz/Documentation/power/swsusp.txt
[..]
You need to append resume=/dev/your_swap_partition to kernel command
line. Then you suspend by

echo shutdown > /sys/power/disk; echo disk > /sys/power/state

. If you feel ACPI works pretty well on your system, you might try

echo platform > /sys/power/disk; echo disk > /sys/power/state

. If you have SATA disks, you'll need recent kernels with SATA suspend
support. For suspend and resume to work, make sure your disk drivers
are built into kernel -- not modules. [There's way to make
suspend/resume with modular disk drivers, see FAQ, but you probably
should not do that.]

If you want to limit the suspend image size to N bytes, do

echo N > /sys/power/image_size

before suspend (it is limited to 500 MB by default).
[..]
Q: What is the difference between "platform" and "shutdown"?

A:

shutdown: save state in linux, then tell bios to powerdown

platform: save state in linux, then tell bios to powerdown and blink
"suspended led"

"platform" is actually right thing to do where supported, but
"shutdown" is most reliable (except on ACPI systems).

[..]

2010-06-18

Slitaz -- hibernate

Env:
slitaz-3.0.iso in HD
pm-utils

五 6月 18 19:06:43 CST 2010: performing hibernate
六 6月 19 09:42:24 CST 2010: Awake.
六 6月 19 09:42:24 CST 2010: Running hooks for thaw

root@slitaz:~# tazpkg info pm-utils

Tazpkg information
================================================================================
Package : pm-utils
Version : 1.2.5
Category : system-tools
Short desc : scripts that handle suspend and resume on behalf of HAL.
Maintainer : domcox@users.sourceforge.net
Depends : hal-info
Web site : http://pm-utils.freedesktop.org/
================================================================================

root@slitaz:~# cat /proc/cmdline
root=/dev/sda7 acpi=off resume=/dev/sda6
root@slitaz:~# grep sda6 /proc/partitions
8 6 10450251 sda6
root@slitaz:~# ls -l /sys/power
-rw-r--r-- 1 root root 4096 Jun 18 08:26 disk
-rw-r--r-- 1 root root 4096 Jun 18 08:27 image_size
-rw-r--r-- 1 root root 4096 Jun 18 08:27 resume
-rw-r--r-- 1 root root 4096 Jun 18 19:06 state
root@slitaz:~# cat /sys/power/*
test testproc [shutdown] reboot
524288000
8:6
disk
root@slitaz:~#

root@slitaz:~# cat /var/log/pm-suspend.log
Initial commandline parameters:
五 6月 18 19:06:43 CST 2010: Running hooks for hibernate.
/usr/lib/pm-utils/sleep.d/00auto-quirk hibernate hibernate: Adding quirks from HAL: --quirk-dpms-on --quirk-dpms-suspend --quirk-vbe-post --quirk-vbemode-restore --quirk-vbestate-restore --quirk-vga-mode-3
success.
/usr/lib/pm-utils/sleep.d/00logging hibernate hibernate: Linux slitaz 2.6.30.6-slitaz #1 SMP Sun Mar 28 16:39:51 CEST 2010 i686 unknown

Module Size Used by Not tainted
rtc 9136 0
vboxnetadp 6444 0
vboxnetflt 14688 0
vboxdrv 156152 2 vboxnetadp,vboxnetflt
tg3 93600 0
libphy 16236 1 tg3
snd_hda_codec_realtek 179412 1
snd_hda_intel 22020 1
snd_hda_codec 49928 2 snd_hda_codec_realtek,snd_hda_intel
snd_hwdep 5988 1 snd_hda_codec
snd_pcm 51780 2 snd_hda_intel,snd_hda_codec
snd_timer 16344 1 snd_pcm
snd 43584 8 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm,snd_timer
soundcore 5180 1 snd
snd_page_alloc 7256 2 snd_hda_intel,snd_pcm
total used free shared buffers
Mem: 2039472 584508 1454964 0 109332
Swap: 10450240 0 10450240
Total: 12489712 584508 11905204
success.
/usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate: not executable.
/usr/lib/pm-utils/sleep.d/01grub hibernate hibernate: not executable.
/usr/lib/pm-utils/sleep.d/49bluetooth hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/55NetworkManager hibernate hibernate: success.
/usr/lib/pm-utils/sleep.d/75modules hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/90clock hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq hibernate hibernate: success.
/usr/lib/pm-utils/sleep.d/95led hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/98smart-kernel-video hibernate hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/99video hibernate hibernate: /usr/lib/pm-utils/sleep.d/99video: line 219: fgconsole: not found
success.
五 6月 18 19:06:43 CST 2010: performing hibernate
六 6月 19 09:42:24 CST 2010: Awake.
六 6月 19 09:42:24 CST 2010: Running hooks for thaw
/usr/lib/pm-utils/sleep.d/99video thaw hibernate: BusyBox v1.12.0 (2010-03-12 18:25:03 CET) multi-call binary

Usage: chvt N

Change the foreground virtual terminal to /dev/ttyN

deallocvt: VT_DISALLOCATE: Device or resource busy
Returned exit code 1.
/usr/lib/pm-utils/sleep.d/98smart-kernel-video thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/95led thaw hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/94cpufreq thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/90clock thaw hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/75modules thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/55NetworkManager thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/49bluetooth thaw hibernate: not applicable.
/usr/lib/pm-utils/sleep.d/01grub thaw hibernate: not executable.
/usr/lib/pm-utils/sleep.d/00powersave thaw hibernate: not executable.
/usr/lib/pm-utils/sleep.d/00logging thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/00auto-quirk thaw hibernate: success.
root@slitaz:~#

2010-06-16

Slitaz -- gcin / help

gcin 使用手冊 (README.html)

root@slitaz:~# ls -l /usr/share/doc/gcin-1.4.9
-rw-r--r-- 1 root root 79789 Jun 17 00:58 Changelog.html
-rw-r--r-- 1 root root 56213 Jun 17 00:58 README.html
root@slitaz:~# cat /usr/share/gcin/script/html-browser
#!/bin/bash

#for i in firefox mozilla-firefox mozilla konqueror
for i in firefox mozilla-firefox mozilla konqueror midori opera
do
which $i >& /dev/null
if [ $? = 0 ]; then
UTF8ED=$i
break
fi
done

export LC_CTYPE=zh_TW.UTF-8
export LC_ALL=zh_TW.UTF-8

$UTF8ED $1
root@slitaz:~# cat /usr/share/gcin/script/utf8-edit
#!/bin/bash

PATH=$PATH:/opt/gnome/bin:/usr/local/bin

for i in madedit gedit leafpad kedit kate gvim
do
which $i >& /dev/null
if [ $? = 0 ]; then
UTF8ED=$i
break
fi
done

export LC_CTYPE=zh_TW.UTF-8
export LC_ALL=zh_TW.UTF-8

if [ $UTF8ED = 'gvim' ]; then
UTF8ED='gvim -f'
fi

$UTF8ED $1
root@slitaz:~#
.

Slitaz -- gcin-1.4.9


# mkdir -p /usr/lib/qt4/bin
# ln -fs /usr/bin/moc /usr/lib/qt4/bin/.

root@slitaz:~# tazpkg info gcin

Tazpkg information
================================================================================
Package : gcin
Version : 1.4.9
Category : utilities
Short desc : a GTK+ based input method platform for Chinese users
Maintainer : alanyih
Depends : xorg-libXtst bash
Build deps : bash gtk+-dev xorg-xextproto xorg-inputproto Qt4-dev
Web site : http://cle.linux.org.tw/trac
================================================================================

root@slitaz:~#


[..]
Building gcin with the receipt...
================================================================================

Executing strip on all files... [ OK ]
Copying the receipt... [ OK ]
Creating the list of files... [ OK ]
Creating md5sum of files... [ OK ]
Compressing the fs...
LZMA 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06
11782 blocks
[ OK ]
Updating receipt sizes... [ OK ]
Creating full cpio archive... 2867 blocks
[ OK ]
Restoring original package tree... 11782 blocks
================================================================================
Package gcin (1.4.9) generated.
Size : 1.4M /home/slitaz/packages/gcin-1.4.9.tazpkg

root@slitaz:/home/slitaz/wok#
.

2010-06-15

Slitaz -- smplayer / vob


root@slitaz:~# tazpkg info smplayer

Tazpkg information
================================================================================
Package : smplayer
Version : 0.6.8
Category : multimedia
Short desc : QT-based front-end for MPlayer
Maintainer : jozee@slitaz.org
Depends : mplayer-svn libQtCore libQtGui libQtXml gcc-lib-base
Build deps : mplayer-svn Qt4-dev qmake libQtCore libQtGui libQtXml libQtNetwork
Web site : http://smplayer.sourceforge.net/
================================================================================

root@slitaz:~# head -6 ~/.config/smplayer/smplayer.ini
[%General]
mplayer_bin=mplayer
driver\vo=x11
driver\ao=alsa
use_screenshot=true
screenshot_directory=/root/.config/smplayer/screenshots
root@slitaz:~#
.

2010-06-11

Slitaz -- virtualbox-3.2.0 / slitaz-vbox.iso

tazlito emu-iso ( default -m 256 )

Qemu -m 512

tazlito emu-iso ( -m 512 )

slitaz-vbox.iso: based on slitaz-3.0.iso + virtualbox-3.2.0 + guestadditions + wenquanyi_10pt.pcf

# sed -i "s/-m 256/-m 512/" /etc/tazlito/tazlito.conf

root@slitaz:/home/slitaz/distro# ls -l
drwxr-xr-x 4 root root 4096 Jun 10 12:37 rootcd
drwxr-xr-x 16 root root 4096 Jun 10 12:37 rootfs
root@slitaz:/home/slitaz/distro# time tazlito gen-initiso

0 bytes saved in duplicate files.
Generating lzma'ed initramfs...
LZMA 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06

Filesystem size: 78.1M 486033 blocks
78.9M

Computing md5... [ OK ]

Generating ISO image
================================================================================
Generating slitaz-201006111311.iso
Size of boot image is 4 sectors -> No emulation
12.00% done, estimate finish Fri Jun 11 13:14:45 2010
24.02% done, estimate finish Fri Jun 11 13:14:45 2010
36.00% done, estimate finish Fri Jun 11 13:14:45 2010
48.01% done, estimate finish Fri Jun 11 13:14:45 2010
59.99% done, estimate finish Fri Jun 11 13:14:45 2010
72.01% done, estimate finish Fri Jun 11 13:14:45 2010
83.98% done, estimate finish Fri Jun 11 13:14:45 2010
96.00% done, estimate finish Fri Jun 11 13:14:45 2010
Total translation table size: 2048
Total rockridge attributes bytes: 5420
Total directory bytes: 12288
Path table size(bytes): 64
Max brk space used 21000
41678 extents written (81 MB)
Creating hybrid ISO... [ OK ]
Creating the ISO md5sum... [ OK ]
================================================================================

Distro statistics (/home/slitaz/distro)
================================================================================
Build date : 20100611 at 13:14:45
Packages : 212
Rootfs size : 257.5M
Initramfs size : 78.9M
ISO image size : 82.1M
================================================================================
Image is ready: slitaz-201006111311.iso

real 3m 3.44s
user 2m 56.55s
sys 0m 4.66s
root@slitaz:/home/slitaz/distro# ls -l
drwxr-xr-x 4 root root 4096 Jun 10 12:37 rootcd
drwxr-xr-x 16 root root 4096 Jun 10 12:37 rootfs
-rw-r--r-- 1 root root 85983232 Jun 11 13:14 slitaz-201006111311.iso
-rw-r--r-- 1 root root 58 Jun 11 13:14 slitaz-201006111311.md5
root@slitaz:/home/slitaz/distro# tazlito emu-iso slitaz-201006111311.iso &
root@slitaz:/home/slitaz/distro#
Starting Qemu emulator:

qemu -m 256 slitaz-201006111311.iso


root@slitaz:/home/slitaz/distro# qemu -m 512 -cdrom slitaz-201006111311.iso &
root@slitaz:/home/slitaz/distro#
root@slitaz:/home/slitaz/distro# tail -2 /etc/tazlito/tazlito.conf
# Qemu emulator options for command: emu-iso
QEMU_OPTS="-m 256"
root@slitaz:/home/slitaz/distro# sed -i "s/-m 256/-m 512/" /etc/tazlito/tazlito.conf
root@slitaz:/home/slitaz/distro# tail -2 /etc/tazlito/tazlito.conf
# Qemu emulator options for command: emu-iso
QEMU_OPTS="-m 512"
root@slitaz:/home/slitaz/distro# tazlito
SliTaz Live Tool - Version: 3.0

Usage: tazlito [command] [list|iso|flavor|compression] [dir|iso]
Commands:

usage Print this short usage.
stats View Tazlito and distro configuration statistics.
gen-config Generate a new configuration file for a distro.
configure Configure the main config file or a specific tazlito.conf.
gen-iso Generate a new ISO from a distro tree.
gen-initiso Generate a new initramfs and ISO from the distro tree.
list-flavors List all available package lists on the mirror.
gen-flavor Generate a new live-CD description.
gen-liveflavor Generate a live-CD description from current system.
show-flavor Show live-CD description.
get-flavor Get a flavor's list of packages.
upgrade-flavor Update package list to the latest available versions.
extract-flavor Extract a (*.flavor) flavor into /home/slitaz/flavors.
pack-flavor Pack (and update) a flavor from /home/slitaz/flavors.
check-list Check a distro-packages.list for updates.
extract-distro Extract an ISO to a directory and rebuild LiveCD tree.
gen-distro Generate a Live distro and ISO from a list of packages.
clean-distro Remove all files generated by gen-distro.
check-distro Help to check if distro is ready to release.
writeiso Use running system to generate a bootable ISO (with /home).
merge Merge multiple rootfs into one iso.
repack Recompress rootfs into iso with maximum ratio.
build-loram Generate a live-CD for low ram systems.
frugal-install Frugal install in /boot/frugal from a distro or ISO.
emu-iso Emulate an ISO image with Qemu.
burn-iso Burn ISO image to a cdrom using Wodim.

root@slitaz:/home/slitaz/distro#

2010-06-08

Slitaz -- review / youtube



http://www.youtube.com/watch?v=y1a8_J8KDEU
OSGUIShow — April 13, 2010 — Review style Screencast about SliTaz GNU/Linux 3.0 a small fast 30MB Free Operating System. The OS has the Openbox with Joe's Window Manager GUI and I created the demonstration inside VirtualBox where I play with the environment and its software.
Original video production by the http://www.OSGUI.com Tech Show.

Fast Video Download (with SearchMenu) 3.0.8
by Bill Dettering
Download video files from popular sites like YouTube, Dailymotion, Break.com and more. 100% Free! In addition, our new SearchMenu feature makes it easier than ever to find popular videos and other information about any text you select.
https://addons.mozilla.org/en-US/firefox/addon/3590/

root@slitaz:~# cat /usr/share/applications/watchvideo.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Watch Video
Icon=applications-multimedia
Exec=default-app gmplayer --install "mplayer-svn get-flash-plugin gecko-mediaplayer"
Type=Application
Categories=Multimedia;AudioVideo;Audio;Player;
root@slitaz:~#