четверг, 12 сентября 2013 г.

Linux on Dell Inspiron 7520 (6624)

Dell Inspiron 7520 (submodel 6624) is a 15.6" laptop with 1366x768 TN display, 6 GB of RAM, and 750 GB of HDD. Has Intel Core i7-3632QM(2.2) CPU, DVD±RW DL, and equipped with 2048MB AMD Radeon HD7730 video adapter.

Both videoadapters, SD card reader, DVD drive, webcam, Wi-Fi, USB 3.0, all works out-of-the-box with Linux 3.10. AMD video needs proprietary driver to operate properly. (Can be shut down using vgaswitcheroo). Multimedia keys (Fn+Fx) work too, but three keys which are separated group, don't. By "works" I mean they generate either ACPI events or scan-codes.

Quirks

Add acpi_osi="!Windows 2012" to kernel command line. This makes backlight control work and solves spontaneous hangups with recent (2.21.15) intel videodriver.

Touchpad toggle key don't switch touchpad off, just generates scan code. The following script can be used to toggle it on and off:
#!/bin/sh
 
if synclient -l | grep -q 'TouchpadOff             = 0'; then
    synclient TouchpadOff=1
else
    synclient TouchpadOff=0
fi
 
Fan cannot be controled via any pwm interface. Although i8kutils package have everything nessesary to manage the fan. i8kfan 0 0 switches fan off, i8kfan 1 1 on, i8kfan 2 2 sets it to the maximum (noisy). i8kmon can monitor temperature and change fan speed accordingly. I use this /etc/i8kmon.cfg:

set config(0) {{- 0} -1 45 -1 45}
set config(1) {{- 1} 40 65 40 65}
set config(2) {{- 2} 60 128 60 128}

It seems turbo mode is activated all the time. It improves performance but CPU temperature can easily reach 70-80 °C. The issue can be solved by adding

echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo

to /etc/rc.local.
I don't need discrete video adapter at the time, so it's turned off too:

echo OFF > /sys/kernel/debug/vgaswitcheroo/switch

lspci -nn output

00:00.0 Host bridge [0600]: Intel Corporation 3rd Gen Core processor DRAM Controller [8086:0154] (rev 09)
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port [8086:0151] (rev 09)
00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09)
00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)
00:16.0 Communication controller [0780]: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 [8086:1e3a] (rev 04)
00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)
00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)
00:1c.0 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 [8086:1e10] (rev c4)
00:1c.1 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 [8086:1e12] (rev c4)
00:1d.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 [8086:1e26] (rev 04)
00:1f.0 ISA bridge [0601]: Intel Corporation HM77 Express Chipset LPC Controller [8086:1e57] (rev 04)
00:1f.2 SATA controller [0106]: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] [8086:1e03] (rev 04)
00:1f.3 SMBus [0c05]: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller [8086:1e22] (rev 04)
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Chelsea LP [Radeon HD 7730M] [1002:682f] (rev ff)
07:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 07)
08:00.0 Network controller [0280]: Intel Corporation Centrino Wireless-N 2230 [8086:0887] (rev c4)

lsusb output

Bus 004 Device 003: ID 8087:07da Intel Corp. 
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 004: ID 1bcf:2896 Sunplus Innovation Technology Inc. 
Bus 003 Device 003: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

lspci -knn output

00:00.0 Host bridge [0600]: Intel Corporation 3rd Gen Core processor DRAM Controller [8086:0154] (rev 09)
 Subsystem: Dell Device [1028:0572]
00:01.0 PCI bridge [0604]: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor PCI Express Root Port [8086:0151] (rev 09)
 Kernel driver in use: pcieport
00:02.0 VGA compatible controller [0300]: Intel Corporation 3rd Gen Core processor Graphics Controller [8086:0166] (rev 09)
 Subsystem: Dell Device [1028:0572]
 Kernel driver in use: i915
00:14.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller [8086:1e31] (rev 04)
 Subsystem: Dell Device [1028:0572]
 Kernel driver in use: xhci_hcd
00:16.0 Communication controller [0780]: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 [8086:1e3a] (rev 04)
 Subsystem: Dell Device [1028:0572]
 Kernel driver in use: mei_me
00:1a.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 [8086:1e2d] (rev 04)
 Subsystem: Dell Device [1028:0572]
 Kernel driver in use: ehci-pci
00:1b.0 Audio device [0403]: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller [8086:1e20] (rev 04)
 Subsystem: Dell Device [1028:0572]
 Kernel driver in use: snd_hda_intel
00:1c.0 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 [8086:1e10] (rev c4)
 Kernel driver in use: pcieport
00:1c.1 PCI bridge [0604]: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 [8086:1e12] (rev c4)
 Kernel driver in use: pcieport
00:1d.0 USB controller [0c03]: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 [8086:1e26] (rev 04)
 Subsystem: Dell Device [1028:0572]
 Kernel driver in use: ehci-pci
00:1f.0 ISA bridge [0601]: Intel Corporation HM77 Express Chipset LPC Controller [8086:1e57] (rev 04)
 Subsystem: Dell Device [1028:0572]
 Kernel driver in use: lpc_ich
00:1f.2 SATA controller [0106]: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] [8086:1e03] (rev 04)
 Subsystem: Dell Device [1028:0572]
 Kernel driver in use: ahci
00:1f.3 SMBus [0c05]: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller [8086:1e22] (rev 04)
 Subsystem: Dell Device [1028:0572]
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Chelsea LP [Radeon HD 7730M] [1002:682f] (rev ff)
 Kernel driver in use: radeon
07:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 07)
 Subsystem: Dell Device [1028:0572]
 Kernel driver in use: r8169
08:00.0 Network controller [0280]: Intel Corporation Centrino Wireless-N 2230 [8086:0887] (rev c4)
 Subsystem: Intel Corporation Centrino Wireless-N 2230 BGN [8086:4462]
 Kernel driver in use: iwlwifi

вторник, 10 сентября 2013 г.

bash: open Thunar window from here

I'm using Xfce as primary desktop environment and Thunar (default) as GUI file manager. Thunar has a nice feature: terminal emulator can be opened at any directory. It's nice, but sometimes I need to do the opposite, open Thunar window at the directory I'm currently in. I must type thunar to do so and it's too long. Why not reuse dot? That's the feature I miss from Windows command line a lot.

Add this to .bashrc:

function .() {
  if [ $# -eq 0 ]; then
    thunar
  else
    source $*
  fi
}
 
Works nice so far.

пятница, 8 марта 2013 г.

scaling performance of libswscale versus OpenGL

There are many ways to scale an image. One can use provided libraries, or implement scaling via OpenGL pipeline. Latter choice looks preferred, as it uses hardware part which is desined to do suck tasks efficiently. But how fast OpenGL is? I've got following results on Celeron P4500 (it has integrated Ironlake video chip):

воскресенье, 24 февраля 2013 г.

redscale

I heard it is easier to look at red-colored interface. Don't know if it's true, or I just convinced myself, but it's really easier for me to read red text.
One can use
xcalib -invert -alter
to invert all output, but that don't cope with making it red. Fortunately, there is Color filter plugin for compiz that can alter colors both for whole desktop and for selected windows. One can use predefined present or create his own, by writing GL ARB fragment program. Here is one for reverse redscale:
!!ARBfp1.0
TEMP tex;
TEMP tex2;
TEX tex, fragment.texcoord[0], texture[0], RECT;
MOV tex2, {0, 0.0, 0.0, 1.0};
DP3 tex2.r, tex, {0.33333, 0.33333, 0.33333, 0};
ADD tex2.r, 1.0, -tex2.r;
MOV result.color, tex2.rbga;
END
and for redscale
!!ARBfp1.0
TEMP tex;
TEMP tex2;
TEX tex, fragment.texcoord[0], texture[0], RECT;
MOV tex2, {0, 0, 0, 0};
DP3 tex2.r, tex, {0.33333, 0.33333, 0.33333, 0};
MOV result.color, tex2.rbga;
END

Copy text to file, then select it in compiz config. Super-f activates shader for current window, Super-d for whole desktop.