Showing posts with label UX305LA. Show all posts
Showing posts with label UX305LA. Show all posts

Wednesday, July 27, 2016

Setting Hidpi

I did not set the DPI in Xorg. I just change in KDE the font DPI to 166 pp. This setting works fine for almost everything inside KDE but the xterm is not affected and the font looks tiny. In Window Maker everything looks small as well, but I don't know if it is possible to change that.

Another point to improve is the font size in the tty consoles, now it is very small. I know how to do it but I still have to.

Just to remember, the screen resolution is 3200 x 1800 @ 276 ppi.

Keyboard layout

My current laptop uses a German keyboard (QWERTZ), also I use to use another US-international, so I have to configure the system to use both.

I need to write in Spanish frequently. The default German layout (no death keys) works fine but it doesn't allow to write the ñ letter. The legacy version uses death keys and allows to write the lovely ñ.

Linux console:
To change the default keyboard layout, create the file:
# /etc/rc.d/rc.keymap

#!/bin/sh
# Load the keyboard map.  More maps are in /usr/share/kbd/keymaps.
if [ -x /usr/bin/loadkeys ]; then
 /usr/bin/loadkeys de-latin1.map
fi

Xorg
This settings will affect all the Xorg application, thats include KDE and Window Maker. Just create the following config file.

# /etc/X11/xorg.conf.d/90-keyboard-layout.conf

Section "InputClass"
Identifier "keyboard-all"
MatchIsKeyboard "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "XkbLayout" "de"
Option "XkbVariant" "legacy"
Option "XkbOptions" "terminate:ctrl_alt_bksp"
EndSection

KDE
Normaly KDE will use the keymap defined by Xorg, but in the case you want to set it again in KDE, just choose the German variant German (legacy) as keyboard layout in the Input devices section of the System Settings.

There still a problem prowling around. It is the special keys, most of them works ok with the exception of the airplane mode and the increase and decrease brightness. They doesn't work, I think they are not visible in linux, but I have to check this.

Also I have to try what happens with the second keyboard, I have not tried yet.

Sunday, May 29, 2016

Hibernation

By default, Slackware restarts from hibernation following the standard booting, loosing the state previously saved in the swap partition. To solve this, I edited the boot loader configuration, which in my case is ELILO. This is the result.

# /boot/efi/EFI/Slackware/elilo.conf

# The prompt line tells ELILO to display a prompt for you to choose a kernel.
#prompt

# tells ELILO to wait 5 seconds for you to respond. (This value is specified in 
# tenths of a second.) If you don't respond, it boots the image specified by the 
# default line.
#timeout=50

# Sets the default stanza to load (the name is sets by 'label=').
default=Slackware

# chooser specify kernel chooser to use: 'simple' or 'textmenu'.
#chooser=simple

# delay specifies the number of tenths of a second the boot loader should wait 
# before automatically booting a locked command line, a command line pre-stored 
# by "lilo -R", or the default 'image=' or 'other='.
#delay=10

# Stanzas
image=vmlinuz
label = Slackware
root = /dev/sda3
        read-only
        append="resume=/dev/sda2"

The magic here is done by the line append="resume=/dev/sda2", now ELILO knows that it have to start Slackware from the swap partition.

Reference: http://docs.slackware.com

Saturday, January 23, 2016

Sound in Slackware64 current (14.2)

UPDATE:
I installed Plasma 5.2 and now it is possible to change the output device from the System Settings > Multimedia window. Still is not a clean process but, it is cleaner than to copy and delete the asound.conf file. The procedure consisted in just to move upwards the HDMI output device in the Audio Playback option from the Audio and Video section. In my case the sub device connected to the HDMI port is the 0,7 (HDMI 2). Then, this devise also should be selected as profile in the Audio Hardware Setup tab. I tried to make a new Activity with the new configuration, but it didn't work due to the fact that all the activities share the same System Configuration, if you change something in one, it will also change in the others. Also, the configuration file snd-hda-intel.conf is not needed anymore.
---

After installing Slackware64-current (2015.12.29) I did not have sound neither in the speakers nor in the headphones. So I checked how ALSA had detected the soundcards:

$ cat /proc/asound/cards
0 [HDMI ]: HDA-Intel - HDA Intel HDMI
               HDA Intel HDMI at 0xb211c000 irq 50
1 [PCH  ]: HDA-Intel - HDA Intel PCH
               HDA Intel PCH at 0xb2118000 irq 47

So, ALSA configured the HDMI card as first device and it used it as default. Connecting the HDMI port to a TV the sound flew from the TV speakers. The problem was solved by switching the name of both cards in the file /etc/modprobe.d/snd-hda-intel.conf


/etc/modprobe.d/snd-hda-intel.conf
options snd-hda-intel model=auto

alias char-major-116 snd

alias snd-card-0 snd-hda-intel
alias snd-card-1 snd-hda-intel

options snd-hda-intel id=PCH index=0

options snd-hda-intel id=HDMI index=1
#

After rebooting, the sound started to work properly in the speakers and headphones. Auto-mute mode worked fine as well. 

$ cat /proc/asound/cards
0 [PCH   ]: HDA-Intel - HDA Intel PCH
                HDA Intel PCH at 0xb2118000 irq 47 
1 [HDMI ]: HDA-Intel - HDA Intel HDMI
                HDA Intel HDMI at 0xb211c000 irq 50

In the other hand, connecting the HDMI port did not change the sound output. In other words, although there was video in the TV, the sound came out from the computer's speakers or headphones.  
The solution of this problem is not trivial. Some people try to solve it changing the default card every time they use a different card. Although it seem that it is possible to build a script to overwrite the setting (defined in /etc/asound.conf) i found this solution too dirty. Instead, I followed the idea of cloning the sound from one card to the another, so, always in both cards (PCH and HDMI) will sound the same audio and will be possible to just mute the computer's speakers when it will be connected to a TV.

After a couple of hours looking for a solution and a lot of try and error, I found a good reference to follow. Finally, The solution consisted in configure ALSA to create a virtual device which route the audio to both devices. Also, the configuration solves the error that occurs when multiple applications try to access to the virtual card at the same time. The configuration is made in /etc/asound.conf :

# /etc/asound.conf
pcm.PCH {
        type hw
        card 0
        device 0 }
        
ctl.PCH {
        type hw
        card 0
        device 0 }        

pcm.HDMI {
        type hw
        card 1
        device 7 }     

ctl.HDMI {
        type hw
        card 1
        device 7 }        

pcm.PCHDmixed {
   type dmix
   ipc_key 1024
   ipc_key_add_uid false
   ipc_perm 0666
   slave {
       pcm "PCH"
       period_time 0
       period_size 2048
       channels 2
    }
    bindings {
       0 0
       1 1
    }
}

pcm.HDMIDmixed {
   type dmix
   ipc_key 2048
   ipc_key_add_uid false
   ipc_perm 0666
   slave {
       pcm "HDMI"
       period_time 0
       period_size 2048
       channels 2
    }
    bindings {
       0 0
       1 1
    }
}

pcm.both {
    type route;
    slave.pcm {
        type multi;
        slaves.a.pcm "HDMIDmixed";
        slaves.b.pcm "PCHDmixed";
        slaves.a.channels 2;
        slaves.b.channels 2;
        bindings.0.slave a;
        bindings.0.channel 0;
        bindings.1.slave a;
        bindings.1.channel 1;
       
        bindings.2.slave b;
        bindings.2.channel 0;
        bindings.3.slave b;
        bindings.3.channel 1;
    }
   
    ttable.0.0 1;
    ttable.1.1 1;
   
    ttable.0.2 1; 
    ttable.1.3 1; 
}

pcm.!default {
        type  plug
        slave.pcm "both"}
        
ctl.!default {
        type  hw
        card PCH}
#

The sections pcm.PCHDmixed  and pcm.HDMIDmixed are needed to face the problem with concurrent sound from different applications. The section pcm.both defines a new PCM consisting of 4 channels, two from the PCH card and two from the HDMI card. PCM is a stereo card and, I guess, HDMI is it as well (at least the TV is it). The magic is finally done by routing the audio channels to the correct speakers (physical channels). This is done by the ttable sentence. It took me a bit long to understand the logic behind but finally I understood the syntax as follow:

ttable.speaker.channel gain

Here, the speakers are coded as: 0 = front left; 1 = front right; 2 = rear left; 3 = rear right;  4 = center; 5 = subwoofer. Meanwhile, channel is the number of the binding connected to an audio channel. Finally, gain is a factor applied to modify the loudness of the channel (0.5 -> 50%).

In between I found that ALSA stores it last parameters in the file /var/lib/alsa/asound.state (there is a link in /etc/) which is written when the computer shutdown. There is a method to temporarily remove it in this link.

I did a fast check connecting a TV and it works fine. But, I think, it still need to be tested with details.

Update: Skype reported that there is not mic available. It is needed to configure a capture channel with dmix. 

Tuesday, December 15, 2015

Asus UX305LA: Hardware

# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    2
Core(s) per socket:    2
Socket(s):             1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 61
Model name:            Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
Stepping:              4
CPU MHz:               799.968
CPU max MHz:           3000.0000
CPU min MHz:           500.0000
BogoMIPS:              4789.33
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              4096K

----------
# lspci 
00:00.0 Host bridge: Intel Corporation Broadwell-U Host Bridge -OPI (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Broadwell-U Integrated Graphics (rev 09)
00:03.0 Audio device: Intel Corporation Broadwell-U Audio Controller (rev 09)
00:04.0 Signal processing controller: Intel Corporation Broadwell-U Camarillo Device (rev 09)
00:14.0 USB controller: Intel Corporation Wildcat Point-LP USB xHCI Controller (rev 03)
00:16.0 Communication controller: Intel Corporation Wildcat Point-LP MEI Controller #1 (rev 03)
00:1b.0 Audio device: Intel Corporation Wildcat Point-LP High Definition Audio Controller (rev 03)
00:1c.0 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #1 (rev e3)
00:1c.3 PCI bridge: Intel Corporation Wildcat Point-LP PCI Express Root Port #4 (rev e3)
00:1f.0 ISA bridge: Intel Corporation Wildcat Point-LP LPC Controller (rev 03)
00:1f.2 SATA controller: Intel Corporation Wildcat Point-LP SATA Controller [AHCI Mode] (rev 03)
00:1f.3 SMBus: Intel Corporation Wildcat Point-LP SMBus Controller (rev 03)
00:1f.6 Signal processing controller: Intel Corporation Wildcat Point-LP Thermal Management Controller (rev 03)
02:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)

----------
# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 064e:9700 Suyin Corp. Asus Integrated Webcam
Bus 001 Device 003: ID 8087:0a2a Intel Corp. 
Bus 001 Device 002: ID 045e:07a5 Microsoft Corp. Wireless Receiver 1461C
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

----------
# lsblk 
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 238.5G  0 disk 
|-sda1   8:1    0   100M  0 part /boot/efi
|-sda2   8:2    0     8G  0 part [SWAP]
|-sda3   8:3    0    20G  0 part /
`-sda4   8:4    0 210.4G  0 part /home

----------
# free
              total        used        free      shared  buff/cache   available
Mem:        8059700      482956     6882264      234844      694480     7278928
Swap:       8388604           0     8388604

----------
# hdparm -i /dev/sda 

/dev/sda:

 Model=Micron_M600_MTFDDAV256MBF, FwRev=MA01, SerialNo=15130F491CAF
 Config={ Fixed DTR>10Mbs }
 RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=0
 BuffType=unknown, BuffSize=unknown, MaxMultSect=16, MultSect=off
 CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=500118192
 IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
 PIO modes:  pio0 pio3 pio4 
 DMA modes:  mdma0 mdma1 mdma2 
 UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6 
 AdvancedPM=yes: unknown setting WriteCache=enabled
 Drive conforms to: unknown:  ATA/ATAPI-3,4,5,6,7

 * signifies the current active mode