Where to get video, audio and image samples

If your system is dealing with media files such as video, audio and image you’d better get some samples to make sure your system can play most of them or at least can match (or beat) the competition using the same platform. So I’ve collected some links for just doing that. mplayer test samples: http://samples.mplayerhq.hu/ – Over 42 GB / a few thousand files of diverse audio and video files. Microsoft HD Showcase – http://www.microsoft.com/windows/windowsmedia/musicandvideo/hdvideo/contentshowcase.aspx – A must to test wmv, wma and wma pro decoding capabilities. For testing MKV videos, you’ll most likely need to download some videos using bittorrent or emule. To search for video you can use sites such as http://www.isohunt.to or http://www.verycd.com/. Very CD is actually one of the top website in China in terms of traffic. You can also convert some other videos to MKV using some MKV editors my favorite being mkvtoolnix. For graphics you’ll find plenty of gif, jpeg and png (and other …

Support CNX Software – Donate via PayPal or become a Patron on Patreon

Resources for Cirrus Logic EP93XX – EP9301, EP9302, EP9307, EP9312 & EP9315

A few years ago, we used EP9307 in combination with a MPEG Video Decoder chip (ES6425 – now phased out) for the development of a Karaoke system for the Chinese Market. The advantage with Cirrus Logic (and many American companies) is that documentation and support can very easily be found online including datasheets, software development kit and support forum. This was so good that we really had to get the involvement of the FAE once or twice. That’s a sharp contrast with some other companies where is there a dearth of support and FAE are seldom able to help you resolve issues you may have with their products, especially if you work for a smaller company. Basically to develop for EP9307 and other EP93xx platform most of the software and hardware resources are available at http://arm.cirrus.com/ including: Linux 2.6 Documentation & Linux 2.6 Source for EP93xx Linux 2.4 Documentation & Linux 2.4 Source for EP93xx Schematics for EP9301, EP9302, EP9307, …

Support CNX Software – Donate via PayPal or become a Patron on Patreon

Optimizing hard disk and compact flash performance in Linux Embedded Systems

Compact flash are often used in Digital Signage applications and hard-disks used in both signage application and IP set-top-box to play high definition videos. However, sometimes the performance of those devices and the performance limitations of embedded systems may make the task difficult especially for higher bit-rate videos. Choosing the right file system Once of the easiest way to improve performance is to select an appropriate file system. The best performance is achieved by ext-2, followed by ext-3, fat 32 and ntfs on the embedded system I worked with at least (e.g. Sigma Designs EM8620 and  SMP8630 series).  Basically, if your CF card/HDD is not supposed to be taken out of your device, then ext-2 is the obvious choice. However, if your user for whatever reasons need to take the devie out and connect it to a Windows PC FAT 32 or NTFS might be a better choice, although it would still be possible to install a ext2 driver such …

Support CNX Software – Donate via PayPal or become a Patron on Patreon

NTFS for Embedded Linux Systems

Since now more and more HD videos are larger than 4GB they can not be stored into FAT32 file system, and require the use of other file systems, the most popular being ext2/ext3 or NTFS. However, since many users may want to access the mass storage devices (IDE / SATA harddisk, USB Harddisk, USB Thumbdrives…) in Windows as well as in their embedded systems (IP STV, Digital Signage..) NTFS seems to the best choice to share data between Windows systems and embedded systems using Linux. NTFS is available in the Linux kernel. However only read-only is fully supported and the performance is about 25% less than ext-2 or ext-3 for the platforms we tested (EM8623L and SMP8635), but this is still acceptable to play most of HD Videos. However, if the device also needs to download videos from a server or other P2P clients, having a read-only file systems will not do it. For this purpose NTFS-3G can be used …

Support CNX Software – Donate via PayPal or become a Patron on Patreon

Finding and fixing memoy leaks in your software

Memory leaks will cause your device to crash after a period of time once it runs out of memory. A quick way to find out if your application has memory leak(s) is too monitor it with top: PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND 1       root       15   0   2156    668  572 S     0           5 .0      0:00.14         application If you see the %MEM increase over time for no particular reasons, then you’ve got a memory leak. However, it might be tricky to isolate where the issue occurs exactly. The first thing to do is the review your source code for the following: Malloced memory is always freed fopen is always followed by fclose, and open by close scandir calls are properly freed Threads are properly terminated with pthread_cancel & pthread_join or pthread_detach, etc… If after a code review you cannot find the reason for the memory leak, use the following …

Support CNX Software – Donate via PayPal or become a Patron on Patreon

Reducing truetype font file size for embedded systems

Embedded systems often have limited memory, that can be a challenge when your application requires Asian languages where fonts might be several megabytes large. Below we describe a method to reduce the file size with Fontforge using simhei.ttf, a CJK font as an example. Fontforge Fontforge is an open source font editor running under Linux and Windows/Cygwin. For the latest version see http://fontforge.sourceforge.net/ Reducing Font Size Removing Bitmap from Font File. Some TrueType files embed a bitmap version of the font. When Fontforge opens such a file, it will ask whether to keep the bitmap or not. We can remove the bitmap to reduce the file size. Using a glyphs subset adapted to your application. We can use Fontforge with cidmap (Fontforge proprietary) and/or Cmap (from adobe) to perform this task. Please check http://partners.adobe.com/public/developer/font/index.html#ckf for further information on CJK/CID file for your language. In our example (simhei.ttf), which can be obtained from Microsoft Windows font directory, if we want to …

Support CNX Software – Donate via PayPal or become a Patron on Patreon

No password SSH – Login to a SSH server with private/public keys

If you often need to establish SSH connections to a server, entering the password each time may be an hassle or even a non-starter. For example, in our case we use ssh connections in our nightly build scripts, so obviously entering a password would not be an option here… So it can be useful to configure the server and you client to accept secure ssh connection without the need to enter a password.  What must be done, then , is to generate a public/private key pair, and copy the public part into the appropriate place on the server side. For doing this, on the user’s home directory, on the client machine, type: local> ssh-keygen -t dsa -f .ssh/id_dsa -t tells the type of encryption -f tells where to store the public/private key pairs. In this case, the .ssh directory on home is being used A password will be asked;  leave this part blank, just press <enter> Now, go the .ssh …

Support CNX Software – Donate via PayPal or become a Patron on Patreon

Mounting a JFFS2 image in a Linux PC

We often use JFFS2 binary images for embedded system, generating them with mkfs.jffs2. In some instances, it could also be good to mount a jffs2 image into your PC to modify it directly. To do that,  type the following commands as root in a linux shell: modprobe mtdcore modprobe jffs2 modprobe mtdram modprobe mtdchar modprobe mtdblock dd if=image-jffs2 of=/dev/mtd0 mount /dev/mtdblock0 mnt If your image is larger than the default kernel size (4MB in my case), you can try to adjust the mtdram device size with the total_size parameters. when inserting the mtdram module, e.g.: modprobe mtdram total_size=8096 where total_size is expressed in KB Further details can be found @ http://www.handhelds.org/hypermail/familiar/62/6232.html Support CNX Software – Donate via PayPal or become a Patron on Patreon

Support CNX Software – Donate via PayPal or become a Patron on Patreon