2010年9月7日火曜日

Planex CQW-MRBのシリアル接続

Fonera 2202のときに作成したシリアルケーブル(Vcc pull up)にてCQW-MRBへのシリアルコンソールの接続はできたようです。

ただし、コンソールログインが有効となっていないらしく、linuxの起動後は、Enterキーに対して、echo backの改行となるだけです。

コンソールからのログインプロンプトを出すには、CQW-MRBのファームウェアを展開して、手を入れなければならないのでしょうか。

 

分解の手順は、以下の通りです。

  • バッテリー収納部の蓋をスライドさせて外す。バッテリを外す。
  • バッテリー収納部の周辺の小ねじx4を外す。
  • 筐体の裏カバーを外します。

 

あるピン配置に対して、9600, 19200, 34800, 57600, 115200と試して行く途中で、JP2のプリントパターンをいれて検索してみることを思いつき、「CQW-MRB JP2」 で検索したところ、twitterにすでに発見されている方の記録がありました。

http://twitter.com/lapis_moon/status/22545742065

確認の手間が大分省けました。感謝です。

JP2横のpinは 3.3V出ています。Vccではないかと思われます。

Pin配置については、下図を参照してください。

JP2

Fonera 2202とは違い Vcc は接続しなくともシリアルケーブルによるコンソール接続は機能するようです。

 

CQW-MRBの電源ONの直後にコンソールから何かキー入力があると、Ubootのプロンプトが表示されます。

U-Boot 1.1.4 (Dec 7 2009 - 14:15:23)

U-Boot code: 00000000 -> 0001A204 BSS: -> 0001F15C

CPU Clock: 200 MHz

1.8V Vdd Output: 1.793

2.5V Vdd Output: 2.531

RAM Configuration:

Bank #0: 00000000 32 MB

Flash Manufacturer: MXIC

Flash Device: MXLV320CB(4MB)

Flash: 4 MB

*** Warning - bad CRC, using default environment

In: serial

Out: serial

Err: serial

Hit any key to stop autoboot: 0         

※ここでcountが1のときにキー入力

 

初期状態ではキー入力の待ち時間を示す環境変数bootdelayが 1 となっています。これを 3 に変更します。

Star Vela # printenv

bootcmd=go 0x10040000

bootdelay=1

baudrate=38400

ethaddr=00:0a:0b:0c:0d:10

ipaddr=192.168.2.1

serverip=192.168.2.185

netmask=255.255.255.0

stdin=serial

stdout=serial

stderr=serial

Environment size: 180/65532 bytes

環境変数 bootdelayの値を 3 (秒)として、保存・再起動します。

Star Vela # setenv bootdelay 3

Star Vela # saveenv

Saving Environment to Flash...

Un-Protected 1 sectors

Writing to Flash...

Erasing sector 9 @ 10020000... OK

Erased 1 sectors

0x00010000 done

Protected 1 sectors

tar Vela # reset

 

 

Appendix 1.  CQW-MRBの起動ログ

Warning - bad CRC, using default environment

In: serial

Out: serial

Err: serial

Hit any key to stop autoboot: 0

## Starting application at 0x10040000 ...

Uncompressing Linux................................................................................... done, booting the kernel.

Linux version 2.6.16-star (root@vance.localdomain) (gcc version 3.4.6) #1414 Tue Jun 15 10:42:15 CST 2010

CPU: FA526id(wb) [66015261] revision 1 (ARMv4)

Machine: STAR STR9100

Memory policy: ECC disabled, Data cache writeback

CPU0: D VIVT write-back cache

CPU0: I cache: 16384 bytes, associativity 2, 16 byte lines, 512 sets

CPU0: D cache: 16384 bytes, associativity 2, 16 byte lines, 512 sets

CPU clock at 200MHz

AHB clock at 100MHz

APB clock at 50MHz

Built 1 zonelists

Kernel command line: root=/dev/mtdblock3

PID hash table entries: 256 (order: 8, 4096 bytes)

Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)

Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)

Memory: 32MB = 32MB total

Memory: 29788KB available (2252K code, 251K data, 100K init)

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

NET: Registered protocol family 16

PCI clock at 33M

PCI: bus0: Fast back to back transfers disabled

PCI Bridge found

PCI map irq: 00:00.00 slot 0, pin 1, irq: 0

SCSI subsystem initialized

usbcore: registered new driver usbfs

usbcore: registered new driver hub

Bluetooth: Core ver 2.8

NET: Registered protocol family 31

Bluetooth: HCI device and connection manager initialized

Bluetooth: HCI socket layer initialized

squashfs: version 3.4 (2008/08/26) Phillip Lougher

Initializing Cryptographic API

io scheduler noop registered

io scheduler deadline registered (default)

***********Init LED Driver*****************

Init GPIO Interrupt

***********Init LED Driver Finishing*****************

LED & GPIO & LAN Status Driver LED_VERSION

GPIO interrupt handler install ok.

Serial: 8250/16550 driver $Revision: 1.90 $ 1 ports, IRQ sharing disabled

serial8250: ttyS0 at MMIO 0x78000000 (irq = 10) is a 16550A

VLAN0_VLAN_TAG: 0

PPP generic driver version 2.4.2

PPP BSD Compression module registered

PPP MPPE Compression module registered

NET: Registered protocol family 24

rdm_major = 254

Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2

ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx

STR9100 NOR Flash: Found 1 x16 devices at 0x0 in 16-bit bank

Amd/Fujitsu Extended Query Table at 0x0040

number of CFI chips: 1

cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.

Creating 5 MTD partitions on "STR9100 NOR Flash":

0x00000000-0x00040000 : "ARMBOOT"

0x00040000-0x001a0000 : "Linux Kernel1"

0x001a0000-0x003e0000 : "ROOT FS1"

0x003e0000-0x00400000 : "Configs"

0x00040000-0x003e0000 : "Upgrade"

block2mtd: version $Revision: 1.30 $

usbmon: debugfs is not available

str9100-ehci str9100-ehci: str9100-ehci

str9100-ehci str9100-ehci: new USB bus registered, assigned bus number 1

str9100-ehci str9100-ehci: irq 24, io mem 0xcc000000

str9100-ehci str9100-ehci: USB 0.0 started, EHCI 1.00, driver 10 Dec 2004

usb usb1: Product: str9100-ehci

usb usb1: Manufacturer: Linux 2.6.16-star ehci_hcd

usb usb1: SerialNumber: str9100-ehci

usb usb1: configuration #1 chosen from 1 choice

hub 1-0:1.0: USB hub found

hub 1-0:1.0: 2 ports detected

ohci_hcd: 2005 April 22 USB 1.1 'Open' Host Controller (OHCI) Driver (STR9100)

str9100-ohci str9100-ohci: str9100-ohci

str9100-ohci str9100-ohci: new USB bus registered, assigned bus number 2

str9100-ohci str9100-ohci: irq 23, io mem 0xc4000000

usb usb2: Product: str9100-ohci

usb usb2: Manufacturer: Linux 2.6.16-star ohci_hcd

usb usb2: SerialNumber: str9100-ohci

usb usb2: configuration #1 chosen from 1 choice

hub 2-0:1.0: USB hub found

hub 2-0:1.0: 2 ports detected

usb 1-1: new high speed USB device using str9100-ehci and address 2

Bluetooth: HCI USB driver ver 2.9

usb 1-1: Product: 802.11 n WLAN

usb 1-1: Manufacturer: Ralink

usb 1-1: SerialNumber: 1.0

usb 1-1: configuration #1 chosen from 1 choice

usbcore: registered new driver hci_usb

u32 classifier

Perfomance counters on

Netfilter messages via NETLINK v0.30.

NET: Registered protocol family 2

IP route cache hash table entries: 512 (order: -1, 2048 bytes)

TCP established hash table entries: 2048 (order: 1, 8192 bytes)

TCP bind hash table entries: 2048 (order: 1, 8192 bytes)

TCP: Hash tables configured (established 2048 bind 2048)

TCP reno registered

ip_conntrack version 2.4 (256 buckets, 2048 max) - 240 bytes per conntrack

ctnetlink v0.90: registering with nfnetlink.

ip_tables: (C) 2000-2006 Netfilter Core Team

ipt_recent v0.3.1: Stephen Frost <sfrost@snowman.net>. http://snowman.net/projects/ipt_recent/

ClusterIP Version 0.8 loaded successfully

arp_tables: (C) 2002 David S. Miller

TCP bic registered

NET: Registered protocol family 1

NET: Registered protocol family 17

Bluetooth: L2CAP ver 2.8

Bluetooth: L2CAP socket layer initialized

Bluetooth: BNEP (Ethernet Emulation) ver 1.2

Bluetooth: BNEP filters: protocol multicast

VFS: Mounted root (squashfs filesystem) readonly.

Freeing init memory: 100K

init started: BusyBox v1.11.1 (2010-06-15 10:42:52 CST)

starting pid 615, tty '': '/etc/rc.sh'

Cannot run '/etc/rc.sh': No such file or directory

starting pid 616, tty '': '-/bin/sh'console.

BusyBox v1.11.1 (2010-06-15 10:42:52 CST) built-in shell (ash)

Enter 'help' for a list of built-in commands.

Sat Jan 1 00:00:00 UTC 2000

star_gpio:ioctl GPIO REG

star_gpio:ioctl GPIO REG

star_gpio:ioctl GPIO REG

star_gpio:ioctl GPIO REG

killall: pptp.sh: no process killed

killall: pppoe.sh: no process killed

killall: comgt: no process killed

killall: failover.sh: no process killed

killall: ppp3gloop.sh: no process killed

Close Wan Interface!!

No dnrd daemon found. Exiting.

No dnrd daemon found. Exiting.

cat: can't open '/etc/resolv.conf': No such file or directory

open mac port 0

close mac port 0

open mac port 0

Initialize WLAN interface

****************Use External RADIUS******************

insmod: cannot insert '/bin/rt_timer.ko': Cannot allocate memory

rt3070ap: module license 'unspecified' taints kernel.

rtusb init --->

=== pAd = c309a000, size = 482984 ===

<-- RTMPAllocAdapterBlock, Status=0

usbcore: registered new driver rt2870

<-- RTMPAllocTxRxRingMemory, Status=0

-->RTUSBVenderReset

<--RTUSBVenderReset

1. Phy Mode = 9

2. Phy Mode = 9

#

3. Phy Mode = 9

RTMPSetPhyMode: channel is out of range, use first channel=0

MCS Set = ff 00 00 00 00

SYNC - BBP R4 to 20MHz.l

Main bssid = 00:22:cf:30:2a:88

<==== rt28xx_init, Status=0

0x1300 = 00064300

Setup BRIDGE interface

close mac port 0

ifconfig: ioctl 0x8913 failed: No such device

bridge br0 doesn't exist; can't delete it

Setup bridge...

device eth0 entered promiscuous mode

open mac port 0

device ra0 entered promiscuous mode

br0: port 2(ra0) entering learning state

br0: port 1(eth0) entering learning state

br0: topology change detected, propagating

br0: port 2(ra0) entering forwarding state

br0: topology change detected, propagating

br0: port 1(eth0) entering forwarding state

------> 802.1x--------->Enter

------> 802.1x------>Exit

Static DHCP Leases disable!

device eth0 left promiscuous mode

br0: port 1(eth0) entering disabled state

device eth0 entered promiscuous mode

br0: port 1(eth0) entering learning state

br0: topology change detected, propagating

br0: port 1(eth0) entering forwarding state

**********************************************************************

* Running Diagd *

**********************************************************************

**********************************************************************

* Enable WSC_UPnP *

**********************************************************************

route: ioctl 0x890c failed: No such process

**********************************************************************

* Enable LLTD *

**********************************************************************

/bin/init.sh: line 539: /bin/lld2d: not found

**********************************************************************

* Enable GPIO Interrupt *

**********************************************************************

killall: snmpd: no process killed

killall: watchdog.sh: no process killed

killall: radiusd: no process killed

RADIUS server disable !!

interface ra-1 does not exist!

interface ra-1 does not exist!

interface ra-1 does not exist!

interface ra-1 does not exist!

interface ra-1 does not exist!

interface ra-1 does not exist!

ReInit APMIB

**********************************************************************

* FREE Page,Dentries and Inodes Cache *

**********************************************************************

MemFree: 22176 kB

Cached: 1224 kB

#############only 3G WAN##############

device eth0 left promiscuous mode

br0: port 1(eth0) entering disabled state

device eth0 entered promiscuous mode

br0: port 1(eth0) entering learning state

br0: topology change detected, propagating

br0: port 1(eth0) entering forwarding state

WEBS Restarting !

 

 

Appendix 2. Uboot info

Star Vela # base

Base Address: 0x00000000

Star Vela # bdinfo

arch_number = 0x0000038E

env_t = 0x00000000

boot_params = 0x00000100

DRAM bank = 0x00000000

-> start = 0x00000000

-> size = 0x02000000

ethaddr = 00:0A:0B:XX:XX:XX

ip_addr = 192.168.2.1

baudrate = 38400 bps

Star Vela # coninfo

List of available devices:

serial 80000003 SIO stdin stdout stderr

Star Vela # flinfo

Bank # 1: MXIC Unknown Chip Type

Size: 4 MB in 71 Sectors

Sector Start Addresses:

10000000 (RO) 10002000 (RO) 10004000 (RO) 10006000 (RO) 10008000 (RO)

1000A000 (RO) 1000C000 (RO) 1000E000 (RO) 10010000 (RO) 10020000 (RO)

10030000 10040000 10050000 10060000 10070000

10080000 10090000 100A0000 100B0000 100C0000

100D0000 100E0000 100F0000 10100000 10110000

10120000 10130000 10140000 10150000 10160000

10170000 10180000 10190000 101A0000 101B0000

101C0000 101D0000 101E0000 101F0000 10200000

10210000 10220000 10230000 10240000 10250000

10260000 10270000 10280000 10290000 102A0000

102B0000 102C0000 102D0000 102E0000 102F0000

10300000 10310000 10320000 10330000 10340000

10350000 10360000 10370000 10380000 10390000

103A0000 103B0000 103C0000 103D0000 103E0000

103F0000

Star Vela #

Star Vela # iminfo

## Checking Image at 00100000 ...

Bad Magic Number

Star Vela # imls

Star Vela # pci

Scanning PCI devices on bus 0

BusDevFun VendorId DeviceId Device Class Sub-Class

_____________________________________________________________

00.00.00 0xeeee 0x0000 Does not fit any class 0x00

Star Vela #

2010年9月4日土曜日

Fonera 2202にWillcom/Emobileを接続 その5 (H12HW)

 

Emobile H12HWを接続する際の注意事項です。記載を忘れていたので追記します。

  • H12HWは、接続設定→モデムにて、「USB接続」を選択すること。Photo-1
  • H12HWがシリアルデバイスとして認識されるまで、1~2分かかるようです。よって、FoneraにH12HWを接続してから、Internetに接続できるようになるまで、3分程度はかかります。

100824-164048-50

Photo-1 H12HW USB接続。

 

100824-164226

Photo-2 接続状態  Fon → USB-HUB → H12HW, Fon → Targus 巻取り式Ethernet Cable

 

その他

先日、PCデポさんにてお安くなった Planex CQW-MRBを手に入れました。H12HWを接続してみたところ、デバイスとして認識され、接続できました。NotePCから、googleへのpingだけですけれども。IO Data WSIMは認識されないようです。まだ、筐体を開けていないのですが、シリアルポートさえあればなんとかできるのでしょうか。

Note PC – wireless – CQW-MRB – USB -- H12HW

2010年8月14日土曜日

Fonera 2202にWillcom/Emobileを接続 その4

 

今回は、Lua/Luci によるGUIとなります。lua/htmファイルはそのままFonera 2202にコピーします。luaファイルについては開発環境に追加するとbinaryにすることができますが、今回はメンテナンス性も考慮してソースコードのままとします。Binary化してのPackageが便利とは思いますが、まだそこまで構築方法の調査が進んでいません。

その1で安定していると書きましたが、負荷テストをしてみたところ、

  • WSIM IO Data接続の場合には、10MBのファイルのダウンロードにおいて、PPPの取りこぼしが発生することがある。PPPのdisconnect/reconnectになる。
  • H12HWの場合には、10MBのファイルダウンロードは成功しましたが、接続したままの放置状態にしておくと、何度か接続が切れてしまうことがありました。

となりました。WSIMについては、logreadを読むとCPUの性能が足らない可能性があるかと思われます。H12HWについては、(田舎ですので)emobileの通信状態もしくはこのところの暑さで発熱の可能性もありますが、どちらについても原因の追及はできていません。

 

1. GUI概要
TOP画面 
ff1  
「設定」をクリックします。

fon_admin画面
ff2
「ダイヤルアップ」アイコンをクリックします。アイコン自身はフリーのアイコンをダウンロードしているので、他のアイコンのマッチングはとれていません。

ダイヤルアップ画面
ff3 
登録済みの設定が一覧表示れています。各表示について、設定内容の編集ボタンと設定削除のボタンがあります。「編集」ボタンをクリックすると、編集画面が開きます。「削除」ボタンのクリックでは確認画面なしに設定が削除されます。そのうち追加はしたいと考えています。
ここでは、EmobileはOEM元のHuaweiをベンダー名としています。

設定編集画面
ff4 
設定の変更後、「保存」ボタンを押すと/etc/config/ttyusbに登録さている情報を更新します。VIDPIDが更新された場合には、登録されている情報を一旦削除してから、新規に登録します。
設定画面では入力値のチェック(空文字列も含む)は行っていません。/lib/uci/schema/default/ttyusbを参照しての入力値チェックをそのうち追加したいと考えています。Luci / Modelによって記述した画面ならば、何もせずとも入力値のチェックがされるのかもしれませんが。

設定の追加画面
 ff5
設定の追加画面においても、入力値のチェックは行っていません。VIDPIDは必須です。接続速度については、IO Data WSIMの場合には115200(bps)が上限のようです。これ以上の速度では chat scriptに対してWSIMの反応がありません。Foneraにてlogreadの結果を見るとchat scriptにてtime outが発生します。接続コマンドについては、-T<Phone number>の部分を書き換えます。Emobileの場合には、ダイヤル先が *99#なので、接続コマンドは、
/tmp/chat_dialer –s –v –T*99#
となります。

 

 

2. /usr/lib/lua/luci/controller/dialup.lua

--[[
  File: dialup.lua
  Description: dialup configration control file.
  Page transition:
    edit.htm: a html template to edit a ppp configuration
    remove.lua: a lua file to remove a ppp configuration
    addentry.htm: a html template to add a net configuratin
    ttyregsit.lua: a lua file to regist a ppp configuratin.
  Revision history:
    2010-08-14: Initial release
--]]

module("luci.controller.dialup", package.seeall)

function index()
        require("luci.i18n")
        luci.i18n.loadc("dialup")

        local page = entry({"fon_admin", "fon_dialup"}, template("dialup/dialup"),
                     luci.i18n.translate("dialup", "dialup"))
        page.i18n = "dialup_dialup"
        page.sysauth = "root"
        page.icon_path = "/luci-static/resources/icons"
        page.icon = "dialup.png"
        page.page_icon = "dialup.png"

        local epage = entry({"fon_admin", "fon_dialup", "edit"},
                      template("dialup/edit"),
                      luci.i18n.translate("dialup_edit", "Edit"))

        local epage = entry({"fon_admin", "fon_dialup", "remove"},
                      cbi("dialup/remove",
                      {on_success_to = {"fon_admin/fon_dialup"}}), "remove")

        local cpage = entry({"fon_admin", "fon_dialup", "addentry"},
                      template("dialup/addentry"),
                      luci.i18n.translate("dialup_addentry", "Add entry"))

        local rpage = entry({"fon_admin", "fon_dialup", "ttyregist"},
                      cbi("dialup/ttyregist",
                      {on_success_to = {"fon_admin/fon_dialup"}}), "ttyregist")

end

ダイヤルアップ接続のコントロール定義となります。メイン画面(dailup.htm)、編集画面(edit.htm)、追加画面(addentry.htm)、削除処理(remove.lua)、登録処理(ttyregist.lua)を記載します。viewのhtmファイルはtemplate(), model/cbiのluaファイルはcbi()を使います。

 

3. /usr/lib/lua/luci/view/dialup/dialup.htm

<!--
  File: dailup.htm
  Description: PPP dailup configration main.
  Page transition:
     dailup.htm -> edit.htm
                   remvoe.lua
       addentry: -> addentry.htm
       cancel: -> fon_admin

  Revision history:
    2010-08-14: Initial release
-->

<% boxcolor="darkorange" %>
<%+header%>
<h2><%:dialup_title %></h2>
<p><%:dialup_desc %></p>
<%
local uci = require("luci.model.uci").cursor()
local http = require("luci.http")

-- Get a temporary file name for vidpid list file.
local vidpid_list = os.tmpname()
local vendor, product

-- Get the list of vidpids defined in the configuration file. And store it into a temporary file.
local cmdline="/sbin/uci show ttyusb | cut -f2 -d\'.\' | cut -f1 -d\'=\' | uniq > "..vidpid_list
local ret = os.execute(cmdline)

-- Open the vidpid list file.
local fd = io.open(vidpid_list, "r")

-- Prepare FORM/ACTION URLs.
local url_edit     = luci.dispatcher.build_url("fon_admin", "fon_dialup", "edit")
local url_remove   = luci.dispatcher.build_url("fon_admin", "fon_dialup", "remove")
local url_addentry = luci.dispatcher.build_url("fon_admin", "fon_dialup", "addentry")
local url_cancel   = luci.dispatcher.build_url("fon_admin")
%>

<table class="cbi-section-table">
<thead>
<tr class="cbi-section-table-titles">
<th class="cbi-section-table-cell"><%:dialup_vendor %></th>
<th class="cbi-section-table-cell"><%:dialup_product %></th>
<th class="cbi-section-table-cell"><%:dialup_edit %></th>
<th class="cbi-section-table-cell"><%:dialup_remove %></th>
</tr>
</thead>

<%
if (fd ~= nil)
then
  while true
  do
    line = fd:read()
    if (line == nil or line == "") then
      break
    end

    vendor=uci:get("ttyusb."..line..".vendor")
    product=uci:get("ttyusb."..line..".product")
    if (product == nil or product == "") then
      break
    end
%>

<tbody>
<tr>
<td>
<% write (vendor) %>
</td><td>
<% write (product) %>
</td>
<td>
<form method="POST" ACTION="<% write (url_edit) %>">
<button type="submit" name="fon_dialup.edit" value="<% write (line) %>"><%:dialup_edit %></button>
</form>
</td>
<td>
<form method="POST" ACTION="<% write (url_remove) %>">
<button type="submit" name="fon_dialup.remove" value="<% write (line) %>" ><%:dialup_remove %></button>
</form>
</td>
</tr>

<%
  end
end
%>

</tbody>
</table>

<!-- Add edntry and cancel buttons -->
<div>
<form method="POST" ACTION="<% write (url_addentry) %>">
<button type="submit" name="fon_dialup.addentry" value="addentry"><%:dialup_addentry %></button>
<input type="submit" name="fon_dialup.cancel" value="<%:cancel %>"
onclick="document.location='<%=url_cancel%>'; return false;" />
</form>
</div>

<%
fd:close()
os.remove(vidpid_list)
%>
<%+footer%>

ダイヤルアップ設定のメイン画面となります。/etc/config/ttyusb に登録されている各設定の一覧を表示し、「編集」、「削除」ボタンをそれぞれの設定に対して表示します。一覧の作成については、shell commandを起動しています。これはLuci utiliesを利用して書き直しを検討しています。

「編集」、「削除」については、POSTからそれぞれのluaが起動されます。「設定の追加」においては、対応するviewが起動されます。「削除」の場合には、確認のdialogは表示されません。中止(キャンセル)の場合には管理画面(fon_admin)に戻ります。

 

4. /usr/lib/lua/luci/view/dialup/addentry.htm

<!--
  File: addentry.htm
  Description: Add a new ppp configuration.
  Page transition:
      dailup.htm -> addentry.htm
                      save: -> ttyregist.lua
                      cancel: -> fon_admin
  Revision history:
    2010-08-14: Initial release
-->

<% boxcolor="darkorange" %>
<%+header%>
<h2><%:dialup_addentry_title %></h2>
<p><%:dialup_addentry_desc %></p>
<%
local uci = require("luci.model.uci").cursor()

-- Prepare FORM/ACTION URLs.
local url_ttyregist = luci.dispatcher.build_url("fon_admin", "fon_dialup", "ttyregist")
local url_cancel    = luci.dispatcher.build_url("fon_admin")
%>

<form method="POST" ACTION="<% write(url_ttyregist) %>">

<div class="cbi-map" id="cbi-fon">
<fieldset class="cbi-section" id="cbi-fon-dialup-addentry">

<div class="cbi-section-node" id="cbi-fon-dialup-addentry">

<!-- Textbox for Vendor name -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-addentry-vendor">
<label class="cbi-value-title" for="fon_dialup.tty_vendor"><%:dialup_vendor %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_vendor" id="fon_dialup.tty_vendor" value="" />
</div>

<!-- Textbox for Product name -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-addentry-product">
<label class="cbi-value-title" for="fon_dialup.tty_product"><%:dialup_product %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_product" id="fon_dialup.tty_product" value="" />
</div>

<!-- Textbox for VIDPID (Vendor ID/Product ID) -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-addentry-vidpid">
<label class="cbi-value-title" for="fon_dialup.tty_vidpid"><%:dialup_vidpid %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_vidpid" id="fon_dialup.tty_vidpid" value="" />
</div>

<!-- Select List for tty driver -->
<div class="cbi-js-loadable line" id="fon_dialup.tty_driver">
<label class="cbi-value-title" for="fon_dialup.tty_driver"><%:dialup_driver %></label>
<select class="cbi-input-select" onchange="cbi_d_update(this.id)"
  id="fon_dialup.tty_driver" name="fon_dialup.tty_driver" size="1">
<%
  local driver = "pl2303"
  local driver_list = "pl2303 option usbserial"

  for idriver in string.gmatch(driver_list, "%w+") do
    if (idriver == driver) then
%>
      <option id="fon_dialup.tty_driver" selected="<% write (idriver) %>"> <% write (idriver) %>
<%  else %>
      <option id="fon_dialup.tty_driver" value="<% write (idriver) %>" > <% write (idriver) %>
<%
    end
  end
%>
</select>
</div>

<!-- Select list for modem type: dialup or 3gumts -->
<div class="cbi-js-loadable line" id="fon_dialup.tty_modemtype">
<label class="cbi-value-title" for="fon_dialup.tty_modemtype"><%:dialup_modemtype %></label>
<select class="cbi-input-select" onchange="cbi_d_update(this.id)"
  id="fon_dialup.tty_modemtype" name="fon_dialup.tty_modemtype" size="1">
<%
  local modemtype = "dialup"
  local modem_list = "dialup 3gumts"

  for imodem in string.gmatch(modem_list, "%w+") do
    if (imodem == modemtype) then
%>
      <option id="fon_dialup.tty_modemtype" selected="<% write (imodem) %>"> <% write (imodem) %>
<%  else %>
      <option id="fon_dialup.tty_modemtype" value="<% write (imodem) %>" > <% write (imodem) %>
<%
    end
  end
%>
</select>
</div>

<!-- Textbox for PPP account username -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-addentry-username">
<label class="cbi-value-title" for="fon_dialup.tty_username"><%:username %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_username" id="fon_dialup.tty_username" value="" />
</div>

<!-- Textbox for PPP account password -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-addentry-password">
<label class="cbi-value-title" for="fon_dialup.tty_password"><%:password %></label>
<input type="password" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_password" id="fon_dialup.tty_password" value="" />
</div>

<!-- Textbox for connection chat command line -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-addentry-connectcmd">
<label class="cbi-value-title" for="fon_dialup.tty_connectcmd"><%:dialup_connectcmd %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_connectcmd" id="fon_dialup.tty_connectcmd"
  value="/tmp/chat_dialer -s -v -T&lt;Phone number&gt;" />
</div>

<!-- Select list for interface speed -->
<div class="cbi-js-loadable line" id="fon_dialup.tty_speed">
<label class="cbi-value-title" for="fon_dialup.tty_speed"><%:dialup_speed %></label>
<select class="cbi-input-select" onchange="cbi_d_update(this.id)"
  id="fon_dialup.tty_speed" name="fon_dialup.tty_speed" size="1">
<%
  local speed = "115200"
  local speed_list = "9600 19200 38400 57600 115200 230400 460800 921600"

  for ispeed in string.gmatch(speed_list, "%w+") do
    if (ispeed == speed) then
%>
      <option id="fon_dialup.tty_speed" selected="<% write (ispeed) %>"> <% write (ispeed) %>
<%  else %>
      <option id="fon_dialup.tty_spped" value="<% write (ispeed) %>" > <% write (ispeed) %>
<%
    end
  end
%>
</select>
</div>

<!-- Textbox for modem inital command -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-addentry-atinit">
<label class="cbi-value-title" for="fon_dialup.tty_atinit"><%:dialup_atinit %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_atinit" id="fon_dialup.tty_atinit" value="" />
</div>

</div>
</fieldset>
</br>
</div>

<!--- Save and cancel buttons -->
<div>
<button type="submit" name="fon_dialup.tty_save" value="save"><%:save %></button>
<input type="submit" name="fon_dialup.cancel" value="<%:cancel %>"
onclick="document.location='<%=url_cancel%>'; return false;" />
</div>

</form>
<br />

<%+footer%>

ダイヤルアップ設定の追加画面となります。既存の自動生成されるhtmlに合わせて header / footerおよびclassを指定します。個々の設定項目を取り込んで、ttyregistにPOSTします。保存の場合には、値は”save”としています。中止(キャンセル)の場合には、JavaScriptにて、admin画面に戻ります

 

5. /usr/lib/lua/luci/view/dialup/edit.htm

<!--
  File: edit.htm
  Description: Edit a ppp configuration.
  Page transition:
    dailup.htm -> edit.htm
                    save: -> ttyregist.lua
                    cancel: -> fon_admin
  Revision history:
      2010-08-14: Initial release
-->

<% boxcolor="darkorange" %>
<%+header%>
<h2><%:dialup_edit_title %></h2>
<p><%:dialup_edit_desc %></p>
<%
local uci = require("luci.model.uci").cursor()
local http = require("luci.http")

-- Get post 'fon_dialup.edit' value.
local post_vidpid = http.formvalue("fon_dialup.edit")

-- Prepare FOM/ACTION URLs.
local url_ttyregist = luci.dispatcher.build_url("fon_admin", "fon_dialup", "ttyregist")
local url_cancel    = luci.dispatcher.build_url("fon_admin")

-- Retrieve config values.
local vidpid     = uci:get("ttyusb", post_vidpid, "vidpid")
local vendor     = uci:get("ttyusb", vidpid, "vendor", vendor)
local product    = uci:get("ttyusb", vidpid, "product", product)
local driver     = uci:get("ttyusb", vidpid, "driver", driver)
local modemtype  = uci:get("ttyusb", vidpid, "modemtype", modemtype)
local username   = uci:get("ttyusb", vidpid, "username", username)
local password   = uci:get("ttyusb", vidpid, "password", password)
local connectcmd = uci:get("ttyusb", vidpid, "connectcmd", connectcmd)
local speed      = uci:get("ttyusb", vidpid, "speed", speed)
local atinit     = uci:get("ttyusb", vidpid, "atinit", atinit)

%>

<form method="POST" ACTION="<% write(url_ttyregist) %>">

<div class="cbi-map" id="cbi-fon">
<fieldset class="cbi-section" id="cbi-fon-dialup-edit">

<div class="cbi-section-node" id="cbi-fon-dialup-edit">

<!-- Textbox for Vendor name -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-edit-vendor">
<label class="cbi-value-title" for="fon_dialup.tty_vendor"><%:dialup_vendor %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_vendor" id="fon_dialup.tty_vendor" value="<% write (vendor) %>" />
</div>

<!-- Textbox for Product name -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-edit-product">
<label class="cbi-value-title" for="fon_dialup.tty_product"><%:dialup_product %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_product" id="fon_dialup.tty_product" value="<% write (product) %>" />
</div>

<!-- Textbox for VIDPID (Vendor ID/Product ID) -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-edit-vidpid">
<label class="cbi-value-title" for="fon_dialup.tty_vidpid"><%:dialup_vidpid %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_vidpid" id="fon_dialup.tty_vidpid" value="<% write (vidpid) %>" />
</div>

<!-- Select List for tty driver -->
<div class="cbi-js-loadable line" id="fon_dialup.tty_driver">
<label class="cbi-value-title" for="fon_dialup.tty_driver"><%:dialup_driver %></label>
<select class="cbi-input-select" onchange="cbi_d_update(this.id)"
  id="fon_dialup.tty_driver" name="fon_dialup.tty_driver" size="1">
<%
  local driver_list = "pl2303 option usbserial"

  for idriver in string.gmatch(driver_list, "%w+") do
    if (idriver == driver) then
%>
      <option id="fon_dialup.tty_driver" selected="<% write (idriver) %>"> <% write (idriver) %>
<%  else %>
      <option id="fon_dialup.tty_driver" value="<% write (idriver) %>" > <% write (idriver) %>
<%
    end
  end
%>
</select>
</div>

<!-- Select List for modem type: dialup or 3gumts -->
<div class="cbi-js-loadable line" id="fon_dialup.tty_modemtype">
<label class="cbi-value-title" for="fon_dialup.tty_modemtype"><%:dialup_modemtype %></label>
<select class="cbi-input-select" onchange="cbi_d_update(this.id)"
  id="fon_dialup.tty_modemtype" name="fon_dialup.tty_modemtype" size="1">
<%
  local modem_list = "dialup 3gumts"

  for imodem in string.gmatch(modem_list, "%w+") do
    if (imodem == modemtype) then
%>
      <option id="fon_dialup.tty_modemtype" selected="<% write (imodem) %>"> <% write (imodem) %>
<%  else %>
      <option id="fon_dialup.tty_modemtype" value="<% write (imodem) %>" > <% write (imodem) %>
<%
    end
  end
%>
</select>
</div>

<!-- Textbox for PPP account username -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-edit-username">
<label class="cbi-value-title" for="fon_dialup.tty_username"><%:username %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_username" id="fon_dialup.tty_username" value="<% write (username) %>" />
</div>

<!-- Textbox for PPP account password -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-edit-password">
<label class="cbi-value-title" for="fon_dialup.tty_password"><%:password %></label>
<input type="password" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_password" id="fon_dialup.tty_password" value="<% write (password) %>" />
</div>

<!-- Textbox for connection chat command line -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-edit-connectcmd">
<label class="cbi-value-title" for="fon_dialup.tty_connectcmd"><%:dialup_connectcmd %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_connectcmd" id="fon_dialup.tty_connectcmd"
  value="<% write (connectcmd) %>" />
</div>

<!-- Select List for interface speed -->
<div class="cbi-js-loadable line" id="fon_dialup.tty_speed">
<label class="cbi-value-title" for="fon_dialup.tty_speed"><%:dialup_speed %></label>
<select class="cbi-input-select" onchange="cbi_d_update(this.id)"
  id="fon_dialup.tty_speed" name="fon_dialup.tty_speed" size="1">
<%
  local speed_list = "9600 19200 38400 57600 115200 230400 460800 921600"

  for ispeed in string.gmatch(speed_list, "%w+") do
    if (ispeed == speed) then
%>
      <option id="fon_dialup.tty_speed" selected="<% write (ispeed) %>"> <% write (ispeed) %>
<%  else %>
      <option id="fon_dialup.tty_spped" value="<% write (ispeed) %>" > <% write (ispeed) %>
<%
    end
  end
%>
</select>
</div>

<!-- Textbox for modem inital command -->
<div class="cbi-js-loadable line" id="cbi-fon-dialup-edit-atinit">
<label class="cbi-value-title" for="fon_dialup.tty_atinit"><%:dialup_atinit %></label>
<input type="text" class="textField" onchange="cbi_d_update(this.id)"
  name="fon_dialup.tty_atinit" id="fon_dialup.tty_atinit" value="<% write (atinit) %>" />
</div>

</div>
</fieldset>
</br>
</div>

<!-- Save and cancel buttons -->
<div>
<button type="submit" name="fon_dialup.tty_save" value="save"><%:save %></button>
<input type="submit" name="fon_dialup.cancel" value="<%:cancel %>"
onclick="document.location='<%=url_cancel%>'; return false;" />
</div>

</form>

<br />

<%+footer%>

選択したダイヤルアップ設定の編集画面となります。既存の自動生成されるhtmlに合わせて header / footerおよびclassを指定します。保存を押した場合には、ttyregistにPOSTします。

 

6. /usr/lib/lua/luci/model/cbi/dialup/remove.lua

--[[
  File: remove.lua
  Description: Remove a ppp configuration which has the specified vidpid.
  Page transition:
    dailup.htm -> remove.lua
  Revision history:
    2010-08-14: Initial release
--]]

local uci = require("luci.model.uci").cursor()
local http = require("luci.http")
require("luci.tools.webadmin")

local val = http.formvalue("fon_dialup.remove")
local vidpid = val

-- The value of POST is the vidpid.
if (vidpid ~= nil) then
  uci:delete_all("ttyusb", "ttyusb", {vidpid = vidpid})
  uci:save("ttyusb")
  uci:commit("ttyusb")
  http.redirect(".")
end

return

/etc/config/ttyusbの該当する情報を削除するluaになります。POSTのvalueとして削除対象のvidpidが渡されます。

 

7. /usr/lib/lua/luci/model/cbi/dialup/ttyregist.lua

--[[
  File: ttyregist.lua
  Description: store a ppp configuration
  Page transition:
    dailup.htm -> addentry.htm -> ttyregist.lua
                  edit.htm -> ttyregist.lua
  Revision history:
    2010-08-14: Initial release
--]]

local uci = require("luci.model.uci").cursor()
local http = require("luci.http")

local val = http.formvalue("fon_dialup.tty_cancel")
if (val ~= nil) then
  http.redirect("..")
  return
end

val = http.formvalue("fon_dialup.tty_save")
if (val ~= nil) then
  local vendor     = http.formvalue("fon_dialup.tty_vendor")
  local product    = http.formvalue("fon_dialup.tty_product")
  local vidpid     = http.formvalue("fon_dialup.tty_vidpid")
  local driver     = http.formvalue("fon_dialup.tty_driver")
  local modemtype  = http.formvalue("fon_dialup.tty_modemtype")
  local username   = http.formvalue("fon_dialup.tty_username")
  local password   = http.formvalue("fon_dialup.tty_password")
  local connectcmd = http.formvalue("fon_dialup.tty_connectcmd")
  local speed      = http.formvalue("fon_dialup.tty_speed")
  local atinit     = http.formvalue("fon_dialup.tty_atinit")

--[[ When the vidpid was modifed, old vidpid is passed as the form value.
     POSTed value and 'vidpid' value aren't same.
     First, remove the old vidpid section then create a new vidpid section.
--]]
  if (val ~= vidpid) then
    uci:delete_all("ttyusb", "ttyusb", {vidpid = val})
  end

  uci:set("ttyusb", vidpid, "ttyusb")
  uci:set("ttyusb", vidpid, "vendor", vendor)
  uci:set("ttyusb", vidpid, "product", product)
  uci:set("ttyusb", vidpid, "vidpid", vidpid)
  uci:set("ttyusb", vidpid, "driver", driver)
  uci:set("ttyusb", vidpid, "modemtype", modemtype)
  uci:set("ttyusb", vidpid, "username", username)
  uci:set("ttyusb", vidpid, "password", password)
  uci:set("ttyusb", vidpid, "connectcmd", connectcmd)
  uci:set("ttyusb", vidpid, "speed", speed)
  uci:set("ttyusb", vidpid, "atinit", atinit)
  uci:save("ttyusb")
  uci:commit("ttyusb")
end

http.redirect(".")
return

/etc/config/ttyusbに対して、更新処理を行います。formvalueが”save”のときに更新処理を行います。vidpidが変更されている場合には、先に削除処理を実行します。その後で更新された情報を登録します。

 

9. /usr/lib/lua/luci/i18n/dialup.en.lua

dialup = "Dialup"
dialup_desc = "Configure dialup connection."
dialup_title = "Dialup connection"
dialup_vendor = "Vendor name"
dialup_product = "Product name"
dialup_vidpid = "VIDPID"
dialup_driver = "Device driver"
dialup_modemtype = "Modem type"
dialup_connectcmd = "Connect command"
dialup_speed = "Interface speed"
dialup_atinit = "AT initial command"
dialup_edit = "Edit"
dialup_remove = "Remove"
dialup_edit_title = "Edit"
dialup_edit_desc = "Edit dialup configuration"
dialup_addentry = "Add entry"
dialup_addentry_title = "Add entry"
dialup_addentry_desc = "Add a dialup configration entry"

GUIの英語メッセージとなります。

 

10. /usr/lib/lua/luci/i18n/dialup.ja.lua (UTF-8にします)

dialup = "ダイヤルアップ"
dialup_desc = "ダイヤルアップ接続の設定を行います。"
dialup_title = "ダイヤルアップ接続設定"
dialup_vendor = "ベンダー名"
dialup_product = "製品名"
dialup_vidpid = "VIDPID"
dialup_driver = "デバイスドライバー"
dialup_modemtype = "モデムタイプ"
dialup_connectcmd = "接続コマンド"
dialup_speed = "接続速度"
dialup_atinit = "AT初期コマンド"
dialup_edit = "編集"
dialup_remove = "削除"
dialup_edit_title = "編集"
dialup_edit_desc = "ダイヤルアップ設定の編集"
dialup_addentry = "設定の追加"
dialup_addentry_title = "設定の追加"
dialup_addentry_desc = "ダイヤルアップ接続の追加"

GUIの日本語メッセージとなります。UTF-8にて保存します。

 

10. dialup iconファイルの設定
# cd /www/luci-static/resources/icons
# wget http://www.iconarchive.com/icons/iconica/pastel/48/dialup-networking-icon.png
# mv dialup-networking-icon.png dialup.png

 

 

12. 更新履歴
  • 2010/08/14: Initail release

2010年8月8日日曜日

IBM T210 QXGAモニターとLinux X11 Windows System その2

1. 前回からの続き

HD4350とCCC 10.7の組み合わせでは、Modelineを認識させてリフレッシュレートを下げるには至りませんでした。試したことは以下の通りです。
(1) Option “monito-xxx”とOption “RROutputOrder”によるモニター指定。
/etc/X11/xorg.confの抜粋

Section "Monitor"
        Identifier   "IBM-T210-VGA"
        VendorName "IBM"
        ModelName "T210 6659-HG2" 
        Option      "DPMS" "true"
        Option      "ReducedBlanking"
        VertRefresh  60
        Modeline "2048x1536_60.00"  266.95  2048 2200 2424 2800  1536 1537 1540 1589  -HSync +Vsync
EndSection
Section "Monitor"
        Identifier   "IBM-T210-DVI"
        VendorName "IBM"
        ModelName "T210 6659-HG2"
        Option      "DPMS" "true"
        Option      "ReducedBlanking"
VertRefresh  35-55
        Modeline "2048x1536_45.00"  195.17  2048 2176 2400 2752  1536 1537 1540 1576  -HSync +Vsync

EndSection
Section "Device"
    Identifier  "HD4350"
    Driver      "fglrx"
    BusID       "PCI:1:0:0"
    Option "monitor-DFP1" "IBM-T210-VGA"
    Option "monitor-DFP5" "IBM-T210-DVI"
    Option "RROutputOrder" "IBM-T210-DVI"

EndSection
Section "Screen"
    Identifier "Screen0"
    Device     "HD4350"
    Monitor    "IBM-T210-DVI"
    DefaultDepth     24
    SubSection "Display"
        Viewport   0 0
        Depth     24
    EndSubSection
EndSection
結果は、Xserverが起動途中で止まり、画面はblack outのままとなります。直前のOSDによりリフレッシュレートは60Hzのままでした。Xorg.0.logの抜粋は以下のようになります。
(II) fglrx(0): Output DFP1 using monitor section IBM-T210-VGA
(II) fglrx(0): Output DFP5 using monitor section IBM-T210-DVI
(II) fglrx(0): Output CRT1 has no monitor section
(II) fglrx(0): Output CRT2 has no monitor section
(WW) fglrx(0): Only one display is connnected, single mode is enabled
(II) fglrx(0): Output DFP1 disconnected
(II) fglrx(0): Output DFP5 connected
(II) fglrx(0): Output CRT1 disconnected
(II) fglrx(0): Output CRT2 disconnected
(WW) fglrx(0): Unable to find initial modes
(EE) fglrx(0): Output DFP5 enabled but has no modes
(EE) fglrx(0): Display Infrastructure Failed
(EE) fglrx(0): PreInit failed
(II) fglrx(0): === [atiddxPreInit] === end


xorg.confのDisplay subsectionにModes “2048x1536” “1600x1200” “1280x1024”を追加してみましたが、現象に変化はありませんでした。


(2) aticonfigのオプション指定 (enable-monitor, force-monitor)


# aticonfig –force-monitor=”dfp5” –enable-monitor=”dfp5”


Xserverの起動途中でblack outする現象に変化はあまりせんでした。


2. CCC down grade


このような場合の常套手段なのですが、CCCのdown gradeをしてみました。CCC 9.10まで戻したところ、Xorg.0.logでのモニターの認識がDFPだけとなり、Modelineを指定したところ、そのリフレッシュレートの設定が有効となりました。


http://support.amd.com/us/gpudownload/linux/previous/Pages/radeon_linux.aspx

CCC version Monitor Results
10.1 DFP1とDFP5で変わらず × モニターはblack out
9.12 DFP1とDFP5で変わらず × モニターはblack out
9.11 DFP1とDFP5で変わらず × モニターはblack out
9.10 ※1 DFPのみ ◎ Modeline指定は有効


※1 9.10のリンクをクリックするとリンク切れとなっており、9.10のリンクをクリックすると9.10のdownload pageとなりました。



CCC 9.10のテストにて、Modeline設定が有効になったときのxorg.conf。モニター名の変更を行う前のものです。



# Xorg configuration created by system-config-display
Section "ServerLayout"
        Identifier     "single head configuration"
        Screen      0  "aticonfig-Screen[0]-0" 0 0
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
EndSection

Section "Module"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
EndSection

Section "Monitor"
        Identifier   "aticonfig-Monitor[0]-0"
        Option      "VendorName" "ATI Proprietary Driver"
        Option      "ModelName" "Generic Autodetecting Monitor"
        Option      "DPMS" "true"
        VertRefresh  35-55
# 2048x1536 @ 45.00 Hz (GTF) hsync: 70.92 kHz; pclk: 195.17 MHz
       Modeline "2048x1536_45.00"  195.17  2048 2176 2400 2752  1536 1537 1540 1576  -HSync +Vsync
EndSection
Section "Device"
        Identifier  "aticonfig-Device[0]-0"
        Driver      "fglrx"
        BusID       "PCI:1:0:0"
EndSection
Section "Screen"
        Identifier "aticonfig-Screen[0]-0"
        Device     "aticonfig-Device[0]-0"
        Monitor    "aticonfig-Monitor[0]-0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection



xorg.confは aticonfig –initial -f にて生成されたものに 45HzのModelineを津を得たものです。





/var/log/Xorg.0.logの抜粋です。



(II) fglrx(0): ***Display: ConnectedDisplayTypes=0x00000400, disabled=0x00000000

(II) fglrx(0): Connected Display1: DFP 5 [dfp5]

(II) fglrx(0): Display1 EDID data ---------------------------



(II) fglrx(0): End of Display1 EDID data --------------------

(WW) fglrx(0): Only one display is connnected,so single mode is enabled
(II) fglrx(0): Primary Controller - DFP 5
(II) fglrx(0): Internal Desktop Setting: 0x00000001
(==) fglrx(0): QBS disabled
(==) fglrx(0): FAST_SWAP disabled
(==) fglrx(0):  PseudoColor visuals disabled
(==) fglrx(0): Using gamma correction (1.0, 1.0, 1.0)
(==) fglrx(0): Center Mode is disabled
(==) fglrx(0): TMDS coherent mode is enabled



認識されるモニターがDFP 5だけとなっています。


45Hzのリフレッシュレートにて半日ほど利用しました。なので、とりあえずこれで常用してみるつもりです。
  • モニターのsuspend状態からの復帰時に画面が乱れることなかった。
  • モニターの電源をOFFにして、離席。戻ってからモニター電源をONしたところ、一度だけ、ON後の画面が乱れることがあった。再度の電源OFF/ONで復帰。 



    3. その他


    • CCC 9.11~10.7のDFP1/DFP5の件については、AMD(ATI)のサポートに聞いてみたいが、問い合わせ先の情報はないようだ。Graghics cardの玄人志向もサポートFAQがあるだけ。
    • “Output DFP5 using monitor section xxx”, “Unable to find initial modes”などを記録している部分をXserver source codeより見つけて、原因を類推する。
    • 英語のページも検索してみたが、CCC 9.11~10.7の現象について報告はあるものの解決策はないようだ。
    • CCC 9.11のrelease noticeに関係するような記載はない。


    4. 更新履歴


    • 2010/8/8: Initial release

    2010年8月4日水曜日

    IBM T210 QXGAモニターとLinux X11 Windows System

    X11の場合は、Monitor sectionにModelineを追加するだけと思っていましたが、そうは簡単はいきませんでした。AMD 690G のXpress 1250 graphics chipを利用している場合には、DVI single linkの表示が可能となるまでリフレッシュレートを下げて対応できました。ですが、HD4350のPCI exporess graphics cardの場合には、xorg.confに定義した内容がDVI接続しているモニターとは一致しないために、xorg.confに記載したModelineが使われていませんでした。

    参考リンクのモニター記載方法の記述を見つけて、xorg.confのモニターの記載方法を変更したところ、HD4350でもCCC(Catalyst Control Center)がインストールされていない状態ならば、リフレッシュレートを下げ、T210にQXGA表示をした場合でも、ゴーストや陰が見えなくなりました。

    ですが、HD4350 + CCC 10.7の環境でモニターの記載方法を変更するとX11 Serverの処理が止まってしまい、画面がblack outします。この対策はまだ見つけられていません。

     

    環境 結果
    HD4350 + CCC 10.7の環境において、xorg.confのModelineを追加 × リフレッシュレートは60Hzのまま。ゴーストやピングの陰は発生する。
    複数モニターがあるため、xorg.confのMonitorと接続したモニターが異なっているために定義が適用されないためらしい。
    X1250 + CCC 9.3 環境でxorg.confにModelineを追加 ○ リフレッシュレートを35Hzまで下げたところ、ゴースト・陰の発生がなくなった。しかし、レートが低いためマウスポインターの追従性が悪い。
    HD4350 + 標準ドライバーにおいてモニター記載方法を変更 ○ リフレッシュレートを45Hzまで下げたところ、ゴースト・陰の発生がなくなった。マウスカーソルの追従性も許容できる範囲であろう。※1
    HD4350 + CCC 10.7 においてモニター記載方法を変更 × X11 Serverの起動途中で処理が止まり、画面がblack out。システムリセットが必要となる。

    ※1: その後、システム再起動を繰り返したところ、45Hzでもゴーストの発生や画面が右半分に圧縮されてしまう現象が確認されました。DVIのSingle linkになっているのかもしれません。38Hzまで下げるとシステム再起動を繰り返しても、問題の発生は見られませんでした。

    今回の環境は以下の通りです。

    • M/B: Gigabyte GA-MA69SM-S2H, CPU: AMD X2 BE-2400, 6GB Memory
    • Linux: CentOS 5.5 64bit
    • X windows system: 7.1.1 x86_64
    • ATI Xpress 1250 (AMD 690G chip set integrated)
    • ATI HD4350 256MB (玄人志向)
    • IBM T210 QXGAモニター (ATS Direct, DVI dual link cable)

     

    1. ×HD4350 + CCC 10.7, リフレッシュレート変更不可

    /etc/X11/xorg.confの一部を示します。リフレッシュレート(VerRefresh)の51.72はWindows 7のPowerStripにて動作した周波数です。T210は60Hzのままで動作し、ピンクの陰とゴーストは発生します。Modelineの値は

    % gtf 2048 1536 51.72

    の結果です。

    Section "Monitor"
            Identifier   "IBM-T210"
            VendorName   "IBM"
            ModelName    "T210 6659-HG2"
            HorizSync    70 - 90
            VertRefresh  51.72
            Modeline "2048x1536_51.72"  227.78  2048 2192 2416 2784  1536 1537 1540 1582  -HSync +Vsync
            Option      "DPMS" "true"
    EndSection
    Section "Device"
            Identifier  "aticonfig-Device[0]-0"
            Driver      "fglrx"
            BusID       "PCI:1:0:0"
    EndSection
    Section "Screen"
            Identifier "aticonfig-Screen[0]-0"
            Device     "aticonfig-Device[0]-0"
            Monitor    "IBM-T210"
            DefaultDepth     24
            SubSection "Display"
                    Viewport   0 0
                    Depth     24
            EndSubSection
    EndSection

    この修正をxorg.confに適用して、X11 Serverを再起動しても、T210が示すリフレッシュレートは60Hzのままです。

     

    このときの /var/log/Xorg.0.logには以下のようなログがあります。


    (II) fglrx(0): Connected Display0: DFP 5 [dfp5]
    (II) fglrx(0): Display0 EDID data ---------------------------
    (II) fglrx(0): Manufacturer: IBM  Model: 1a03  Serial#: 16843009



    (II) fglrx(0): Output DFP1 using monitor section IBM-T210
    (II) fglrx(0): Output DFP5 has no monitor section

    (II) fglrx(0): Output CRT1 has no monitor section
    (II) fglrx(0): Output CRT2 has no monitor section
    (WW) fglrx(0): Only one display is connnected, single mode is enabled
    (II) fglrx(0): Output DFP1 disconnected
    (II) fglrx(0): Output DFP5 connected

    (II) fglrx(0): Output CRT1 disconnected
    (II) fglrx(0): Output CRT2 disconnected
    (II) fglrx(0): Using exact sizes for initial modes
    (II) fglrx(0): Output DFP5 using initial mode 2048x1536
    (II) fglrx(0): DPI set to (75, 75)
    (==) fglrx(0): Using gamma correction (1.0, 1.0, 1.0)
    (II) fglrx(0): Adapter ATI Radeon HD 4300/4500 Series has 2 configurable heads and 1 displays connected.
    (==) fglrx(0): QBS disabled
    (==) fglrx(0):  PseudoColor visuals disabled

    以下はログの推測です。

    • DFP5 (Digital Flat Panel)は、IBM T210に接続されている。インターフェースはDVI-D port。
    • DFP1 は、xort.confのMontor section ‘IBM-T210’を使っているが、モニターが接続されてはいない。

    玄人志向HD4350 graphics cardには、DVI-D, HDMI, D-sub15の三つのInterfaceがあります。DFP5がDVI-D, HDMIがDFP1なのかもしれません。この辺り、ADMのサイトに資料は見当たらないように思えます。

     

    2. X1250 + CCC 9.3 Single Link, リフレッシュレート変更可

    HD4350がうまくいかないのならば、on board VGAのX1250はどうかと、BIOSで切り替えし、CCC 9.3に入れ替えてみました。xorg.confを書き換えて、リフレッシュレートを51Hzにしてみしまた。モニターの表示が60Hzではなくて、2048x1536 51Hzとなっています。ただし、DVIはsingle linkになってしまうようで、画面が半分になり、表示の乱れも大きいです。そこで、50Hzから5Hzずつリフレッシュレートを下げていったところ、35Hzにて表示の安定した画面が得られました。

    35Hzのときのxorg.confの抜粋を以下に示します。Modelineはgtf 2048 1536 35 の結果です。VerRefreshは決めうちにしていました。

    Section "Monitor"
            Identifier   "IBM-T210"
            Option      "VendorName" "IBM"
            Option      "ModelName" "T210 6659-HG2"
            Option      "DPMS" "true"
            VertRefresh  35
      Modeline "2048x1536_35.00"  149.18  2048 2168 2384 2720  1536 1537 1540 1567  -HSync +Vsync

    EndSection
    Section "Device"
            Identifier  "aticonfig-Device[0]-0"
            Driver      "fglrx"
            BusID       "PCI:1:5:0"
    EndSection
    Section "Screen"
            Identifier "aticonfig-Screen[0]-0"
            Device     "aticonfig-Device[0]-0"
            Monitor    "IBM-T210"
            DefaultDepth     24
            SubSection "Display"
                    Viewport   0 0
                    Depth     24
            EndSubSection
    EndSection

    また、このときのXorg.0.logの内容は下記のようになります。


    (II) fglrx(0): ***Display: ConnectedDisplayTypes=0x00000080, disabled=0x00000000
    (II) fglrx(0): Connected Display1: DFP on secondary TMDS [tmds2i]
    (II) fglrx(0): Display1 EDID data ---------------------------



    (WW) fglrx(0): Only one display is connnected,so single mode is enabled
    (II) fglrx(0): Primary Controller - DFP on secondary TMDS
    (II) fglrx(0): Internal Desktop Setting: 0x00000001
    (II) fglrx(0): POWERplay not supported on this hardware
    (WW) fglrx(0): Only one display is connnected,so single mode is enabled

    これで良ければ、HD4350 graphics cardやDVI-D dual link cableを買うことはなかったのですが。リフレッシュレートが35Hzでは、マウスカーソルの追従性が心持ち良くないようです。

    dvi-35
    DVI 35HzのときのT210 モニター表示です。

     

    3.  HD4350 + 標準ドライバー、リフレッシュレート変更可

    X1250をBIOSからdisableとして、CCC 9.3をuninstallしたところで、HD4350 + 標準ドライバーR500にて、リフレッシュレートの変更を試してみました。50Hzから1Hzずつ下げていったところ、45Hzにて画面表示の乱れがなくなりました。ですが、このリフレッシュレートでも表示の乱れが発生することもあり、38Hzまで下げたところで安定した表示になりました。

    45Hzのときのxorg.confの抜粋を以下に示します。Modelineはgtf 2048 1536 45 の結果です。

    Section "Monitor"
            Identifier   "IBM-T210-VGA"
            VendorName "IBM"
            ModelName "T210 6659-HG2"
            Option "monitor-VGA-0" "IBM-T210-VGA"
            Option      "DPMS" "true"
            Option      "ReducedBlanking"
            VertRefresh  60
            Modeline "2048x1536_60.00"  266.95  2048 2200 2424 2800  1536 1537 1540 1589  -HSync +Vsync
    EndSection
    Section "Monitor"
            Identifier   "IBM-T210-DVI"
            VendorName "IBM"
            ModelName "T210 6659-HG2"
            Option "monitor-DVI-0" "IBM-T210-DVI"
            Option      "DPMS" "true"
            Option      "ReducedBlanking"
            VertRefresh  35-55
            Modeline "2048x1536_45.00"  195.17  2048 2176 2400 2752  1536 1537 1540 1576  -HSync +Vsync

    EndSection
    Section "Device"
        Identifier  "Videocard0"
        Driver      "r500"
        Option "monitor-VGA-0" "IBM-T210-VGA"
        Option "monitor-DVI-0" "IBM-T210-DVI"
        Option "RROutputOrder" "IBM-T210-DVI"

    EndSection
    Section "Screen"
        Identifier "Screen0"
        Device     "Videocard0"
        Monitor    "IBM-T210-DVI"
        DefaultDepth     24
        SubSection "Display"
            Viewport   0 0
            Depth     24
        EndSubSection
    EndSection

    “IBM-T210-VGA”をD-sub 15 analog VGA用として定義しました。こちらのリフレッシュレートは 60Hzです。DVI用には”IBM-T210-DVI”を定義しました。

     

    また、このときのXorg.0.logの内容は下記のようになります。


    (II) R500(0): Output VGA-0 using monitor section IBM-T210-VGA
    (II) R500(0): I2C bus "VGA-0" initialized.

    (II) R500(0): Output HDMI-0 has no monitor section
    (II) R500(0): I2C bus "HDMI-0" initialized.
    (II) R500(0): Output DVI-0 using monitor section IBM-T210-DVI
    (II) R500(0): I2C bus "DVI-0" initialized.

    (II) R500(0): Port0:
      XRANDR name: VGA-0

      Connector: VGA
      CRT2: INTERNAL_KLDSCP_DAC2
      DDC reg: 0x7e50
    (II) R500(0): Port1:
      XRANDR name: HDMI-0
      Connector: HDMI-B
      DFP1: INTERNAL_UNIPHY
      DDC reg: 0x7e40
    (II) R500(0): Port2:
      XRANDR name: DVI-0
      Connector: DVI-I

      CRT1: INTERNAL_KLDSCP_DAC1
      DFP2: INTERNAL_UNIPHY2
      DDC reg: 0x7f10
    (II) R500(0): I2C device "VGA-0:E-EDID segment register" registered at address 0x60.
    (II) R500(0): I2C device "VGA-0:ddc2" registered at address 0xA0.
    (II) R500(0): Output: VGA-0, Detected Monitor Type: 0
    Dac detection success
    finished output detect: 0
    (II) R500(0): I2C device "HDMI-0:E-EDID segment register" registered at address 0x60.
    (II) R500(0): I2C device "HDMI-0:ddc2" registered at address 0xA0.
    (II) R500(0): Output: HDMI-0, Detected Monitor Type: 0
    finished output detect: 1
    (II) R500(0): I2C device "DVI-0:E-EDID segment register" registered at address 0x60.
    (II) R500(0): I2C device "DVI-0:ddc2" registered at address 0xA0.
    (II) R500(0): Output: DVI-0, Detected Monitor Type: 3
    (II) R500(0): EDID data from the display on output: DVI-0
    ----------------------
    (II) R500(0): Manufacturer: IBM  Model: 1a03  Serial#: 16843009



    (II) R500(0): Output: VGA-0, Detected Monitor Type: 0
    Dac detection success
    (II) R500(0): EDID for output VGA-0
    (II) R500(0): Output: HDMI-0, Detected Monitor Type: 0
    (II) R500(0): EDID for output HDMI-0
    (II) R500(0): EDID for output DVI-0
    (II) R500(0): Manufacturer: IBM  Model: 1a03  Serial#: 16843009

    D-sub 15pinのVGAは”VGA-0”、DVIは”DVI-0”となっているようです。また、ぞれぞれに用意したMontor sectionが割り当てられています。

     

    dvi-45
    45Hzのときのモニター表示です。

     

    4. × HD4350 + CCC 10.7, リフレッシュレート変更失敗

    CCC 10.7を再度導入します。DFP5にMonitor sectionを割り当てる設定としましたが、X11 Serverの起動途中で止まってしまいます。そのためシステムリセットをする必要があります。ファイルシステムが壊れてしまう可能性があるため、別途環境を用意して、テストを行う予定です。

     

    5. 番外

    夜半からの雨で気温の低い早朝のことですが、5分間くらい HD4350 + DVI-D dual linkの環境で60Hz駆動のときに陰やゴーストが見えないことがありました。しばらくするとピンクの陰が出てきました。このことからすると、一番熱の発生が高いGraphics cardが定格の2048x1536 dots, 60Hzに追従できていない可能性があります。モニターはファン内蔵ですから、ほとんど熱を持ちませんし、DVIケーブルもそんなに発熱するものとも思えません。Graphics cardにはフィンのみで放熱ファンはありません。早朝と夜間のみ利用するものでも、ここのところの高温でPCケースの廃熱が間に合わないのかもしれません。冷却スプレーとまでは行かなくとも、ケースを開けて、ファンで冷やせば動作が変わる可能性はあります。

    3,450円のgraphics cardに高望みしすぎるとは思いますが、ゲームをするわけではないので、高性能なカードの購入には踏み切れません。

     

    6. 参考リンク

     

    7. 更新履歴

    • 2010/08/04: Initial release
    • 2010/08/08: Fix typo