Friday, January 13, 2017

Things I did after installing Fedora 24

Removed evolution application since I don't use it.


dnf remove evolution

Configure RPMFusion repo


wget https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-24.noarch.rpm
rpm -ivh rpmfusion-free-release-24.noarch.rpm 

Upgrade the system


dnf upgrade

Install Intel Linux graphic drivers


wget https://download.01.org/gfx/fedora/24/x86_64/intel-graphics-update-tool-2.0.3-24.intel20163.x86_64.rpm
rpm -ivh intel-graphics-update-tool-2.0.3-24.intel20163.x86_64.rpm 
Run intel-graphics-update-tool command as root and install the Intel drivers

Install VLC and configure hardware acceleration


Read the instructions here,
http://swapoff.blogspot.com/2017/01/how-to-enable-hardware-acceleration-in.html


Install Google Chrome


rpm -ivh google-chrome-stable_current_x86_64.rpm 
warning: google-chrome-stable_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEYerror: Failed dependencies: lsb >= 4.0 is needed by google-chrome-stable-55.0.2883.87-1.x86_64

Install redhat-lsb as well if you receive above error when you try to install Google Chrome.
dnf provides lsb
dnf install redhat-lsb

Install Gnome Tweak Tool and configure it to show files on Desktop


dnf install gnome-tweak-tool

Disable dnf-makecache service


systemctl status dnf-makecache.service
systemctl status dnf-makecache.timer
More information is avaiable here,
http://swapoff.blogspot.com/2015/09/disable-automatic-package-metadata.html

Wednesday, January 11, 2017

How to enable hardware acceleration in VLC running on Fedora 24

I used to use VLC hardware acceleration (http://swapoff.blogspot.com/2014/12/install-libva-intel-driver-to-get-hw.html) because it's a cool thing to have when you play HD videos. Recently I noticed that my CPU is heavily utilized when I played HD videos even though I was under the impression that the hardware acceleration was working. The methods I tried to find out whether the hardware acceleration was working or not gave positive results, but the CPU utilization was telling a different story.

Therefore I tried to understand what was actually happening.

After doing some google searches I landed on a VLC forum thread which describes this was due to the behavior in the FFmpeg library. (https://forum.videolan.org/viewtopic.php?t=134770) According to the information shared in that thread, the library does not support multithreading with hardware acceleration. But VLC set 0 which is auto for the number of threads for FFmpeg.

Therefore changing this value to 1 should work. We can change the value by selecting,  
Tools -> Preferences -> Input/Codecs -> Show Settings All -> Input codecs -> Video codecs -> FFmpeg and set the value of the parameter "Threads" to 1

After setting this value to 1 and restarting the VLC, I tried to play several 720p videos. It actually worked. The CPU utilization was well under 10%.

However when I tried to play a 1080i Blue-Ray video, a nasty thing happened. It triggered a bug in the kernel and crashed the system.

details of the crash from journalctl,

Jan 10 02:31:17 localhost.localdomain kernel: BUG: unable to handle kernel NULL pointer dereference at           (null)
Jan 10 02:31:17 localhost.localdomain kernel: IP: [<ffffffffc019d58d>] gen6_ppgtt_insert_entries+0x14d/0x1d0 [i915]
Jan 10 02:31:17 localhost.localdomain kernel: PGD 0
Jan 10 02:31:17 localhost.localdomain kernel: Oops: 0000 [#1] SMP
Jan 10 02:31:17 localhost.localdomain kernel: Modules linked in: uas usb_storage fuse xt_CHECKSUM ipt_MASQUERADE nf_nat_masquerade_ipv4 tun ip6t_REJECT nf_reject_ipv6 xt_con
Jan 10 02:31:17 localhost.localdomain kernel:  intel_rapl_perf snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm joydev i2c_i801 mei_me i2c_smbus snd_timer snd mei shpch
Jan 10 02:31:17 localhost.localdomain kernel: CPU: 3 PID: 2740 Comm: vlc Not tainted 4.8.15-200.fc24.x86_64 #1
Jan 10 02:31:17 localhost.localdomain kernel: Hardware name: ASUS All Series/H97M-E, BIOS 2302 02/09/2015
Jan 10 02:31:17 localhost.localdomain kernel: task: ffff91804f7f1e80 task.stack: ffff91801e340000
Jan 10 02:31:17 localhost.localdomain kernel: RIP: 0010:[<ffffffffc019d58d>]  [<ffffffffc019d58d>] gen6_ppgtt_insert_entries+0x14d/0x1d0 [i915]
Jan 10 02:31:17 localhost.localdomain kernel: RSP: 0018:ffff91801e3439d8  EFLAGS: 00010246
Jan 10 02:31:17 localhost.localdomain kernel: RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff91808be44000
Jan 10 02:31:17 localhost.localdomain kernel: RDX: ffff91801de7aae0 RSI: ffff918088b01000 RDI: 000000038cc4d000
Jan 10 02:31:17 localhost.localdomain kernel: RBP: ffff91801e343a28 R08: 0000000000000000 R09: ffff91808be44000
Jan 10 02:31:17 localhost.localdomain kernel: R10: 0000000000000000 R11: ffff918088a20000 R12: ffff918088b01ffc
Jan 10 02:31:17 localhost.localdomain kernel: R13: 0000000000000000 R14: ffff91801de7aae0 R15: 0000000000000000
Jan 10 02:31:17 localhost.localdomain kernel: FS:  00007f8b0882a700(0000) GS:ffff91809fb80000(0000) knlGS:0000000000000000
Jan 10 02:31:17 localhost.localdomain kernel: CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jan 10 02:31:17 localhost.localdomain kernel: CR2: 00007fe765248000 CR3: 00000003b4c1a000 CR4: 00000000001406e0
Jan 10 02:31:17 localhost.localdomain kernel: Stack:
Jan 10 02:31:17 localhost.localdomain kernel:  ffff91804f7f1e80 0000000000000200 ffff91808be44000 0000100000000001
Jan 10 02:31:17 localhost.localdomain kernel:  000000038cc4d000 0000000000000000 ffff91801dd0ac00 0000000000000002
Jan 10 02:31:17 localhost.localdomain kernel:  0000000000000001 ffff9180487dba80 ffff91801e343a60 ffffffffc019ee60
Jan 10 02:31:17 localhost.localdomain kernel: Call Trace:
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc019ee60>] aliasing_gtt_bind_vma+0x90/0xe0 [i915]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc01a3e8e>] i915_vma_bind+0xce/0x180 [i915]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc01aa4fb>] i915_gem_object_do_pin+0x86b/0xa60 [i915]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc01aa71d>] i915_gem_object_pin+0x2d/0x30 [i915]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc0198acf>] i915_gem_execbuffer_reserve_vma.isra.20+0x9f/0x180 [i915]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc0198f3b>] i915_gem_execbuffer_reserve.isra.21+0x38b/0x3b0 [i915]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc019a1d8>] i915_gem_do_execbuffer.isra.24+0x6b8/0x1200 [i915]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc019b944>] i915_gem_execbuffer2+0x104/0x260 [i915]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc00cbfa0>] drm_ioctl+0x200/0x4f0 [drm]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffc019b840>] ? i915_gem_execbuffer+0x330/0x330 [i915]
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffb0264cc3>] do_vfs_ioctl+0xa3/0x5f0
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffb0265289>] SyS_ioctl+0x79/0x90
Jan 10 02:31:17 localhost.localdomain kernel:  [<ffffffffb0803b72>] entry_SYSCALL_64_fastpath+0x1a/0xa4
Jan 10 02:31:17 localhost.localdomain kernel: Code: 5f 5d c3 c7 45 cc 00 00 00 00 31 db 48 c7 45 d0 00 00 00 00 45 31 f6 e9 2a ff ff ff 8b 45 b8 48 8b 4d c0 48 8b 84 c1 c8 0
Jan 10 02:31:17 localhost.localdomain kernel: RIP  [<ffffffffc019d58d>] gen6_ppgtt_insert_entries+0x14d/0x1d0 [i915]


Then I have found a bug report (https://bugs.freedesktop.org/show_bug.cgi?id=98760) which was reported for this particular issue. Fortunately it had a workaround mentioned to fix the issue. The workaround is to downgrade the
libvdpau-va-gl installation.

First, find out the available versions of libvdpau-va-gl,
dnf --showduplicates list libvdpau-va-gl

Then remove the existing libvdpau-va-gl installation,
dnf remove libvdpau-va-gl

Then install the previous version of libvdpau-va-gl,
dnf install libvdpau-va-gl-0.3.6-1.fc24.x86_64

Finally I was able to get hardware acceleration in VLC worked for both 720p and 1080i HD videos.

Saturday, August 20, 2016

How to enable serial console on LS-VL

Why do need to connect to your linkstation via a serial console?
  1. You can see the actual messages the linkstation prints when it is booted
  2. You can log in to the linkstation without using the network interface
  3. Just for fun :)
What do you need?
  1. Patience
  2. soldering skills
  3. a serial cable. (I have a cheap PL2303HX USB to TTL serial cable ordered from ebay)

If you are a amateur to soldering, my recommendation is do not try this.

Main board modifications


First you need to disassemble the linkstation and remove the main board. Then you have to connect four points in the main board as shown in the picture. These four holes can be found between the processor and the SATA connector.
This is where you need patience and soldering skills. It's bit difficult task to connect the holes using small wires.


Serial Header


The serial header can be found near the SATA connector as shown in the picture. You can solder a pin header so that you can easily plug a serial cable.




Once the main board and serial header are modified, you can plug a serial cable and use the screen program to view the console.

I used PL2303HX USB to TTL serial cable and didn't attach the power cable (red color) to the serial header. The white color cable connected to TxD pin, The green color cable connected to RxD pin  and the black color cable connected to the GND pin

screen command I used,

screen /dev/ttyUSB0 115200

console output,



If you need to find u-boot output messages, you can do another modification to the main board. However this is extremely difficult. You shouldn't attempt to do this unless you have good experience in SMD soldering.
The modification is, remove R60 and solder it on space allocated for R59.

I almost screwed up my main board trying to moving R60 to R59. It took hours to make things worked.
You have been warned!!!


Console output with u-boot messages, 




References: 

Saturday, April 16, 2016

How to enable nested VM in KVM

1. Uncomment below line in /etc/modprobe.d/kvm.conf
options kvm_intel nested=1


[root@localhost ~]# cat /etc/modprobe.d/kvm.conf 
###
### This configuration file was provided by the qemu package.
### Feel free to update as needed.
###

###
### Set these options to enable nested virtualization
###

options kvm_intel nested=1
#options kvm_amd nested=1


2. Remove and Add the kvm_intel module

modprobe -r kvm_intel
modprobe  kvm_intel


3. Verify whether the change has been applied or not,

cat /sys/module/kvm_intel/parameters/nested
Y

4.Use 'Copy host CPU configuration' in VM's CPU configurations

Sunday, March 13, 2016

My first experience with beaglebone serial port

Yesterday, I received beaglebone and PL2303HX USB to TTL serial cable I ordered few weeks a go. First thing I tried to do with the beaglebone was to try it's serial port.

So I connected the serial cable with the beaglebone and PC. I use fedora on my PC, so I used screen program to communicate with the serial port.

Then I powered up the beaglebone using the mini USB port and was waiting for the messages to be printed in the serial console.

Well, the good news was that messages were printed. but there were bad news.
sometimes it showed garbled messages. Also when it showed messages correctly, I wasn't able to type. It was simply a read only screen session.

What went wrong? I started googling and couldn't find any clue. finally I landed on a page where it lists beaglebone HW faults and it listed a similar scenario described as a HW fault. But it was a very old issue and cannot believe it still exists in new boards.

So I started diagnosing the issue.
First I tried to check whether it is an issue with the PC. Therefore I connected the beaglebone and the serial cable setup with my windows laptop. I did't get garbled messages on my screen session this time (I used Putty) but still I couldn't type.

So this must be an issue with either the beaglebone or the serial cable. If it's an issue with the beaglebone, I do not have any option. So I decided to diagnose the serial cable. I opened the USB side of the cable to check the circuit. the USB side can be easily opened since it was not sealed.

Huh, Found the issue!!!. The green wire was detached from the PCB due to a bad soldering job.
I soldered the green wire to the PCB again and reconnected the setup with the PC.

voila, screen session is bidirectional now. :)