Tuesday, October 28, 2008

New Blackfin BF51x Processor Launches

analog-devices-blackfin.jpgAnalog Devicesunveiled the new Blackfin BF51x series, the newest membzers of their convergent-processor family. Blackfin processors are very popular when building Asteris-based appliances, including the Digium Asterisk Appliance AA50 and Astfin. The Blackfin convergent-processor architecture offers reduced cost, power consumption, and software complexity. Although the processor is popular in creating Asterisk appliances, it can be used for a variety of low-cost, low-power consumption required applications.

The new Blackfin processors are the BF512, BF514, BF516 and BF518. According to Analog Devices, "All are single-core convergent processors that surpass outdated, heterogenous MCU+DSP approaches in reducing part-count, system cost, board space, and power consumption. Like traditional DSPs, the BF51x processors feature high clock rates and low power dissipation per unit of processing (MMACs/mW), and like traditional MCUs, these convergent processors are OS and compiler-friendly."

All four of the new 16-/32-bit BF51x processors are available at clock speeds up to 400 MHz (800 MMACS) and include 116 kBytes of RAM plus an optional 4 Mbits of serial (SPI) flash memory. Each also integrates Lockbox security for code and content protection.

The Blackfin processors on-chip integration assures easy connection to a variety of audio, video, imaging and communications peripherals and memory types. Integrated features include support for sixteen stereo I2S digital-audio channels, twelve peripheral DMA channels, and an advanced memory controller for glueless connection to multiple banks of external SDRAM, SRAM, Flash, or ROM. Each processor includes two dual-channel synchronous serial communication ports (SPORTs), a high-speed parallel peripheral interface (PPI), an I2C compatible two-wire interface (TWI), dual PC-compatible UARTs, and 2 SPI-compatible serial peripheral interface ports.

"System solutions ultimately determine how much power any particular application will consume," said Jerry McGuire, vice president, General Purpose DSP, Analog Devices, Inc. "It's quite intuitive that a single convergent processor with the right mix of integrated peripherals is always going to lead to lower BOM costs and power consumption than an inelegant combination of disparate processors and parts can possibly achieve. Many companies today talk about the lowest power or the highest performance. But what is important for today's applications is the highest levels of performance at low power."

All of the new Blackfin processors, delivering 8.5 MMACs/mW (100 MHz), include dynamic power management (DPM) functionality that lets developers match the processor's power consumption to processing requirements during program execution. AI pioneered the application of DPM more than seven years ago with the release of the first Blackfin processors.

The BF512 is the new low-cost entry point in the Blackfin processor family. The device balances performance, peripheral integration, and price, and is well suited for the most cost-sensitive applications including portable test equipment, embedded modems, biometrics, and consumer audio. All members of the BF51x family also include a new 3-phase PWM generation unit for inductive motor control applications and a quadrature interface for rotary encoders.
The BF514, BF516, and BF518 all extend the convergent processor family further into the portable application space with on-chip removable-storage interfaces. All three devices include Secure Digital Input Output (SDIO) for connectivity to standard flash memory and Wi-Fi cards; a power-optimized CE-ATA storage interface for small form-factor handheld and consumer electronics applications; and an embedded multimedia card (eMMC) interface for integrating mass-storage flash memory in a wide range of consumer electronics, wireless, navigation, and industrial applications.

For developers of network-connected industrial and instrumentation applications, the BF516 adds an Ethernet 10/100 MAC with Media Independent Interface (MII) and Reduced Media Independent Interface (RMII). Highly integrated for industrial, portable and VoIP applications, the BF518 Ethernet MAC supports theIEEE-1588 clock synchronization protocol for networked measurement and control systems.

An increasingly wide variety of applications are viewing the contemporary convergent-processor approach as the soundest choice for cost- and power-sensitive designs. For example, some voice-over-IP (VoIP) telephony system developers have designed in separate DSP and microcontroller chips to implement the required media and control functionality. With BF51x Blackfin processors, however, a single architecture enables full VoIP telephony functionality in a unified software development environment with faster system debugging and deployment, lower overall system cost, and the lowest possible system power demand.

"GIPS VoiceEngine media processing capabilities meet the highest requirements of VoIP equipment manufacturers and paired with Analog Devices' Blackfin processors we can assure customers a consistently high quality VoIP experience. The performance, power and functionality profile of Blackfin is a superb fit for VoIP technology," said Larry Golob, Senior Director Business Development,Global IP Solutions.

With the Global IP Solutions (GIPS) VoiceEngine package of VoIP software components available for Blackfin processors, and a VoIP reference platform available on uClinux, the feature-rich Blackfin family has driven down the price required to easily design and deploy a fully scalable range of VoIP telephony designs across multiple market spaces.

Pricing and Availability
The BF51x family includes the BF512 at $4.95, the BF514 at $7.75, the BF516 at $8.75 and the BF518 at $11.85. Processors are sampling immediately. All prices are based on 25,000-unit quantities.


Read more!!!

Friday, October 24, 2008

Media Player in C#

/*
Professional Windows GUI Programming Using C#
by Jay Glynn, Csaba Torok, Richard Conway, Wahid Choudhury,
Zach Greenvoss, Shripad Kulkarni, Neil Whitlow

Publisher: Peer Information
ISBN: 1861007663
*/
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using MediaPlayer ;

namespace SMK_MediaPlayer
{
///
/// Summary description for SMKMediaPlayer.
///
public class SMKMediaPlayer : System.Windows.Forms.Form
{
///
/// Required designer variable.
///

private AxMediaPlayer.AxMediaPlayer mPlayer = null ;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.MainMenu mainMenu1;
private System.Windows.Forms.MenuItem menuItem1;
private System.Windows.Forms.MenuItem menuItem2;
private System.Windows.Forms.MenuItem menuItem3;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.ContextMenu contextMenu1;
private System.Windows.Forms.MenuItem menuItem5;
private System.Windows.Forms.MenuItem menuItem6;
private System.ComponentModel.IContainer components;

public SMKMediaPlayer()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
notifyIcon1.Dispose() ;
mPlayer.Stop() ;
mPlayer.Dispose();

if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

private void streamEnded(object sender , AxMediaPlayer._MediaPlayerEvents_EndOfStreamEvent e)
{
this.Show();
notifyIcon1.Visible = false ;
mPlayer.Stop();
mPlayer.CurrentPosition= 0.0;
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SMKMediaPlayer));
this.panel2 = new System.Windows.Forms.Panel();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuItem1 = new System.Windows.Forms.MenuItem();
this.menuItem2 = new System.Windows.Forms.MenuItem();
this.menuItem3 = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.contextMenu1 = new System.Windows.Forms.ContextMenu();
this.menuItem5 = new System.Windows.Forms.MenuItem();
this.menuItem6 = new System.Windows.Forms.MenuItem();
this.SuspendLayout();
//
// panel2
//
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(344, 109);
this.panel2.TabIndex = 1;
//
// notifyIcon1
//
this.notifyIcon1.Text = "notifyIcon1";
this.notifyIcon1.Visible = true;
//
// mainMenu1
//
this.mainMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem1,
this.menuItem4});
//
// menuItem1
//
this.menuItem1.Index = 0;
this.menuItem1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem2,
this.menuItem3});
this.menuItem1.Text = "File";
//
// menuItem2
//
this.menuItem2.Index = 0;
this.menuItem2.Text = "Open";
this.menuItem2.Click += new System.EventHandler(this.menuItem2_Click);
//
// menuItem3
//
this.menuItem3.Index = 1;
this.menuItem3.Text = "Exit";
this.menuItem3.Click += new System.EventHandler(this.menuItem3_Click);
//
// menuItem4
//
this.menuItem4.Index = 1;
this.menuItem4.Text = "Hide";
this.menuItem4.Click += new System.EventHandler(this.menuItem4_Click);
//
// imageList1
//
this.imageList1.ColorDepth = System.Windows.Forms.ColorDepth.Depth8Bit;
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// contextMenu1
//
this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.menuItem5,
this.menuItem6});
//
// menuItem5
//
this.menuItem5.Index = 0;
this.menuItem5.Text = "Show";
this.menuItem5.Click += new System.EventHandler(this.menuItem5_Click);
//
// menuItem6
//
this.menuItem6.Index = 1;
this.menuItem6.Text = "Exit";
this.menuItem6.Click += new System.EventHandler(this.menuItem6_Click);
//
// SMKMediaPlayer
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(344, 109);
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.panel2});
this.MaximizeBox = false;
this.Menu = this.mainMenu1;
this.Name = "SMKMediaPlayer";
this.Text = "ActiveX Media Player";
this.Load += new System.EventHandler(this.SMKMediaPlayer_Load);
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new SMKMediaPlayer());
}

private void SMKMediaPlayer_Load(object sender, System.EventArgs e)
{
notifyIcon1.Icon = new Icon("EYE.ico");
notifyIcon1.Text = "SMK Media Player 1.0";
notifyIcon1.Visible = false ;
notifyIcon1.DoubleClick += new EventHandler(NotifyIconDoubleClick);
notifyIcon1.ContextMenu = contextMenu1 ;

mPlayer = new AxMediaPlayer.AxMediaPlayer();
mPlayer.BeginInit();
mPlayer.Size = new System.Drawing.Size(292, 273);
mPlayer.Location = new System.Drawing.Point(0 , 16);
mPlayer.TabIndex = 0;
mPlayer.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Controls.AddRange(new System.Windows.Forms.Control[] {this.mPlayer});

mPlayer.EndOfStream
+= new AxMediaPlayer._MediaPlayerEvents_EndOfStreamEventHandler(this.streamEnded);

mPlayer.EndInit();
}

private void menuItem2_Click(object sender, System.EventArgs e)
{
try
{
Image im = imageList1.Images[0];
OpenFileDialog fd = new OpenFileDialog();
fd.ShowDialog();
mPlayer.Open(fd.FileName);
mPlayer.Play();
}
catch(Exception eee)
{
Console.WriteLine(eee.Message);
}
}

private void menuItem4_Click(object sender, System.EventArgs e)
{
notifyIcon1.Visible = true ;
this.Hide();
}

private void menuItem3_Click(object sender, System.EventArgs e)
{
Application.Exit() ;
}

private void menuItem5_Click(object sender, System.EventArgs e)
{
notifyIcon1.Visible = false;
this.Show();
}

private void menuItem6_Click(object sender, System.EventArgs e)
{
notifyIcon1.Visible = false ;
Application.Exit() ;
}

private void NotifyIconDoubleClick(object sender, System.EventArgs e)
{
this.Visible = true ;
this.Activate() ;
this.Show() ;
this.BringToFront() ;
}

}
}

source code from http://www.java2s.com/Code/CSharpDownload/SMK_MediaPlayer.zip


Read more!!!

Thursday, October 23, 2008

Static Route on Linux RedHat 9

With the introduction of Redhat version 8 and continued into version 9, the /etc/sysconfig/static-routes file no longer seems to function correctly.

Linux static routes changed in 8.0 to a new format. Now you are to create a file in /etc/sysconfig/network-scripts for each Ethernet interface you wish to create static routes on.

Example:
touch /etc/sysconfig/network-scripts/route-eth0

The syntax for this file is different from the traditional route format used in /etc/sysconfig/static-routes . Redhat has yet to document the change on their web site as of June 2003.

Syntax based on a usenet post go to /etc/sysconfig/network-scripts, make a file called route-devicename (ex: route-eth0) and populate it with your static routes for that device so if you wanted to make a static route to the 192.168.0.0/24 network through 152.3.182.5 type:

192.168.0.0/24 via 152.3.182.5

Persistent static routes for ANY linux distribution

You may use this method to add static routes and it will work under any Linux distribution. However, it is considered by some a 'hack' or the 'ugly way'.

Edit your /etc/rc.local file and add your static routes using the route statement.

Example:
route add -net 10.10.98.0 netmask 255.255.255.0 gw 10.164.234.132 dev eth1
route add -net 10.164.234.96 netmask 255.255.255.252 gw 10.164.234.132 dev eth1
route add -net 10.164.234.112 netmask 255.255.255.240 gw 10.164.234.132 dev eth1

Force the old static-routes file to work under Redhat 9

Clear out the new /etc/sysconfig/network-scripts/ifup-routes script so that you can populate it with the original shell script from Redhat 7.x.

cat /dev/null > /etc/sysconfig/network-scripts/ifup-routes
vi /etc/sysconfig/network-scripts/ifup-routes

type in the following (or copy and paste) not including the tilde lines:

#!/bin/sh
# adds static routes which go through device $1

if [ "$1" = "" ]; then
echo "usage: $0 "
exit 1
fi

if [ ! -f /etc/sysconfig/static-routes ]; then
exit 0
fi

# note the trailing space in the grep gets rid of aliases
grep "^$1 " /etc/sysconfig/static-routes | while read device args; do
/sbin/route add -$args $device
done
grep "^any " /etc/sysconfig/static-routes | while read ignore type net netmask mask bogus dev ; do
if [ "$dev" = "$1" ]; then
/sbin/route add -$type $net $netmask $mask $dev
fi
done

Remember to use /etc/sysconfig/network for your default gateway

If you only intend to add one route, your default gateway, then you need not worry about the static routes file or using the route command. Simply add your default gateway in /etc/sysconfig/network.

Example
NETWORKING=yes
HOSTNAME="hostname.linux.org"
GATEWAY="10.164.234.1"
GATEWAYDEV="eth0"
FORWARD_IPV4="yes"


Read more!!!