Friday, December 10, 2010

MADDE (Meego Application Developement and Debug Environment)

INTRO:
       
MADDE(Meego Application Development & Debug Environment) is SDK for cross compile and debug  
new application for Maemo and MeeGo.It is not meant to use to build debian packages that use Autotools 
 or anything that  aids compilation by figuring out native system information. 
  • Command-line cross-compiling
  • Multi-platform support (Linux (32-bit/64-bit), Windows, Mac OS X)
  • Configurable for different targets & toolchains
  • Client for the device to simplify the development process
  • Simplicity 
MADDE  is actually a tool that assists in the download and installation of the Target.A Target is used to build programs using the MeeGo toolchain and libraries (sysroot). "mad-admin" is the MADDE command-line tool. You can install multiple Targets and switch easily between them in Qt Creator
 Target is downloaded as a large (~250MB) .bz2 file using the commands below.

Lets check out the various commands and its functions
        

Commands "mad" and "mad-admin"

Basically MADDE can be used and configured by using these two basic commands with different parameters:
  • mad is used for cross-compiling and getting general information.
  • mad-admin is needed to set up and configure the development environment. 

Check the configuration

Before it is possible to use MADDE for cross-compiling, it has to be configured correctly.  To check, which targets of the MeeGo OS  are available, installable or set as default or installed use the command:
       $ mad-admin list
Example output of the above command:       

Targets:
fremantle-1030            (installable)
maemo412-1                (installable)
meego-core-armv7l-1.1     (default)
meego-core-armv7l-trunk   (installable)
meego-core-ia32-1.1       (installable)
meego-core-ia32-trunk     (installable)
meego-handset-ia32-1.1    (installed)
meego-handset-ia32-trunk  (installable)
meego-netbook-ia32-1.1    (installed)
meego-netbook-ia32-trunk  (installable)

Runtimes:
qemu-n900-pr12                                         (installable)
rx48-diablo                                                  (installable)
meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime  (installed)
meego-netbook-ia32-qemu-1.1.20101031.2037-sda-runtime  (installable)

     From above displayed list  it implies that ,  meego-core-armv7l-1.1 target is installed and set as default. Diablo and others  can be installed, but is not available yet. If a target is set as default, it means that it will be used automatically for cross-compiling, if nothing else is specified.and we can have various targets installed simultaneously and we can switch between them using the Qtcreator which will be discussed later.
 
What actually are these various targets?
 
we need to have a different set of tool chains and libraries in order to build 
MeeGo applications that run on various targets(handset,Netbook,ConnectedTV,along 
with Arm and ia32 etc)
  • meego-core-armv7l-1.1: Build applications for ARM handheld devices (such as N900)
  • meego-handset-ia32-w32-1.1: Build applications for x86 handheld devices (such as Aava)
  • meego-netbook-ia32-w32-1.1: Build applications for x86 netbooks.
What actually are MeeGo runtimes  & QEMU ?

            A Runtime is the MeeGo OS image that is run with QEMU when debugging applications on your host system. It is not required if you develop against real hardware running MeeGo. It is downloaded as a large (~650MB) .bz2 file using MADDE. The Runtime is not needed until you have finished configuring Qt Creator.

            QEMU is a generic and open source machine emulator and virtualizer.
When used as a machine emulator, QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a different machine (e.g. your own PC). By using dynamic translation, it achieves very good performance.When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU. QEMU supports virtualization when executing under the Xen hypervisor or using the KVM kernel module in Linux. When using KVM, QEMU can virtualize x86, server and embedded PowerPC, and S390 guests.

Install a target/runtime :

If a target is marked as 'installable', it has to be installed, before it can be taken into use. This is done by:
>sudo mad-admin create -f <target/runtime> 
 
 -f instructs the Madde to fetch the tarball(bz2) file and then create the target.
their are chances that this step might fail if we are connected to the internet 
using a proxy .So the solution could be 
 
$ sudo mad-admin fetch [-x proxyhost[:port]] URL|URL_ALIAS

Examples:
$ sudo mad-admin fetch -x http://proxy.host:8080 http://server/path/file.tgz
 Or you can do it like this:

$ zypper addrepo -f http://repo.meego.com/MeeGo/sdk/host/repos/meego/1.1/meego-sdk.repo"
$ export http_proxy="http://username:passwd@<proxy_IP>:<proxy_port>"
$ mad-admin create -f <target> 
 
If the one of the above command goes fine we actually start up the process of downloading 
the tarball file which will take some time and status of the download will be updated in 
the command terminal.
  
Finally Creating the target/runtime :
 
$ sudo mad-admin create <Target/Runtime>
 
example output if runtime is meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime
$ sudo mad-admin create meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime
:Extracting QEMU runtime meego-handset-ia32-qemu-1.1.20101031.2201-sda-runtime
.....9....8....7....6....5....4....3....2....1....0
Creating missing links... done.
 
 
Important Note :
Check if the target is installed or not by using  >mad list  at higher level and at lower level check by 
running the following commands . Replace <target> with the ones which are dispalyed as installed in >mad-admin list 
output .
 
 $ mad -t <target> pscreate -t qt-simple qthello $ cd qthello
 $ mad -t <target> qmake
 $ mad -t <target> make

To check that the qt-simple application is created for the correct target, run:
$ file build/qthello

output should be based on the target used which is listed below
1)If you compiled with an IA32 toolchain, you should see something like  this:
 build/qttest: ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), for GNU/Linux 2.6.25,  
dynamically linked (uses shared libs), for GNU/Linux 2.6.25, not stripped.                 

2)While compiling with an ARM toolchain should yield something like:
 build/qttest: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.25, dynamically linked (uses shared libs), for GNU/Linux 2.6.25, not stripped.


Madde FAQ s: http://meego.gitorious.org/meego-developer-tools/madde/blobs/master/docs/FAQ.rst 

Note: All information posted here is a collection of information from wiki.meego.com and wiki.maemo.org
 

Wednesday, December 8, 2010

A GIST ON BULDING MEEGO SOURCE USING OPEN BUILD SERVICE

Open Build Service (OBS)
       The OBS or Open Build Service is a build farm supplied to the community by Novell. It is used to build OpenSUSE and is going to be used to build MeeGo packages as well. The OBS will be used as a separate instance inside the MeeGo infrastructure. That is to say, there will be a separately maintained OBS dedicated to building MeeGo rpms.In general OBS is  an open and complete distribution development platform. It provides the infrastructure to easily create and release open source software for openSUSE and other Linux distributions on different hardware architectures. The openSUSE instance currently has over 20.000 users that are building about 100.000 packages for 21 base distributions on 6 architectures.


OBS and MeeGo:     
      The heart of the Build Infrastructure of MeeGo is the upstream project openSUSE Build Service (OBS). It is an automated system used for building software packages, collaboration of developers, release management, maintenance, and much more. Moblin started using OBS in June 2008 and released Moblin 2.0 and Moblin 2.1, as well as other derivative releases. OBS has proven to be a very reliable infrastructure that is quickly evolving. It is rich with features for distribution building and maintenance. The Linux Foundation is dedicated to the further development of OBS and has a team, including two full-time OBS maintainers, contributing to its development and its use by MeeGo and the Ecosystem.MeeGo currently uses version 2.0.x of OBS and will soon switch to version 2.1

There are 3 OBS instances that are relevant to MeeGo
  • MeeGo core : essentially, if you're a core package maintainer/developer you get an account here
  • MeeGo community : for anyone to build applications or libraries against MeeGo - anyone with a meego.com account can use this
  • openSuse : this is not for building *against* MeeGo... but we need to support MeeGo tools on many platforms and some of those get built on the openSuse OBS .
 Whats the need of OBS in MeeGo:
  1. It's a build system. You put source on it and say "use this repository" and it builds a minimal SDK-like chroot using the deb/rpms it finds in that repository
  2. It has packages - a package corresponds to a tarball and a spec/dsc
  3. It has projects - a project is like a directory with packages
  4. When a package is built it is "published" from the project where it was uploaded into a corresponding repository (which can be used to build other projects)
  5. The repositories can also be used by devices to download binary packages. 

Monday, December 6, 2010

Differnce Between MeeGo and Android

Releases :
 
 MeeGo  : As an open source software platform, MeeGo will help to reduce market 
          fragmentation and complexity, while helping to accelerate industry innovation 
          and time-to-market for a wealth of new Internet-based applications, services 
          and user experiences.
Android : Created  market fragmentation.
          Frequent code releases  force to upgrade the devices frequently Difference 
          between  two releases  is enormous. Software maintenance is complex in 
          developer’s point of view


License :
 MeeGo  :Fully open source
Android : Consists of Apache, BSD, Open source License:
          Android is going to be established as a “middle ground” in the openness 
          spectrum: more open than proprietary competitors (iPhone, Windows Phone, Blackberry,
WebOS, etc.) and possibly less open than others (MeeGo, Symbian)


Architecture :
 
 MeeGo   :Does not use virtual Machine. Each application is a process.
 Android :Use Dalvik Virtual Machine. Each application runs in its own instance 
          of Virtual Machine. It takes a considerable files to load the huge .jar files.


App development :
 
 MeeGo   : It’s easy  as it supports  libc.
 Android : Android use very scaled down version of libc i.e. Bionic also the 
          pthread library support is very limited.


Maintenance :
 
  MeeGo   :As its maintained by Linux foundation and supports upstream components, 
          the maintenance is easy for the components.
  Android :Maintaining the  additional drivers   and enhancement like binder driver, low 
           memory killer, Logger, kernel Debugger, Ashmem, Alarm, Power management  is  
           uncertain. Kernel is  patched for  enhancement to support Android.
 
Hardware support :

 MeeGO   : New player in the market. will  have more support in future apart from 
           Intel and Arm.
 Android : Has good support for hardware.
 
 
OEM  Companies involved:
 
 Android : Intel, ARM, Marvell, Qualcomm, Nvidia, Texas Instruments,Broadcom, NXP, PacketVideo,
Google, HTC, LG, Motorola, Samsung, Ericsson, Toshiba, Dell, Acer, Garmin (and more)
 MeeGo   : Intel, Nokia

Products released:
 
 Android : more than 200
 MeeGo   : 0

Technologies used: 
 
Android : mostly proprietary
 MeeGo   : mostly shared with FOSS community

Using Linux?: 
 
 Android : kind of a fork
 MeeGo   : yes, close to upstream
 
Programming Lnaguages Used:
 
Android  : Java/J2Me(Java based uses Dalvik Machine as JVM and also Suports native 
coding via NDK)
MeeGo    : C++(QT Based)
 
___________________________________________________________________________________________ 
NOTE  : All information presented here is prepared by combining all the info present 
in the Internet.
Source : http://www.mail-archive.com/meego-dev@meego.com/msg03510.html.

Saturday, December 4, 2010

Gist on Multimedia FrameWork in MeeGo :

Multimedia Multimedia domain provides audio and video playback, streaming, and imaging functionality to the system. In general, the domain takes care of the actual audio and video data handling (retrieval, demuxing, decoding and encoding, seeking, etc.). The domain includes the following subsystems:
Multimedia Component
  • Imaging and Video Adaptation - Platform specific codecs and containers for GStreamer
  • Camera Adaptation - Platform specific codecs and containers for GStreamer. Adaptation interface is CameraBin.
  • UPnP - Universal Plug and Play provides a UPnP stack, the UPnP profile for audio and video.
  • Gstreamer - GStreamer, through its plugins, provides playback, streaming, and imaging functionality to the system.
  • Audio Adaptation - Platform specific modules for PulseAudio
  • Pulse Audio - The audio subsystem handles audio inputs, post and pre processing, and outputs in a system. The purpose is to provide a proxy between audio applications and audio hardware.
Multi Media Stack












QT Mobiltiy  : 
                              QT mobility project delivers a set of new APIs to Qt with features,which allow the developer easily apply in multi platform.QT Mobility covers a collection of apis or frameworks to support the multimedia features to a full extent. this link will provide much more info on QT mobilty and multimedia http://doc.qt.nokia.com/qtmobility-1.0-tp/multimedia.html.

Qt Mobilty's media library  enables developers to easily create applications that make best advantage of the system mediacapabilities and it covers the items of most direct interest to developers:plyback,recording,playlist,management,metadata,radio,mediaediting,TV,etc.

Advantages of QT Mobiltiy multimedia framework:
1)developer can now implement fundamental functions with minimal code.
2)A great deal of flexibility with the media source.
3)Many different codecs are supported 'out of box'


How to create a video player
QMediaPlayer:  used for generic player.
QVideoWidget: control of video source,full screen,etc.
VideoWidget: inherts from QVideoWidget to add functions, such as double click , particular keypres
  Three Output Types:  
                         •WindowOutput(X11/Overlay)                                        •RenderOutput(QGraphicsVideoItem) 
                         •WidgetOutput (xvimagesink)  .
Extends the functinality of multimedia class -uses a 3 derived classes from them.

 


Extended functinality of a new service and a sample application code :
 


QT Mobilty multimedia framework supports a rich backend
         like Gstreammer,Quicktime,DirectShow,etc
 
Breif on Gstreamer:
             It is a OpenSource  framework for  creating media applications and it as a alone is not a player.it is pipeline  based   media framework written in C programming language witha type system based on Gobject.
              GStreamer allows a programmer to create a variety of media-handling components, including simple audio playback, audio and video playback, recording, streaming and editing. The pipeline design serves as a base to create many types of multimedia applications such as video editors, streaming media broadcasters, and media players.
Designed to be cross-platform, it is known to work on Linux (x86, PowerPC and ARM), Solaris (Intel and SPARC) and OpenSolaris, FreeBSD, OpenBSD, NetBSD, Mac OS X, Microsoft Windows and OS/400. GStreamer has bindings for programming-languages like Python, Vala, C++, Perl, GNU Guile and Ruby. GStreamer is licensed under the GNU Lesser General Public License.
Main Advantages of Gstreamer:
                 Pluggable elements could be mixed to form arbitrary pipelines to support various kinds of audio and vedio codecs.
                          Unified APIS for the devvekoper to create pipelines and media players.
 
Gstreamer Concepts :
 
   ELEMENT :
    Element is the most important object in Gstreamer, it is derived from GstObject.
 


    –create a chain of elements linked together and let data flow through this chain of elements           
 


            PAD:                         
    –Pad is used to negotiate links and data flow between elements in GStreamer
      –Pad could be sink pad or source pad
                  –Pad can restrict the type of data that flows through it.
     BIN & PIPELINE:                  
A Bin is a container for a collection of elements. E.g. playbin
A pipeline is a special subtype of a bin that allows execution of all of its contained child elements.
A pipeline is a top-level bin. As you set it to PAUSED or PLAYING state, data flow will start and media processing will take place.
GstPipeline is derived from GstBin

AUTOPLUGGING:      
      Want to build a media player that handles various kind of media automatically?
       •Autopluging: 1> Typefinding, 2> Linkage
        –Maintain a Registry for all elements
        –Create a function to filter a list of elements


Hope this info hekps in having some basic idea on the multimedia framework in Meego OS.