Thursday, December 19, 2013

Playing .mkv files with DTS audio codec on Sony Bravia

I have already blogged on how to play mkv files on "Sony Bravia HD 3D LED KDL-40HX750" TV. But for playing mkv files with DTS audio codec, there is one extra step we have to do before converting the mkv files to the m2ts files.

We need to convert the DTS audio codec inside the mkv file to AC3 audio codec. This is because, the DTS audio codec is not supported by the Sony Bravia KDL-40HX750. I used the script mkvdts2ac3.sh by Jake Wharton and Chris Hoekstra. This script converts the DTS track in the mkv file to AC3 track. And the usage of this script is very simple.

Get the script mkvdts2ac3.sh (on my ubuntu 12.04 LTS) as follows:

wget https://raw.github.com/JakeWharton/mkvdts2ac3/master/mkvdts2ac3.sh

Give the mkv file with the DTS audio codec as the input to the script as shown below:

The conversion starts and gets completed by displaying the summary on the conversion process as shown below:

Now the mkv file can be converted to the m2ts file with only the AC3 audio codec.

Thus obtained m2ts file can be played on "Sony Bravia HD 3D LED KDL-40HX750" TV.

Thursday, July 25, 2013

Patents search

'www.freepatentsonline.com' can be used for Patents search. In this site, we could list down the patents based on several search conditions. I.e. If we want to list down the patents filed by indian inventors, we should use ICN/IN in the search term. ICN stands for 'Inventors Country Name' and IN stands for 'India' (Country Code Table). Similarly the patents database can be searched for several other conditions.

For example, to search patents for 'heterogeneous multiprocessor' filed by indian inventors in-between the period 2007 to 2009, the search condition should be as follows:

APD/01/01/2007->12/31/2009 AND ICN/IN AND (heterogeneous AND multiprocessor)

The links listed below can be used to get introduced to the search condition keywords:
Also consider whether you would require 'Word Stemming' option enabled for your search. By default, it is enabled. Enabling this for a search term, it would search for all variants of a search term. If you would like narrow down the search in particular to your search term, then you just disable it. (for more info on this)

Wednesday, April 3, 2013

lldb for llvm-3.1


We had a cross-compiler tool-chain based on llvm-3.0. And we needed a debugger for the target. We chose lldb and we ported it for the target architecture. (Click here for somemore details). We used lldb svn trunk revision '142603'. We were able to integrate this revision of lldb into the llvm-3.0.

Recently the cross-compiler tool-chain has been upgraded to llvm-3.1. Since lldb depends on llvm, the lldb also has to be upgraded to a revision that would get build with llvm-3.1. (Note: The lldb svn trunk revision '142603' that we used with llvm-3.0 cannot be used with llvm-3.1. This is because lldb uses few modules of llvm for some functionalities such as expressions evaluation, disassembling. Hence changes in llvm would be reflected in lldb as it grows).

Till llvm-3.1, there is no sync between a llvm release and the lldb. And hence finding a right svn trunk revision of lldb that would work with llvm-3.1 is a little time-consuming task. The lldb trunk revisions are traversed to find the right revision that would work with llvm-3.1. And I found that lldb svn trunk revision 161210 works with llvm-3.1 after the following tweaks.

Change #1:
File: lldb/include/lldb/Expression/RecordingMemoryManager.h
Line: 284
Incorporated the changes from svn revision-164563 of this file. Added the following code:

    //------------------------------------------------------------------
    /// Passthrough interface stub
    //------------------------------------------------------------------
    virtual void *getPointerToNamedFunction(const std::string &Name,
                                            bool AbortOnFailure = true) {
        return m_default_mm_ap->getPointerToNamedFunction(Name, AbortOnFailure);
    }

Change #2:
File: lldb/lib/Makefile
Line: 60
Incorporated the changes from svn revision-164703 of this file. Removed the following line

      clangIndex.a \ 

Change #3:
File: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
Line: 1519
Incorporated changes from svn revision-164563 of this file. Changed the following line

        case DW_TAG_APPLE_Property:
to
        case DW_TAG_APPLE_property:

Change #4:
File: lldb/source/Symbol/ClangASTContext.cpp
Line: 361
Incorporated the changes from svn revision-164563 of this file. Changed the following line

    Opts.NoInline = !Opt;
to
    Opts.NoInlineDefine = !Opt;

After the above mentioned tweaks, the lldb is successfully ported to our target.

Saturday, March 16, 2013

Sony Bravia TV - mkv files and files > 4 GB

With "Sony Bravia HD 3D LED KDL-40HX750" TV I faced the problem of playing '.mkv' files. Sony Bravia didn't support the .mkv file formats.

The other problem I faced is, playing the media files greater than 4 GB in size. The flash drive I used had the fat32 file system in which a single file cannot be more than of 4 GB in size.

Here I have summed up the solutions I found on internet to overcame the above two problems.
  1. tsmuxer
  2. Serviio DLNA media streaming server.

Playing the .mkv files in Sony Bravia

mkv is a multimedia container file format. This shall be converted to m2ts (MPEG-2 Transport Stream) multimedia container file format. Sony Bravia supports the m2ts file format.

tsmuxer (Transport Stream Muxer) shall be used to mux the mkv file format to the m2ts file format. 


And I used the downloaded tsmuxer (on my ubuntu 10.04 lucid) as follows:

$mkdir tsmuxer
$cd tsmuxer/
$mv ../../Downloads/tsMuxeR_1.10.6.tar.gz .
$tar zxvf tsMuxeR_1.10.6.tar.gz 
$./tsMuxerGUI 

The tsMuxer GUI would look like as shown below.

In the input tab, add the mkv file to be muxed to m2ts file. In output, select the option "M2TS muxing" and point to the destination folder into which the muxed file to be placed. Then click "Start muxing".

Now thus obtained m2ts file can be played by the Sony bravia.

Playing the media files greater than 4 GB in size

For this there are two solutions for Sony Bravia KDL-40HX750.
  1. Format the USB flash drive for exFAT format. 
  2. Serviio DLNA media streaming server.

1. Format the USB flash drive for exFAT format. 

Sony Bravia KDL-40HX750 supports exFAT file system. And in exFAT filesystem we can have files greater than of 4 GB in size. 

Format the USB flash drive for exFAT file system. Since I couldn't format the USB flash drive to exFAT in my Ubuntu system, I used a windows XP (a service pack has to be installed to support exFAT) system to format my USB flash drive for exFAT file system.

There-after, I am able to use the USB flash drive with my Ubuntu system by using the fuse-exfat package. The fuse-exfat package was installed in my system as follows:

$sudo add-apt-repository ppa:relan/exfat
$sudo apt-get update
$sudo apt-get install fuse-exfat

After installing the fuse-exfat package the USB drive with exFAT file system can be mounted as follows:

$sudo mkdir /media/exfat
$sudo mount -t exfat /dev/sdc1 /media/exfat

Now the read and write on the USB flash drive can be done. After usage, the USB flash drive can be unmounted as follows:

$sudo umount /media/exfat

Now with this solution, I am able to play the media files greater than 4 GB in size.

2. Serviio DLNA media streaming server.

Sony Bravia KDL-40HX750 is DLNA enabled. The media files can be streamed from the computer using the Serviio DLNA media streaming server. Given that the TV and the computer are connected to a router, now the TV would be able to access the media content from the computer.

I downloaded the Serviio for my ubuntu system from the link given below:


Installed and started the servio console as follows:

Extracted the downloaded the package.

$tar zxvf serviio-1.1-linux.tar.gz 

Created the file "serviio.conf" in the directory "/etc/init/" with the following content in it.

start on started networking
script
   /home/ck/serviio-1.1/bin/serviio.sh
end script

Then on terminal do the following:

$sudo /etc/init.d/networking restart
$sudo start serviio
$cd serviio-1.1/
$bin/serviio-console.sh 

The serviio console would look like as shown below. The Status tab would show the devices connected to the server.

For sharing the media files through the server, include the path to the media files in the Library tab as shown below.

Saturday, March 9, 2013

Enable wired and wireless network connections in Ubuntu 12.04


Recently upgraded to Ubuntu 12.04 from Ubuntu 10.04. After the upgrade, both the wired and wireless network connections didn't work.

I have summarized what I did to enable both the network connections along with the reference which I followed.

Wired Network Connection:

Step #1: Removed the package "resolvconf" and restarted the NW:

$sudo apt-get remove --purge resolvconf
$sudo /etc/init.d/networking restart

Ref: http://ubuntuforums.org/showthread.php?t=1973604

Step #2: Edited the /etc/network/interfaces file to contain only the following two lines:

auto lo
iface lo inet loopback

Ref: http://ubuntuforums.org/showthread.php?t=1943143

Wireless Network Connection:

Note: I have Broadcom Corporation BCM4318 [AirForce One 54g] 802.11g Wireless LAN Controller.

Step #1: Did the following:

$sudo apt-get install linux-firmware-nonfree
$sudo modprobe -r b43
$sudo modprobe b43

Ref: http://askubuntu.com/questions/171427/wireless-isnt-working-in-12-04

Note: 
1. If you get the error "E: Unable to fetch some archives" while running the command "sudo apt-get install linux-firmware-nonfree" mentioned above, then run the command "sudo apt-get update" before doing the above step.

Ref:http://www.linuxquestions.org/questions/linux-newbie-8/icky-ubuntu-cannot-download-packages-767779/

2. If you get the following warning when you run "sudo modprobe -r b43" and "sudo modprobe b43", then just rename the files "/etc/modprobe.d/bad_list" and "/etc/modprobe.d/ndiswrapper" to "/etc/modprobe.d/bad_list.conf" and "/etc/modprobe.d/ndiswrapper.conf" respectively.

WARNING: All config files need .conf: /etc/modprobe.d/bad_list, it will be ignored in a future release.
WARNING: All config files need .conf: /etc/modprobe.d/ndiswrapper, it will be ignored in a future release.

With the above set-up the wireless network connection would be up. But on restarting the system, the wireless network connection won't be up. For the wireless connection to be up automatically, the following has to be done.
  1. Edit the /etc/modprobe.d/blacklist.conf file. The /etc/modprobe.d/blacklist.conf file has the list of modules that should be prevented from loading at boot time. Comment out the following line:
    • blacklist bcm43xx
  2. Edit the /etc/modules file. The /etc/modules has the list of modules that would be loaded at boot time. Add the following line at the end of the file.
    • b43
Ref: http://askubuntu.com/questions/90067/how-do-i-get-my-wireless-to-automatically-start-after-reboot