【自分だけではなかった…】DragonBoard 410c(Debian)の定期的なリブート対策

DragonBoard 410c(Debian)の定期的なリブート対策

どうもDragonBoardでリブートが頻発するのは自分だけの現象ではなかったようです。 Facebookでも同じ現象の方が多くなってきているようです(?)

このエントリーは過去のエントリーからの継続ネタになります。概ねの解決編となります。

uepon.hatenadiary.com

uepon.hatenadiary.com

しかし、Bluetoothをオフにして、HDMIも接続しなければほとんどリブートしないみたいですね。syslogの内容でvblank time outという部分みると、もしかしたらHDMIの方が原因なのかも…?

前回のエントリーではこういう感じで締めくくってみたのですが、実際に実験をしてみました。

Bluetoothを有効化する

Bluetoothを無効化していたので、まずは有効化させます。

$ sudo systemctl enable bluetooth.service
$ sudo systemctl start bluetooth.service

HDMIを外す

そして、本体からMHDMIケーブルを外して再起動します。

$ tail -f /var/log/messages

一応、syslogを確認しながら長時間動作を確認します。 開始から一日以上経ちましたが、安定して動作しているようです。

原因は…

本当の原因はHDMI側の処理だったのかなと思います。

自分の場合、実際にはヘッドレスな運用をすることがほとんどなので、これであれば問題ないかなと思いました。とはいうもののXを使いたいということはたまにあります。例えば、OpenCVなどで画像を表示したいという場合などです。

そこでWindowsリモートデスクトップ接続からも使えるようにします。

リモートデスクトップ接続の設定を行う。

過去に行ったRaspberryPiでの設定をベースに行います。

uepon.hatenadiary.com

念のため、x11vncのパッケージがあるか確認します。

$ sudo apt-chache search x11vnc
ssvnc - Enhanced TightVNC viewer with SSL/SSH tunnel helper
x11vnc - VNC server to allow remote access to an existing X session
x11vnc-data - data files for x11vnc

無事存在していました。ではインストール作業を行います。

$ sudo apt-get install xrdp
$ sudo apt-get install x11vnc

これでOKです。

x11vncの設定

VNC接続用のパスワードファイルを作成します。

$ x11vnc -storepasswd
Enter VNC password: 
Verify password:    
Write password to /home/linaro/.vnc/passwd?  [y]/n 
Password written to: /home/linaro/.vnc/passwd

これで準備は完了です。コマンドラインからx11vncを起動します。-usepwは先程作成したパスワードファイルを使用するという意味になります。

$ x11vnc -usepw
03/06/2017 09:46:46 -usepw: found /home/linaro/.vnc/passwd
03/06/2017 09:46:46 x11vnc version: 0.9.13 lastmod: 2011-08-10  pid: 2998
03/06/2017 09:46:46 XOpenDisplay("") failed.
03/06/2017 09:46:46 Trying again with XAUTHLOCALHOSTNAME=localhost ...
03/06/2017 09:46:46 
03/06/2017 09:46:46 *** XOpenDisplay failed. No -display or DISPLAY.
03/06/2017 09:46:46 *** Trying ":0" in 4 seconds.  Press Ctrl-C to abort.
03/06/2017 09:46:46 *** 1 2 3 4 
03/06/2017 09:46:50 *** XOpenDisplay of ":0" successful.
03/06/2017 09:46:50 
03/06/2017 09:46:50 Using X display :0
03/06/2017 09:46:50 rootwin: 0x205 reswin: 0x2200001 dpy: 0xe4366350
03/06/2017 09:46:50 
03/06/2017 09:46:50 ------------------ USEFUL INFORMATION ------------------
03/06/2017 09:46:50 X DAMAGE available on display, using it for polling hints.
03/06/2017 09:46:50   To disable this behavior use: '-noxdamage'
03/06/2017 09:46:50 
03/06/2017 09:46:50   Most compositing window managers like 'compiz' or 'beryl'
03/06/2017 09:46:50   cause X DAMAGE to fail, and so you may not see any screen
03/06/2017 09:46:50   updates via VNC.  Either disable 'compiz' (recommended) or
03/06/2017 09:46:50   supply the x11vnc '-noxdamage' command line option.
03/06/2017 09:46:50 
03/06/2017 09:46:50 Wireframing: -wireframe mode is in effect for window moves.
03/06/2017 09:46:50   If this yields undesired behavior (poor response, painting
03/06/2017 09:46:50   errors, etc) it may be disabled:
03/06/2017 09:46:50    - use '-nowf' to disable wireframing completely.
03/06/2017 09:46:50    - use '-nowcr' to disable the Copy Rectangle after the
03/06/2017 09:46:50      moved window is released in the new position.
03/06/2017 09:46:50   Also see the -help entry for tuning parameters.
03/06/2017 09:46:50   You can press 3 Alt_L's (Left "Alt" key) in a row to 
03/06/2017 09:46:50   repaint the screen, also see the -fixscreen option for
03/06/2017 09:46:50   periodic repaints.
03/06/2017 09:46:50 
03/06/2017 09:46:50 XFIXES available on display, resetting cursor mode
03/06/2017 09:46:50   to: '-cursor most'.
03/06/2017 09:46:50   to disable this behavior use: '-cursor arrow'
03/06/2017 09:46:50   or '-noxfixes'.
03/06/2017 09:46:50 using XFIXES for cursor drawing.
03/06/2017 09:46:50 GrabServer control via XTEST.
03/06/2017 09:46:50 
03/06/2017 09:46:50 Scroll Detection: -scrollcopyrect mode is in effect to
03/06/2017 09:46:50   use RECORD extension to try to detect scrolling windows
03/06/2017 09:46:50   (induced by either user keystroke or mouse input).
03/06/2017 09:46:50   If this yields undesired behavior (poor response, painting
03/06/2017 09:46:50   errors, etc) it may be disabled via: '-noscr'
03/06/2017 09:46:50   Also see the -help entry for tuning parameters.
03/06/2017 09:46:50   You can press 3 Alt_L's (Left "Alt" key) in a row to 
03/06/2017 09:46:50   repaint the screen, also see the -fixscreen option for
03/06/2017 09:46:50   periodic repaints.
03/06/2017 09:46:50 
03/06/2017 09:46:50 XKEYBOARD: number of keysyms per keycode 10 is greater
03/06/2017 09:46:50   than 4 and 100 keysyms are mapped above 4.
03/06/2017 09:46:50   Automatically switching to -xkb mode.
03/06/2017 09:46:50   If this makes the key mapping worse you can
03/06/2017 09:46:50   disable it with the "-noxkb" option.
03/06/2017 09:46:50   Also, remember "-remap DEAD" for accenting characters.
03/06/2017 09:46:50 
03/06/2017 09:46:50 X FBPM extension not supported.
03/06/2017 09:46:50 X display is capable of DPMS.
03/06/2017 09:46:50 --------------------------------------------------------
03/06/2017 09:46:50 
03/06/2017 09:46:50 Default visual ID: 0x21
03/06/2017 09:46:50 Read initial data from X display into framebuffer.
03/06/2017 09:46:50 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/4096
03/06/2017 09:46:50 
03/06/2017 09:46:50 X display :0 is 32bpp depth=24 true color
03/06/2017 09:46:50 
03/06/2017 09:46:50 Autoprobing TCP port 
03/06/2017 09:46:50 Autoprobing selected TCP port 5900
03/06/2017 09:46:50 Autoprobing TCP6 port 
03/06/2017 09:46:50 Autoprobing selected TCP6 port 5900
03/06/2017 09:46:50 listen6: bind: Address already in use
03/06/2017 09:46:50 Not listening on IPv6 interface.
03/06/2017 09:46:50 fb read rate: 91 MB/sec
03/06/2017 09:46:50 fast read: reset -wait  ms to: 10
03/06/2017 09:46:50 fast read: reset -defer ms to: 10
03/06/2017 09:46:50 The X server says there are 16 mouse buttons.
03/06/2017 09:46:50 screen setup finished.
03/06/2017 09:46:50 

The VNC desktop is:      linaro-alip:0
PORT=5900

******************************************************************************
Have you tried the x11vnc '-ncache' VNC client-side pixel caching feature yet?

The scheme stores pixel data offscreen on the VNC viewer side for faster
retrieval.  It should work with any VNC viewer.  Try it by running:

    x11vnc -ncache 10 ...

One can also add -ncache_cr for smooth 'copyrect' window motion.
More info: http://www.karlrunge.com/x11vnc/faq.html#faq-client-caching

これで接続準備ができましたので接続テストを行います。

リモートデスクトップ接続ツールを起動して

f:id:ueponx:20170603145950p:plain

無事に接続ができるとxrdpの接続画面が表示されます。

f:id:ueponx:20170603150146p:plain

Session : vnc-any IP : DragonboadのIPアドレス port : 5900 password : 先程設定したパスワード

と入力して【OK】ボタンをクリックします。

f:id:ueponx:20170603150836p:plain

無事に接続できました。(画面は接続後ターミナルを立ち上げてみています) あとは、自動で起動するように設定を行っていきます。 とりあえず、Ctrl+cでx11vncを終了します。

設定ファイルを生成します。

$ mkdir /home/linaro/.config/autostart/
$ vim /home/linaro/.config/autostart/x11vnc.desktop

【x11vnc.desktop】

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=
Exec=x11vnc -forever -display :0 -rfbauth /home/linaro/.vnc/passwd
StartupNotify=false
Terminal=false
Hidden=false

これでOKです。後は自動ログインの設定を行えば問題ないのですが、RaspberryPiの様にraspi-configで設定ができないのですが…何もしなくても再起動するとx11vncが起動していました。ターミナルからのログインはしていません。

なんとかこれでXが使用できるようになりました。

おわりに

無事にXも使えるし、Bluetoothも使えるようになりました。これでおおよその問題も解決できたかなと思います。

ただ、リモートで使うXがRaspberryPiよりもかなり遅く感じます。

/* -----codeの行番号----- */