Wednesday, January 27, 2016

MB865: Hard Reset

  • Press both Volume keys, and then hold Power.
  • Wait for Boot Mode to load and use Volume Down to scroll.
  • Select Android Recovery and press Volume Up when in this mode.
  • When the logo shows up, press both Volume keys until the menu appears.
  • Select Factory Reset using Volume buttons and move further with Power.
  • Choose Yes and confirm it with the same Power button.
  • After all files all deleted, press Power to choose Reboot System Now.

  • Saturday, January 23, 2016

    UX305LA: Sound in Slackware64 current (14.2)

    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

    Sunday, June 23, 2013

    Installing Slackware 14 from a USB drive

    The following notes collect important tips to consider in the installation of Slackware 14.

    Before any modification in my computer I use to load a USB drive with Slax, in case something goes wrong I can use it to fix problems or to find help on Internet.
    1. Download Slax
    2. Install it in a USB drive (this erase all data in it).
      1. Extract Slax inside it.
      2. Run the script xxxx.sh for make it bootable.
    3. Boot one time to try it and to verify all works fine.
    Downloading Slackware by torrent.
    I like download the DVD ISO by using torrent, you can find it in the Slackware official site (~2,3GiB).

    Installing the complete distribution in the USB drive and do it bootable
    1. To mount Slackware iso image, it should be done by root user: # mount -t iso9660 -o loop /.../slackware-14.0-iso/slackware-14.0-install-dvd.iso /media/dvd
    2. Go to /../usb-and-pxe-installers folder: $ cd /media/dvd/usb-and-pxe-installers/
    3. Type $ sh usbimg2disk.sh -h to getting help.
    4. With the pendrive unmounted run this command as root: $ sh usbimg2disk.sh -f -s /media/dvd/ -o /dev/sdc where -s /media/dvd/ is the folder were Slackware tree is mounted, and /dev/sdc the path to the pendrive. -f is the parameter to format the pendrive. Note that pendrive shouldn't be mounted before run this script, if you do it, unplug it and plug it again but without mounting it.
    Booting from the USB drive
    If the computer doesn't boot automatically from the USB drive, you will have to find the correct configuration inside the BIOS setup. Usually you have to change the order of the devices that can boot the system, put the USB drive in the first place. In some systems the USB drive have to be plugged to appears in the devices list.

    Kernel selection
    After the Slackware installer boots it will ask you for witch kind of kernel should it use. You have two options: huge.s and hugesmp.s, the first should be used in computer with single processor while the second in multiprocessors computers. I have chose hugesmp.s.

    Preparing the hard drive
    This time I have change the partitions in the hard drive, I have created one for the / folder (20GiB, ext4), another for swap (2GiB, linux swap), a third for the /home folder (80GiB, ext4) and the rest available space in a fourth partition for a testing area (ext4).

    Installing Slackware
    I use to avoid the installation of games and FAQs, then I chose the complete installation without prompting.

    A good practice is to mount the /home folder in a different partition. This helps when you do an update of the operating system conserving users files and configurations.

    Sunday, October 07, 2012

    Configuring Slackware 14

    Lilo Configuration
    By default Lilo gives two options of OS to start, Windows and Linux, and wait a minute to run automatically the first option. I just have Slackware in my PC so it is unnecessary that Lilo asks and wait.

    To change the default Lilo behavior you have to change /etc/lilo.conf, this is what I have changed.

    1. No waiting until systems starts. Comment prompt line
    # Wait until the timeout to boot (if commented out, boot the
    # first entry immediately):
    #prompt


    2. No Windows option. Comment or delete the Windows section at the end of the config file:
    #other = /dev/sdb1
    #label = Windows
    #table = /dev/sdb


    3. Use the command compact to skip memtest and start the system quickly.

    To apply any modification to the boot loader it is necessary to run the command lilo.
    # lilo


    Configuring the system to multi user with session manager
    Most of the time I use KDE, so I prefer start KDM it when the system goes up. To do that you have to change the default runlevel configuration in file /etc/initab to the option 4:
    # 4 = X11 with KDM/GDM/XDM (session managers)
    ...
    # Default runlevel. (Do not set to 0 or 6)
    id:4:initdefault:

    Problem:
    After booting in runlevel 4 the computer showed an error with the sound card and didn't play any sound. This is because in runlevel 4 users don't belong the audio group, so you have to add your user to it.

    # usermod -aG audio user_name

    This problem can affect other resources, as scanners, printers, etc the solution should be adding the user to the appropriate group.

    Network manager configuration
    In this distribution KDE gets its own network manager, if you want to use it just changes permissions of rc.networkmanager:
    # chmod 755 /etc/rc.d/rc.networkmanager

    In case you prefer wicd, you have to install it from /extra/wicd folder in the Slackware installation DVD and change permission to /etc/rc.d/rc.wicd to 755 after installation.

    Saturday, March 19, 2011

    Managing users and groups

    To add a new user:
    # useradd -m user_name

    To set or change a user password :
    # passwd user_name

    To modify an user account:
    # usermod [options] user_name

    To delete an user:
    # userdel - Delete a user account and related files
    # deluser - remove a user from the system

    To add an user to a secondary group (append a group to a user):
    # usermod -aG group_name user_name

    To show the groups that belongs a user:
    This show a reduced set of groups (maybe just the secondary groups)
    # groups user_name

    If the user uses the command groups without a user name, it will show an extended list of groups (maybe the primaries and secondaries groups)

    The command id -nG user_name has the same behavior that group.

    To remove a user from a group:
    it is needed write all the groups the user belongs less the unwanted groups.
    # usermod -G {groupname1,groupname2,...} user_name

    To add a new group:
     # groupadd group_name

    To modify a group:
     # groupmod [options] group_mane

    To delete a group:
    # groupdel - Delete a group
    # delgroup - remove a group from the system

    You can edit manually the OS groups file (needs logout-login):
    # vi /etc/group

    Example:
    In KDE with HAL: The error that appears when I pugged a USB HDD was solved adding my user to the groups users and plugdev:
    # usermod -aG users my_user
    # usermod -aG plugdev my_user

    Sunday, December 26, 2010

    Slackware 13.1+ i810

    I have installed Slackware 13.1 six month ago and since that I have a problem with video. Sometimes while I'm working the screen keeps freezing, I can move the mouse and see how the pointer moves, but always the screen shows the same image. In the console I have found the following error:

    (EE) intel(0): Failed to submit batch buffer, expect rendering corruption or even a frozen display: Input/output error.

    I have tried a pair of times solve the problem, but never successfully. Now I'm going again, taking care of documenting everything.

    My graphic card is: Intel Corporation 82852/855GM Integrated Graphics Device (rev 02)

    I used to use the i810 driver from Intel, but now this driver is deprecated and replaced by Intel graphic driver that support more cards from Intel.

    The configuration:

    • Kernel: 2.6.33.4-smp
    • Xorg server: 1.7.7
    • xf86-video-intel: 2.11.0

    I have found these error in Xorg.0.log :

    (II) LoadModule: "fbdev"
    (WW) Warning, couldn't open module fbdev
    (II) UnloadModule: "fbdev"
    (EE) Failed to load module "fbdev" (module does not exist, 0)

    I have used xorgsetup to create a xorg.conf file, after that I have not seen the error again. But glxgears goes very slow yet, and possibly the video will fail again.

    Listing just directories with "ls"

    Basic but not so obvious for me:
    For listing only the directories in, for example, /dev:

    $ ls -d /dev/*/
    /dev/block/ /dev/bsg/ /dev/bus/ /dev/char/ /dev/disk/ /dev/dri/ /dev/fd/ /dev/input/ /dev/mapper/ /dev/pts/ /dev/shm/ /dev/snd/

    $ ls -adl /dev/*/
    drwxr-xr-x 2 root root 720 2010-12-26 11:41 /dev/block/
    drwxr-xr-x 2 root root 140 2010-12-26 11:41 /dev/bsg/
    drwxr-xr-x 3 root root 60 2010-12-26 08:31 /dev/bus/
    drwxr-xr-x 2 root root 4660 2010-12-26 11:41 /dev/char/
    drwxr-xr-x 6 root root 120 2010-12-26 11:41 /dev/disk/
    drwxr-xr-x 2 root root 80 2010-12-26 08:31 /dev/dri/
    dr-x------ 2 felipe felipe 0 2010-12-26 12:21 /dev/fd/
    drwxr-xr-x 3 root root 260 2010-12-26 08:31 /dev/input/
    drwxr-xr-x 2 root root 60 2010-12-26 08:31 /dev/mapper/
    drwxr-xr-x 2 root root 0 2010-12-26 08:31 /dev/pts/
    drwxrwxrwt 2 root root 40 2010-12-26 11:31 /dev/shm/
    drwxr-xr-x 3 root root 240 2010-12-26 11:32 /dev/snd/

    $ ls -adl /dev/*/*/
    drwxr-xr-x 6 root root 120 2010-12-26 08:31 /dev/bus/usb/
    drwxr-xr-x 2 root root 300 2010-12-26 11:41 /dev/disk/by-id/
    drwxr-xr-x 2 root root 80 2010-12-26 11:41 /dev/disk/by-label/
    drwxr-xr-x 2 root root 220 2010-12-26 11:41 /dev/disk/by-path/
    drwxr-xr-x 2 root root 120 2010-12-26 11:41 /dev/disk/by-uuid/
    drwxr-xr-x 2 root root 100 2010-12-26 08:31 /dev/input/by-path/
    drwxr-xr-x 2 root root 60 2010-12-26 08:31 /dev/snd/by-path/

    For listing the current directory: ls -d */