LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 7501|回复: 37

xdirectfb快速指南

[复制链接]
发表于 2004-4-11 10:13:21 | 显示全部楼层 |阅读模式
随便写写

0. 配置kernel
使用vesafb或者显卡的framebuffer都可以。我用的是radeonfb(kernel 2.6.5-love3)。启动参数:
video=radeonfb:accel,mtrr,1280x1024-32@60
如果用vesafb,就用vga=xxx

1. 安装
emerge xdirectfb

2. 设置
配置文件有两个,全局的是
/usr/X11R6/lib/X11/xinit/dfbserverrc
用户自己的是
~/.dfbserverrc
我觉得比较有用的参数
-dpi 设置显示器分辨率
-enableRoot 透明?
-defaultOpacity 默认(激活)窗口透明度
-unfocusedOpacity 非激活窗口透明度
+kb 使用xkb扩展
所有的参数可以用XDirectFB --help得到
我的配置文件

  1. #!/bin/bash

  2. /usr/X11R6/bin/XDirectFB -enableRoot -dpi 96 -enableFadeIn -enableFadeOut -defaultOpacity 195 -unfocusedOpacity 125 -enableUnfocused +kb -a 0 -c -br
复制代码


3. 启动
运行startxdfb就可以了
它会自动启动XDirectFB,然后读入~/.xinitrc,启动kde之类

4. 问题和解答:
a. 分辨率设置
我记得网上有Framebuffer的Modeline calculator的,可惜一时没找到。推荐用modeline2fb从XF86Config直接生成,当然需要你先写好XFree的modeline


  1. $ modeline2fb -d 16 /etc/X11/XF86Config
  2. # modes.fb - video mode descriptions for fbset
  3. #
  4. # See fbset(8) and fb.modes(5) for more information

  5. mode "1280x1024"
  6.   geometry   1280 1024   1280 52416   16
  7.   timings    9122   248 56   36 0   136 2
  8.   hsync high
  9.   vsync high
  10. endmode
复制代码

生成了一个1280x1024@60Hz, 16bit的modeline
把它放到/etc/fb.modes就可以了
我的/etc/fb.modes

  1. mode "1280x1024-32"
  2.   geometry   1280 1024   1280 13094   32
  3.   timings    9122   248 56   36 0   136 2
  4.   hsync high
  5.   vsync high
  6. endmode

  7. mode "1280x1024-16"
  8.   geometry   1280 1024   1280 13094   16
  9.   timings    9122   248 56   36 0   136 2
  10.   hsync high
  11.   vsync high
  12. endmode
复制代码

directfb会自动使用最靠前的设置,当然也可以用fbset -a "1280x1024-16"这样的来切换。

b. 鼠标双击的问题
http://forums.gentoo.org/viewtop ... ;highlight=directfb
如果偷懒,比如我用usb鼠标
那么就直接删掉ps/2鼠标设备文件(/dev/psaux)
另外xdirectfb和gpm不太对付,需要先
/etc/init.d/gpm stop

c. 透明度改变
按住windows键(meta),然后滚动鼠标滚轮就可以了。

d. 中文显示
如果是纯fontconfig+freetype2的话,应该是没有任何问题的

e. 截图
emerge scrot
或者用fbgrab也可以

f. 使用Alt+Ctrl+F?切换

echo vt-switching >> /etc/directfbrc
更多的参数请man directfbrc

g. 其他
xdirectfb能和xfree很好的共存,这个不用担心

--------------------------------------------------------------------------------

照penny兄的提醒现在xdirectfb下很爽呀。

鼠标双击的问题,是DirectFB的bug。依照上面的链结自己写了点,希望能方便大家。
一、修改DirectFB对于鼠标的配置。
$ cd /usr/portage/dev-libs/DirectFB
DirectFB $ ebuild DirectFB-0.9.20.ebuild unpack
然后去/var/tmp/portage/.....下面找DirectFB-0.9.20/inputdrivers/ps2mouse/ps2mouse.c这个文件,找到它的以下行:

static char *devname[2] = { "/dev/psaux", "/dev/input/mice" };

改为:
static char *devname[1] = { "/dev/psaux" };

二、重新编译安装directfb:
#ebuild /usr/portage/dev-libs/DirectFB/DirectFB-0.9.20.ebuild merge

三、去掉gpm支持
#rc-update del gpm default
发表于 2004-4-11 10:44:00 | 显示全部楼层
谢了,penny兄这篇出来的好及时:)加入精华。
发表于 2004-4-11 11:11:09 | 显示全部楼层
penny真是“即时雨”呀!Thanks !
发表于 2004-4-11 11:33:54 | 显示全部楼层
看了gentoo forums里的文章,想重编译可是找不到DirectFB-0.9.20/inputdrivers/ps2mouse/ps2mouse.c在哪里?
发表于 2004-4-11 11:34:03 | 显示全部楼层
有错误了,帮忙看一下怎么回事?

  1. max max $ startxdfb
  2. /home/max/.dfbserverrc

  3. XDirectFB / X Window System
  4. (protocol Version 11, revision 0, vendor release 6600)
  5.          If the server is older than 6-12 months, or if your hardware is
  6.          newer than the above date, look for a newer version before
  7.          reporting problems.  (See [url]http://www.XFree86.Org/FAQ[/url])

  8.         ---------------------- DirectFB v0.9.20 ---------------------
  9.               (c) 2000-2002  convergence integrated media GmbH
  10.               (c) 2002-2003  convergence GmbH
  11.          -----------------------------------------------------------

  12. (*) Single Application Core. (2004-03-21 00:22)
  13. (*) DirectFB/misc/memcpy: using libc memcpy()
  14. (*) DirectFB/InputDevice: IMPS/2 Mouse (1) 0.9 (convergence integrated media GmbH)
  15. (*) DirectFB/InputDevice: IMPS/2 Mouse (2) 0.9 (convergence integrated media GmbH)
  16. (*) DirectFB/InputDevice: Keyboard 0.9 (convergence integrated media GmbH)
  17. (*) DirectFB/GraphicsDevice: Generic Software Rasterizer 0.6 (convergence integrated media GmbH)
  18. (!) DirectFB/Core/layers: Setting default/last configuration failed!
  19. (!) DirectFB/Core/layers: Failed to enable primary layer!
  20. (!) DirectFB/Core: Could not initialize 'layers' core!
  21.      --> Not supported!
  22. (!) DirectFB/Core: Error during initialization (Not supported!)
  23. (#) DirectFBError [XDirectFBInitOutput: DirectFBCreate]: Not supported!

  24. Fatal server error:
  25. no screens found
  26.    OsVendorFatalError
  27.    AbortDDX
  28.   Quitting XDirectFB...

  29. XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"
  30.        after 0 requests (0 known processed) with 0 events remaining.
复制代码


我的 /etc/fb.modes:

  1. #
  2. #   DirectFB video modes, should be placed into "/etc"
  3. #

  4. mode "1280x1024-32"
  5.    geometry 1280 1024 1280 13094 32
  6.    timings 9122 248 56 36 0 136 2
  7.    hsync high
  8.    vsync high
  9. endmode

  10. mode "1280x1024-16"
  11.     geometry   1280 1024   1280 13094   16
  12.     timings    9122   248 56   36 0   136 2
  13.     hsync high
  14.     vsync high
  15. endmode
复制代码
 楼主| 发表于 2004-4-11 11:43:31 | 显示全部楼层
最初由 klstg 发表
看了gentoo forums里的文章,想重编译可是找不到DirectFB-0.9.20/inputdrivers/ps2mouse/ps2mouse.c在哪里?


/ $ cd /usr/portage/dev-libs/DirectFB
DirectFB $ ebuild DirectFB-0.9.20.ebuild unpack

然后去/var/tmp/portage/.....下面找
 楼主| 发表于 2004-4-11 11:46:59 | 显示全部楼层
最初由 maxzhongcn 发表
有错误了,帮忙看一下怎么回事?
  1. max max $ startxdfb
  2. /home/max/.dfbserverrc
  3. XDirectFB / X Window System
  4. (protocol Version 11, revision 0, vendor release 6600)
  5.          If the server is older than 6-12 months, or if your hardware is
  6.          newer than the above date, look for a newer version before
  7.          reporting problems.  (See [url]http://www.XFree86.Org/FAQ[/url])
  8.         ---------------------- DirectFB v0.9.20 ---------------------
  9.               (c) 2000-2002  convergence integrated media GmbH
  10.               (c) 2002-2003  convergence GmbH
  11.          -----------------------------------------------------------
  12. (*) Single Application Core. (2004-03-21 00:22)
  13. (*) DirectFB/misc/memcpy: using libc memcpy()
  14. (*) DirectFB/InputDevice: IMPS/2 Mouse (1) 0.9 (convergence integrated media GmbH)
  15. (*) DirectFB/InputDevice: IMPS/2 Mouse (2) 0.9 (convergence integrated media GmbH)
  16. (*) DirectFB/InputDevice: Keyboard 0.9 (convergence integrated media GmbH)
  17. (*) DirectFB/GraphicsDevice: Generic Software Rasterizer 0.6 (convergence integrated media GmbH)
  18. (!) DirectFB/Core/layers: Setting default/last configuration failed!
  19. (!) DirectFB/Core/layers: Failed to enable primary layer!
  20. (!) DirectFB/Core: Could not initialize 'layers' core!
  21.      --> Not supported!
  22. (!) DirectFB/Core: Error during initialization (Not supported!)
  23. (#) DirectFBError [XDirectFBInitOutput: DirectFBCreate]: Not supported!
  24. Fatal server error:
  25. no screens found
  26.    OsVendorFatalError
  27.    AbortDDX
  28.   Quitting XDirectFB...
  29. XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"
  30.        after 0 requests (0 known processed) with 0 events remaining.
复制代码


你是不是用了qingy之类?
directfb是这样的,默认只能启动一个使用它的程序
如果需要启动多个,需要patch kernel,加上fusion。

http://directfb.org/cgi-bin/cvsweb.cgi/linux-fusion/
发表于 2004-4-11 11:59:23 | 显示全部楼层
qingy ? 是啥东西?没有用过。原来可以启动的,可是好久没用了,今天只不过加了一个 ~/.dfbserverrc 而已。

  1. Could not initialize 'layers' core
复制代码

这是什么意思?
 楼主| 发表于 2004-4-11 12:12:01 | 显示全部楼层
你去掉 ~/.dfbserverrc呢?
如果可以启动再慢慢找原因。。

另外,你的framebuffer设置正确么?
发表于 2004-4-11 14:27:26 | 显示全部楼层
照penny兄的提醒现在xdirectfb下很爽呀。

鼠标双击的问题,是DirectFB的bug。依照上面的链结自己写了点,希望能方便大家。
一、修改DirectFB对于鼠标的配置。
$ cd /usr/portage/dev-libs/DirectFB
DirectFB $ ebuild DirectFB-0.9.20.ebuild unpack
然后去/var/tmp/portage/.....下面找DirectFB-0.9.20/inputdrivers/ps2mouse/ps2mouse.c这个文件,找到它的以下行:

static char *devname[2] = { "/dev/psaux", "/dev/input/mice" };

改为:
static char *devname[1] = { "/dev/psaux" };

二、重新编译安装directfb:
#ebuild /usr/portage/dev-libs/DirectFB/DirectFB-0.9.20.ebuild merge

三、去掉gpm支持
#rc-update del gpm default
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表