LinuxSir.cn,穿越时空的Linuxsir!

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

X4500HD集成显卡 用vlc/smplayer看电影时导致X崩溃重启[已解决]

[复制链接]
发表于 2009-6-13 23:23:16 | 显示全部楼层 |阅读模式
[症状描述]
我调节音量的快捷键已经绑定为Alt+/-。用vlc/smplayer看电影时,若用Alt+/-调节音量,则会导致X崩溃。X自动重启后又回到gdm的登录对话框。在重启计算器以前,不能用Ctrl+Alt+F1/F2/F3...切换到终端(console)模式——按Ctrl+Alt+F1,液晶显示满屏彩条,但此时系统除了显示不正常外其他都还OK,你可“摸黑”输入:root, 密码, reboot让机子重启。


[如何重现症状]
打开vlc/smplayer,用Alt+/-调节音量,X崩溃。


[计算机硬件]
DELL VOSTRO 220 台式计算机
Intel G45 芯片组
Intel Core 2 Duo 7400 CPU
Intel X4500HD 集成显卡
SATA硬盘
19英寸液晶显示器(工作在1440x900@60Hz)


[内核版本] 2.6.27-r10
Intel集成显卡的内核配置以及驱动参考的是(没有特别针对4500HD的):
Gentoo Wiki "Intel GMA" http://en.gentoo-wiki.com/wiki/Intel_GMA
Gentoo Doc "硬件3D加速指南" http://www.gentoo.org/doc/zh_cn/dri-howto.xml

Processor type and features --->
<*> MTRR (Memory Type Range Register) support
Device drivers --->
   Graphic support --->
   <*> /dev/agpgart (AGP Support) --->
       <M> Intel 440LX/BX/GX, I8xx and E7x05 support
   <M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
        <M>   Intel 830M, 845G, 852GM, 855GM, 865G
        <M>   i915 driver
   <M> Support for frame buffer devices  --->
      
  •    Enable Video Mode Handling Helpers
           (两种情况都试过:加和不加 Intel frame buffer support 都会出现这个问题)


    驱动程序: x11-drivers/xf86-video-intel 2.6.3-r1
    配置部分主要参考了 Gentoo Wiki 中的 “Intel GMA”
    DRI开启,但是GEM不正常:
    # glxinfo | grep direct
    Failed to initialize GEM.  Falling back to classic.
    direct rendering: Yes
    #  glxinfo | grep GEM
    Failed to initialize GEM.  Falling back to classic.
    # glxgears
    Failed to initialize GEM.  Falling back to classic.
    281 frames in 5.0 seconds = 56.030 FPS
    do_wait: drmWaitVBlank returned -1, IRQs don't seem to be working correctly.

    因为没有针对G45芯片组或者/X4500HD集成显卡的配置过程,x11-misc/driconf 以后的部分我就没有按照Gentoo Wiki上的做法做。


    [xorg-server]
    Installed versions:  1.5.3-r6 USE-flag: hal input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 nptl video_cards_intel xorg
    1.5.3-r6同样出现这个问题


    [xorg.conf文件]
    我参照 Gentoo 官方网站上的文档《Xorg 1.5升级向导》,“尝试不使用任何xorg.conf(可以将它重命名为xorg.conf.old)运行Xorg”,所以我没有在系统中使用xorg.conf文件。X启动以后能自动运行在显示器的最佳分辨率1440x900@60Hz。


    [grub.conf文件]
    grub.confg没有在启动时加入任何指定分辨率和显卡的设置,所以在终端Console中,分辨率就是默认最低的那一个。


    [其他信息]

    每次因为vlc/smplayer导致X崩溃重启,都会在/var/log/Xorg.0.log中增加如下内容:

    (II) intel(0): Modeline "1440x900"x0.0  106.50  1440 1520 1672 1904  900 903 909 934 -hsync +vsync (55.9 kHz)
    (II) intel(0): Modeline "800x600"x0.0   40.00  800 840 968 1056  600 601 605 628 +hsync +vsync (37.9 kHz)
    (II) intel(0): Modeline "800x600"x0.0   36.00  800 824 896 1024  600 601 603 625 +hsync +vsync (35.2 kHz)
    (II) intel(0): Modeline "640x480"x0.0   31.50  640 656 720 840  480 481 484 500 -hsync -vsync (37.5 kHz)
    (II) intel(0): Modeline "640x480"x0.0   31.50  640 664 704 832  480 489 491 520 -hsync -vsync (37.9 kHz)
    (II) intel(0): Modeline "640x480"x0.0   30.24  640 704 768 864  480 483 486 525 -hsync -vsync (35.0 kHz)
    (II) intel(0): Modeline "640x480"x0.0   25.20  640 656 752 800  480 490 492 525 -hsync -vsync (31.5 kHz)
    (II) intel(0): Modeline "720x400"x0.0   28.32  720 738 846 900  400 412 414 449 -hsync +vsync (31.5 kHz)
    (II) intel(0): Modeline "1280x1024"x0.0  135.00  1280 1296 1440 1688  1024 1025 1028 1066 +hsync +vsync (80.0 kHz)
    (II) intel(0): Modeline "1024x768"x0.0   78.80  1024 1040 1136 1312  768 769 772 800 +hsync +vsync (60.1 kHz)
    (II) intel(0): Modeline "1024x768"x0.0   75.00  1024 1048 1184 1328  768 771 777 806 -hsync -vsync (56.5 kHz)
    (II) intel(0): Modeline "1024x768"x0.0   65.00  1024 1048 1184 1344  768 771 777 806 -hsync -vsync (48.4 kHz)
    (II) intel(0): Modeline "832x624"x0.0   57.28  832 864 928 1152  624 625 628 667 -hsync -vsync (49.7 kHz)
    (II) intel(0): Modeline "800x600"x0.0   49.50  800 816 896 1056  600 601 604 625 +hsync +vsync (46.9 kHz)
    (II) intel(0): Modeline "800x600"x0.0   50.00  800 856 976 1040  600 637 643 666 +hsync +vsync (48.1 kHz)
    (II) intel(0): Modeline "1152x864"x0.0  108.00  1152 1216 1344 1600  864 865 868 900 +hsync +vsync (67.5 kHz)
    (II) intel(0): Modeline "1440x900"x60.0  106.47  1440 1520 1672 1904  900 901 904 932 -hsync +vsync (55.9 kHz)
    (II) intel(0): Modeline "1152x864"x75.0  104.99  1152 1224 1352 1552  864 865 868 902 -hsync +vsync (67.7 kHz)
    (II) intel(0): Modeline "1280x1024"x60.0  108.88  1280 1360 1496 1712  1024 1025 1028 1060 -hsync +vsync (63.6 kHz)
    (II) intel(0): Modeline "1440x900"x75.0  136.49  1440 1536 1688 1936  900 901 904 940 -hsync +vsync (70.5 kHz)
    (II) intel(0): Modeline "1280x800"x60.0   83.46  1280 1344 1480 1680  800 801 804 828 -hsync +vsync (49.7 kHz)
    (II) intel(0): EDID vendor "DEL", prod id 61453
    exaCopyDirty: Pending damage region empty!


    附加:自己的make.conf

    # These settings were set by the catalyst build script that automatically
    # built this stage.
    # Please consult /etc/make.conf.example for a more detailed example.
    nCFLAGS="-O2 -march=i686 -pipe"
    CXXFLAGS="-O2 -march=i686 -pipe"
    # WARNING: Changing your CHOST is not something that should be done lightly.
    # Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.
    CHOST="i686-pc-linux-gnu"

    # Number of Processors
    MAKEOPTS="-j3"

    FEATURES="ccache parallel-fetch userfetch"

    CCACHE_SIZE="512M"

    USE=" \
    # CPU Features
        mmx mmx2 sse sse2 sse3 ssse3 smp \
    # Power Management
        acpi \
    # Audio System: esd oss are no longer essential
        -arts alsa \
    # Other Hardware (I don't have a printer)
        -cups dvd cdr usb \
    # Hardware ABL
        udev dbus hal \
    # POSIX Thread Library
        threads
    # Locale
        nls cjk unicode zh_CN en_US \
    # X Window System
        X xscreensaver \
    # Desktop Environment
        -kde -qt3 -qt4 gnome gtk branding emacs latex pdf \
    # Cosole
        bash-completion gpm \
    # 2D Graphic
       jpeg jpeg2k gif png tiff truetype fontconfig svga xft \
    # 3D Graphic
        opengl dri \
    # Media Player
        mplayer -xine -gstreamer
    # Compress
        zlib bzip2"

    LINGUAS="zh_CN zh en_US en"

    VIDEO_CARDS="intel"
    INPUT_DEVICES="keyboard mouse evdev"
    ALSA_CARDS="hda-intel"


    # SJTU
    GENTOO_MIRRORS="ftp://202.38.97.230/gentoo \
    http://61.135.158.199 \
    http://mirror.averse.net/pub/gentoo \
    http://mirro.gentoo.gr.jp"
    SYNC="rsync://61.135.158.199/gentoo-portage"

    # Gentoo Layman
    source /usr/local/portage/layman/make.conf
  •  楼主| 发表于 2009-6-14 13:48:42 | 显示全部楼层

    升级内核以及X相关驱动,GEM打开

    留意到 Gentoo Wiki 《Intel GMA》有这么一句话:

    GEM support can only be found in newer kernels (2.6.28, 2.6.29), fairly recent intel drivers (2.6+), newer mesa and xorg-server.

    后来把内核升级到 2.6.28-r5,然后重新编译了X相关驱动,X崩溃的问题也顺利结局了。目前DRI和GEM工作都正常:
    # glxinfo | grep rendering
    direct rendering: Yes
    # glxinfo | grep GEM
    OpenGL renderer string: Mesa DRI Intel(R) G45/G43 GEM 20090114

    只是 glxgears 的成绩还是非常不理想:
    # glxgears
    295 frames in 5.0 seconds = 58.856 FPS

    Gentoo Wiki 上的 driconf 部分我还没有去折腾,有空在弄。我2.6.28和2.6.27所用的内核配置文件相同,xorg-server仍使用1.5.3-r6,仍然是在“无xorg.conf文件”下工作。
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2009-6-26 23:48:54 | 显示全部楼层

    DRI 弄了以后glxgears改善,但ut2004效果糟糕。

    后来按照 Gentoo Wiki Intel GMA

       http://en.gentoo-wiki.com/wiki/Intel_GMA

       上把 driconf 部分做完了。主板芯片组的“名称”可以用 driconf 带的 xdriiinfo 查出来。这块主板的芯片组是 G45,配置.drirc的时候使用的名字是 i965。

    (参考了: http://dri.freedesktop.org/wiki/ConfigurationInfrastructure)

       用 driconf 折腾以后 glxgears 的成绩猛增,都有1000出头了。但似乎是“假象”——装了一个 ut2004-demo 玩,非常卡。

       xorg-server 1.6 和 gentoo-sources 2.6.30 已经放到 ~x86 分支里了,过两天有空想试试,希望能把显卡的能力发挥出来。
    回复 支持 反对

    使用道具 举报

    发表于 2009-6-27 10:21:45 | 显示全部楼层
    你用intel显卡的话就得紧跟潮流,因为它的驱动比较激进,我每次更新都能看到一些变化,只不过比较慢,用kernel 2.6.30,xserver 1.6.2,intel driver 2009 Q2 release,mesa 7.4.4试试,相信你会发现变化的。
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2009-6-27 16:50:03 | 显示全部楼层

    Intel集成显卡平台升级到 kernel-2.6.30 xorg-server-1.6

    参照楼上的意见,把 Kernel, xorg-server, mesa 做了升级。内核中开启了KMS,重新启用"xorg.conf"文件,去掉了driconf。升级以后 3D 性能提高,能流畅地玩 ut2004-demo。但是稳定性欠佳,有一些问题需要解决——ut2004经常会freeze,需要拔电源重启;无法用 Ctrl+Alt+F1~F6 切换到终端;compiz-fusion的CPU占用率还是稍高,并且会freeze。

        [升级]
       
        因为我懒,这部分没有使用 overlay。我使用的都是 Gentoo 官方 portage ~x86 分支中的包。添加到 package.keywods 中的包有:

    sys-kernel/gentoo-sources ~x86
    x11-base/xorg-server ~x86
    x11-drivers/xf86-video-intel ~x86
    app-admin/eselect-opengl ~x86
    x11-libs/libXfont ~x86
    x11-proto/randrproto ~x86
    app-admin/eselect ~x86
    x11-libs/libdrm ~x86
    media-libs/mesa ~x86
    x11-apps/mesa-progs ~x86

       先编译的内核,顺利通过;然后升级xorg-server;接着升级/重新编译X相关的驱动程序和应用程序,比如xf86-video-intel,mesa,都很顺利地完成了。最后再运行module-rebuild rebuild重新编译vmware-modules模块,revdep-rebuild检查链接关系。目前系统上 kernel, xorg-server, mesa 的版本是:

       sys-kernel/gentoo-sources-2.6.30-r1 (CONFIG_DRM_I915_KMS=y)
       x11-base/xorg-server-1.6.1.901-r4 (USE=hal input_devices_evdev input_devices_keyboard input_devices_mouse ipv6 nptl video_cards_intel xorg)
       x11-drivers/xf86-video-intel-2.7.1 (USE=dri)
       media-libs/mesa-7.4.4 (USE=nptl video_cards_intel xcb)

       这回我又重新开始使用 xorg.conf , 有些 Option 还是要写进去的。X之前在没有 xorg.conf 的状态下工作良好,但是3D性能完全没有被发挥出来。参考《Gentoo用户手册》,这个 xorg.conf 文件先由 X -configure 自动生成,然后在此基础上修改——添加UXA选项、设置分辨率和色深等。完整的xorg.conf文件贴在帖子最后。

       重启之前我先把 xdm 从 default runlevel 中去掉——我担心出现这种情况:X起来后无法操作键盘鼠标,不能切换到终端下。
       
       [效果]

       重启,新内核顺利启动。到了命令提示符下,启动 xdm,熟悉的登录界面出来了。登入,没什么问题。显示正常,运行 glxgears

       $ glxinfo | grep -i direct
       direct rendering: Yes
       $ glxinfo | grep -i gem
       OpenGL renderer string: Mesa DRI Intel(R) G45/G43 GEM 20090418 2009Q1 x86/MMX/SSE2
       $ glxgears
       Running synchronized to the vertical refresh.  The framerate should be
       approximately 1/7562842 the monitor refresh rate.
       4862 frames in 5.0 seconds = 972.400 FPS
       4591 frames in 5.0 seconds = 918.111 FPS
       4857 frames in 5.0 seconds = 971.223 FPS
       4845 frames in 5.0 seconds = 968.890 FPS
       4782 frames in 5.0 seconds = 956.272 FPS
       XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0"
          after 122794 requests (122793 known processed) with 0 events remaining.

       最后这段error不是很靠谱,望高人解释一下。
          
       用 VLC 看了会儿电影,很正常。又手痒开了一下 compiz-fusion, 比以前情况好一些,挺流畅。玩了 ut2004-demo,很流畅。3D性能提升非常明显。
       
       [问题]

       虽然给了些惊喜,但是还不很完善。我发现不能用 Ctrl+Alt+F1~F6切换到终端下了。更具体地说:我按X按下Ctrl+Alt+F1,则画面不动(多了一些斑驳的彩色条纹),鼠标键盘无反应;再按Ctrl+Alt+F7又会到X下,Xorg的log没有增加内容。compiz-fusion 开的特效非常少,只用到了:窗口装饰+静态程序切换,在切换用户程序的时候CPU占用率在20%左右(CPU是Intel E7400)。ut2004玩着玩着会卡住,完全不能进行任何操作,也不能切换到终端。这时我只能长按机箱的关机健关机。下次开机的时候会多花十几秒扫描文件系统日志。

       不知其他兄弟的情况如何?有没有好的解决方案?现在我只能等更新。

       [附: 完整的 xorg.conf 文件 InputDevice被注释; compiz被注释]


       Section "ServerLayout"
            Identifier     "X.org Configured"
            Screen      0  "Screen0" 0 0
            # InputDevice    "Mouse0" "CorePointer"
            # InputDevice    "Keyboard0" "CoreKeyboard"
            ## for compiz
            # Option         "AIGLX" "true"
    EndSection

    ## for compiz
    # Section "Extensions"
    #         Option        "Composite"        "Enable"
    # EndSection


    Section "Files"
            ModulePath   "/usr/lib/xorg/modules"
            FontPath     "/usr/share/fonts/misc/"
            FontPath     "/usr/share/fonts/TTF/"
            FontPath     "/usr/share/fonts/OTF"
            FontPath     "/usr/share/fonts/Type1/"
            FontPath     "/usr/share/fonts/100dpi/"
            FontPath     "/usr/share/fonts/75dpi/"
    EndSection

    Section "Module"
            Load  "dbe"
            Load  "dri"
            Load "dri2"
            Load  "extmod"
            Load  "glx"
            Load  "record"
    EndSection

    # Section "InputDevice"
    #         Identifier  "Keyboard0"
    #         Driver      "kbd"
    # EndSection

    # Section "InputDevice"
    #         Identifier  "Mouse0"
    #         Driver      "mouse"
    #         Option            "rotocol" "auto"
    #         Option            "Device" "/dev/input/mice"
    #         Option            "ZAxisMapping" "4 5 6 7"
    # EndSection

    Section "Monitor"
            Identifier   "Monitor0"
            VendorName   "Monitor Vendor"
            ModelName    "Monitor Model"
    EndSection

    Section "Device"
            ### Available Driver options are:-
            ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
            ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
            ### [arg]: arg optional
            #Option     "NoAccel"                    # [<bool>]
            #Option     "SWcursor"                   # [<bool>]
            #Option     "ColorKey"                   # <i>
            #Option     "CacheLines"                 # <i>
            #Option     "Dac6Bit"                    # [<bool>]
            #Option     "DRI"                        "True"
            #Option     "NoDDC"                      # [<bool>]
            #Option     "ShowCache"                  # [<bool>]
            #Option     "XvMCSurfaces"               # <i>
            #Option     "ageFlip"                   # [<bool>]
            Option "AccelMethod"   "UXA"
                # Option "Tiling"        "False"
            Identifier  "Card0"
            Driver      "intel"
            VendorName  "Intel Corporation"
            BoardName   "4 Series Chipset Integrated Graphics Controller"
            BusID       "CI:0:2:0"
    EndSection

    Section "Screen"
            Identifier "Screen0"
            Device     "Card0"
            Monitor    "Monitor0"
            SubSection "Display"
                    Viewport   0 0
                    Depth     24
                    Modes "1440x900"
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     4
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     8
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     15
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     16
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     24
            EndSubSection
    EndSection
    回复 支持 反对

    使用道具 举报

    发表于 2009-6-27 17:49:30 | 显示全部楼层
    动作很快啊,我自己还在等xserver1.6.2进portage呢,而且现在intel的2009Q2驱动也没有发布。我是x3100的显卡,没有你说的那个问题,不太清楚是什么原因造成的。
    现在可以把Option "Tiling" "False"去掉了么,我原来不加这个进gnome时会花屏。
    我的xorg.conf:
    Section "ServerLayout"
            Identifier     "X.org Configured"
            Screen      0  "Screen0" 0 0
    EndSection

    Section "Files"
            ModulePath   "/usr/lib64/xorg/modules"
            FontPath     "built-ins"
    EndSection
    Section "Monitor"
            Identifier   "Monitor0"
            VendorName   "Monitor Vendor"
            ModelName    "Monitor Model"
            Option       "ReducedBlanking"
    EndSection

    Section "Device"
            Identifier  "Card0"
            Driver      "intel"
            VendorName  "Intel Corporation"
            BoardName   "Mobile GM965/GL960 Integrated Graphics Controller"
            BusID       "CI:0:2:0"
            Option      "AccelMethod"  "UXA"
            Option      "Tiling"       "false"
    EndSection
    Section "Screen"
            Identifier "Screen0"
            Device     "Card0"
            Monitor    "Monitor0"
            SubSection "Display"
                    Viewport   0 0
                    Depth     1
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     4
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     8
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     15
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     16
            EndSubSection
            SubSection "Display"
                    Viewport   0 0
                    Depth     24
            EndSubSection
    EndSection
    回复 支持 反对

    使用道具 举报

     楼主| 发表于 2009-6-27 20:21:06 | 显示全部楼层

    使用 Option &quot;Tiling&quot; 解决了前两个问题

    多谢楼上提醒!重新使用

    Option "Tiling" “True”

    解决了前两个问题。我对 xorg.conf 中的选项持比较“保守”的态度。再能正常工作的前提下,尽量不加选项。所以“Tilling”选项一直被注释。现在使用 Tiling 选项之后,已经解决了“不能切换到终端”的问题以及“compiz-fusion CPU占用率过高”的问题。我已经决定让 compiz-fusion 随桌面一起启动。

    ut2004-demo 的问题还没有解决,玩不上5分钟就会卡住,无法进行操作,只能强按电源。Xorg.0.log 也没有相关日志记录。
    回复 支持 反对

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

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