2015年2月17日 星期二

Canonical 台北 Office


-- 活動 Kevin Huang 歡送會 @ 隨意吧 2015

2015年2月8日 星期日

Canonical Hardware Enablement team, 2015



-- 活動 HWE Sprint、攝於 Canonical Lexington Office, MA

2012年6月11日 星期一

在 Ubuntu 上執行 Diablo 3 (暗黑破壞神)

首先我的顯示卡是 AMD Radeon HD7750,可惜這麼新的硬體在 Ubuntu 中的支援一向不是很好。

所以需要 AMD Catalyst™ 12.6 Beta Driver (fglrx 8.980),Linux 版驅動程式下載位置。

下載下來解壓縮,再將它轉成 .deb 套件,再安裝。

./amd-driver-installer-8.98-x86.x86_64.run --buildpkg Ubuntu/precise
sudo dpkg -i fglrx-amdcccle_8.980-0ubuntu1_amd64.deb fglrx_8.980-0ubuntu1_amd64.deb

接下來要為 wine apply 幾個給 Diablo 3 用的 patch;還有一個為了 HD7750 我寫的 patch;因為我也有玩 WoW,所以也加了一個魔獸的 patch。

PPA下載位置: https://launchpad.net/~lexical/+archive/diablo3

直接裝應該就可以。接下來再用下列的 script 來啟動。因為我是用 playonline 做出來的 prefix,請自行代換。

#!/bin/sh

echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope

WINEPREFIX=~/.PlayOnLinux/wineprefix/DiabloIII/ WINENOPULSE=1 force_s3tc_enable=true taskset -c 0-1 setarch i386 -3 wine ~/.PlayOnLinux/wineprefix/DiabloIII/drive_c/Program\ Files/Diablo\ III/Diablo\ III -launch -opengl -w

2012年4月18日 星期三

亮度熱鍵和消失的OSD

在這個cycle中,Hardware Enablement team 遇到了好幾款筆電的亮度熱鍵 bug;癥狀為亮度調整功能正常,但是亮度的 OSD 卻沒有出現。

看起來是個小 bug,但是因為牽涉到硬體、kernel 驅動程式和gnome之間行為的互動,而成了有點難解的問題。

主要的問題在於對於亮度鍵的行為在不同的硬體上並沒有統一,有些廠牌的筆電會直接送出 scancode,gnome-settings-daemon 收到 keycode 之後會再去對 driver 產生出來的 sysfs backlight 介面做存取,之後再由 driver 負責來調整亮度。gnome-settings-daemon 在收到 keycode 的同時也會產生 libnotify 的 dbus message,而 notify-osd 收到之後負責畫出 OSD。

但在一些其它的筆電,在按下亮度鍵時並不產生 scancode,而是透過 WMI 通知 OS,kernel driver 在收到後必須負責調整亮度。在這樣的情況下因為沒有 scancode 和 keycode,所以 gnome-settings-daemon不 會收到任何通知,所以也沒有 OSD。

當然我們也可以更改 driver 程式碼,讓 driver 在收到 WMI 時也同時產生 keycode,這樣的確可以讓 OSD 正確的出現;但是因為硬體已經調整了亮度,driver 產生的 keycode 會讓亮度再被調整一次,所以導致只按了一次卻調了兩格亮度的 bug。

一個比較好的解決方式是 gnome-settings-daemon 應該使用 uevent 而不是 keycode(至少在Linux平台上),如 Corentin Chary 在Gnome Bug 672380的comment:

Because what not how it *should be done*. Keys are not notifications at all. Keys are emitted if a user press something that should be interpreted by userspace as "in reponse to this key, please adjust the brightness".

In this case, what we get from the hardware is only a brightness change notification, and it's what we will relay to userspace. It's just how the Linux backlight class works. And, really, the OSD should only pop in response to backlight notification, and never in response to keys, keys should only be used to adjust the backlight (which will pop a notification by itself).