Friday, August 26, 2011

VoIP: deja-vu 30 years later

These days I am working for my client on quite interesting project which is utilizing live video chat  over IP network. Fun part here is I had to implement this using Java at least from controlling perspective - establish and control RTP stream capture and playback.
After couple of hours of investigation gstreamer project appeared to be quite useful here which enables building of complex media recording and playback functionality using method very similar to Unix command line pipes. Using java binding project gstreamer-java I can build and control audio/video pipe from Java environment which looks great. I don't event have to deal with complexities of RTP and RTCP protocols since relevant RTP plugins are already available. I could learn that established IM solutions like Telepathy or Pidgin (known especially in Linux circles) use gstreamer (gstreamer-farsight) to render audio/video chat, too. Simply put, I couldn't find any examples of ready pipeline which is full-duplex, audio and video interleaved, having video of remote party mixed with own live video from local webcam. Not very helpful even gstreamer-devel forum. Maybe, my questions appeared too trivial to them to respond. I had to undergo try-and-fail trail on my own. Accomplished. I am posting here the full gst-launch pipeline to save some hair if somebody interested.

gst-launch -v \
gstrtpbin name=rtpbin \
videomixer name=mix sink_0::zorder=200 sink_1::zorder=100 sink_0::xpos=524 sink_0::ypos=20 sink_2:xpos=524 sink_2::ypos=100 sink_2::zorder=300 ! xvimagesink \
v4l2src ! video/x-raw-yuv, framerate=30/1, width=320, height=240 ! tee name=t ! queue ! videoscale ! videorate ! "video/x-raw-yuv,width=352,height=288,framerate=30/1" ! ffenc_h263 ! rtph263pay ! rtpbin.send_rtp_sink_0 \
rtpbin.send_rtp_src_0 ! udpsink host=$DEST port=5000 sync=false async=false \
rtpbin.send_rtcp_src_0 ! udpsink host=$DEST port=5001 sync=false async=false    \
udpsrc port=5005 ! rtpbin.recv_rtcp_sink_0 \
alsasrc ! audioconvert ! amrnbenc ! rtpamrpay ! rtpbin.send_rtp_sink_1 \
rtpbin.send_rtp_src_1 ! udpsink host=$DEST port=5002 sync=false async=false \
rtpbin.send_rtcp_src_1 ! udpsink host=$DEST port=5003 sync=false async=false \
udpsrc port=5007 ! rtpbin.recv_rtcp_sink_1 \
udpsrc caps="application/x-rtp,media=(string)audio,clock-rate=(int)8000,encoding-name=(string)AMR,encoding-params=(string)1,octet-align=(string)1" port=5002 ! rtpbin.recv_rtp_sink_3 \
udpsrc port=5003 ! rtpbin.recv_rtcp_sink_3 \
rtpbin.send_rtcp_src_3 ! udpsink host=$DEST port=5007 sync=false async=false \
rtpbin. ! rtpamrdepay ! amrnbdec ! alsasink \
udpsrc caps="application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H263" port=5000 ! rtpbin.recv_rtp_sink_2 \
udpsrc port=5001 ! rtpbin.recv_rtcp_sink_2 \
rtpbin.send_rtcp_src_2 ! udpsink host=$DEST port=5005 sync=false async=false        \
rtpbin. ! rtph263depay ! ffdec_h263 ! videoscale ! video/x-raw-yuv, width=704, height=576 ! textoverlay font-desc="Sans 18" text="REMOTE" valign=top halign=left shaded-background=true ! videobox border-alpha=1 top=1 left=1 right=1 bottom=1 ! videorate ! mix. \
t. ! videoscale ! videorate ! video/x-raw-yuv, framerate=1/1, width=160, height=120 ! videoflip method=horizontal-flip ! videobox border-alpha=0.25 top=-5 left=-5 right=-5 bottom=-5 ! queue ! mix.

Code snippet above is using H.263 codec for video and AMR codec for audio signal. There are 4 RTP sessions, single rtpbin and videomixer . Should be easy to adapt for other codecs supported by gstreamer.

What made me to post this is however something else. I feel like back in time when I was 6 and built my first telephone from one room to another using just spare old telephone microphone modules, 4.5V battery and long wires. I could chat with my brother from room to room remotely. What a excitement ! Today, 30 years later I am doing the same when tested today with my wife gstreamer-based RTP video chat. Technology however has changed. Instead analogue amplitude-modulated voice transfer, I am using packet-switched network, digitized signal processing with complex yet miniature CCD camera. Transferred wirelessly in gigahertz band. Amazing. Let's see what we will meet in next 30 years !

Saturday, June 5, 2010

HP ProBook 4320s HDD replacement

Recently I've purchased new notebook HP ProBook 4320s and one of the surprise was missing dedicated window for hard drive or memory upgrades on the back of the notebook. I had spare SSD at my hand (OCZ Agility) which I wanted to put to work. The problem was, no apparent way how to get it in. Even my low-cost web-browsing machine (Asus EEE PC netbook) had dedicated door for accessing the hard drive and memory without unnecesary disassemble of whole notebook. Thumbs down Hewlett-Packard !

Clueless I started Google search for some hint about hard drive replacement but I wasn't successfull no matter how hard I've tried. No luck, I had to find out on my own. Looking at the frame, no single screw was visible. The only thing which could be removed was the battery. Once detached, four screws were appeared which looked promising. After unscrewing nothing happened, nothing fell apart, almost no part became loose. At this point I want to tell you how to continue without potential damage. Here it is:

Remove the top grill with power switch: actually removing four screws in battery compartment allows you to detach the grill which let you continue with disassembly. When unscrewed, turn notebook on its stands and open the lid. Gently push and slide the grill away from you. You can press both rubber bars with left and right thumb and slide forward. Now the grill should release and you can remove it. You immediately get access to another four screws holding the keyboard.

Remove the keyboard: after unscrewing four screws from above step you continue with the same trick, slide the keyboard away from you, do not pick it up now. After sliding it will get loose and you can remove it. Beware keyboard is still connected with the body via ribbon cable. It is possible to disconnect the cable from the plug and continue keep it away. Actual hard drive is hidden underneath of the palm rest which you have to remove in next step. If you want just upgrade the main memory, you can stop reading now. You should see memory modules once the keyboard is removed.

Remove the palm rest: this step is very easy since instructions are engraved directly next to left screw you have to unmout. After unscrewing you continue with sliding the palm rest to right ! Now you can see hard drive on the right side in metal cage. The cage can be released unscrewing three screws and sliding the drive right. Drive replacement procedure is now the same as with any other notebook computer.

I hope these steps will help anybody of you to successfully upgrade your ProBook 4320s hard drive ! Good luck.

Thursday, April 22, 2010

HP ProBook 4320s - review

I wasn't able to find any decent review of HP's ProBook 4320s despite searching on Google for some time. It is ridiculous how many sites list the device on review pages without even having hands-on experience. I have an oportunity to work with this notebook for couple of days so I can try to describe my personal experience and feelings to help potential buyers with their decision.

General description
According HP's product description, notebook is targeting home small office-home office market. What you get, however, is decent look at the first sight and some decent components inside which you can read about in next paragraphs.

Most parts of the 13.3" notebook body is made of plastic material, especially the bottom and keyboard. Back of the display and palm resting area around touchpad is made of brushed aluminum with hp logo engraved. Downside of brushed aluminium are visible fingerprints which surprised me fairly.
Interesting observation of the backside is absence of any screws or openings. In this category this is rather unusual and makes eventual memory or hard-drive upgrade little bit more complicated. Battery is replaceable without any tools, however. Above keyboard is a decent "grill" with just power button, back-lit with white LED which is lit during normal operation and flashes when suspended. There are no other LEDs or buttons. The only other white LED indicating hard drive activity is on left front side. No big lamps, just small illuminated dot. Simple, clean and elegant.

Keyboard and controls
Keyboard is "chicklet" type with big key surface making it easy to hit the right one. It should be safe to spill cofee on it since keyboard contains drains. Keys are very easy on typing and are quiet enough. Surface between keys is made of highly polished material. This looks very good but attracts fingerprints and tends to be a bit difficult to clean. Some keys (caps lock, f5, f6, wifi on/off) has LED indicator which is lit when the function is on. I appreciate especially dedicated right-most column of delete, home, page up, page down and end keys.
Touchpad should support gestures but I didn't have a chance to test it as I am running Linux most of the time. There are no dedicated touchpad buttons there. Instead, touchpad contains prescribed areas which you can press. There are real buttons underneath and click is audible. What I don't like on this idea is some minimal movement of the cursor when pressing touchpad buttons as the surface under the buttons is touch-sensitive as well.

Display and graphics controller
Surface of the display is anti-glare which is appreciated. Frame, on the other hand, is highly reflective around the display. Display is attached to the main body with two bar holders integrated to the lid. This solution hides party the lid behind the main body when opened.
Above display you can spot 2 megapixel web camera window, microphone and small LED indicator when camera is on.
From image quality perspective, this is my first hands-on experience with LED back-lit display so I can not tell whether good or not however, I must admit viewing angle is little bit narrow and does colors are not very vivid.

Sound and video
Reviewed unit was equipped with ATI Mobility Radeon 4500 graphics controller which is far enough for desktop effects and possibly for some games too. I am not aware of any possibility to switch of external GPU. Typical ProBook 4320s comes with CPU-integrated so make sure which one you are going to buy.
Grill above of the keyboard covers a pair of speakers which are loud enough for basic audio. I love to have HDMI output for connectivity to large PDP or just LCD display with integrated speakers. No more mess with bulky VGA cable nad extra audio jacks.

Heat production, cooling and noise
I was scary and wondering about noise and heat production, however, I was delighted. It is absolutely quiet on condition it is not under extreme load. The only noise is produced by hard-drive spin. Remember, drive is spining at 7200 RPM so it is still audible. If you are absolutely interested on zero noise you can replace HD with SSD to bootstrap the system and let data store on external or network storage.

Networking and connectivity
Reviewed unit came with standard dial-up modem to be surprised. Now I understand why it is so heavy (just kidding). WiFi network adapter is capable of a/b/g/n standards of 802.11. In front of the main body are jack connectors for headphones and microphone, slot for storage cards. Device is equipped with 4 USB ports, one of them is combination of eSATA and USB.

Tested unit has weight of approximately 2.15kg which is upper boundary of every-day wearing to be not unconfortable. I believe without DVD drive notebook could be lighter at least 100 grams. Unfortunately, drive is not removable.

Linux note
I am operating the unit with ubuntu 10.4 and up to now I didn't find any complications up to now. Even the most troublesome feature such us suspend to RAM or hibernation works out of the box. ATI Mobility Radeon is supported directly by ATI. Alhough proprietary, installation is very easy comparable to Windows version. I had to proceed with installation of ATI driver otherwise main fan started to run quite fast even with no evident user load.

Although looking at this unit with skepticism at the begining I can say it is definitely worth of money. You will get notebook with 1) very decent and professional look, 2) sufficient CPU power with i3 350M at 2.27 GHz processor, 3) more than enough graphics power for business use, 4) uncompromised connectivity.
On the negative side, you will get notebook which you will have to keep clean regulary as it attracts every single fingerprint. I believe built-in components such as modem or DVD drive is not absolutely necessary these days in modern notebook, especially of 13" form factor.
At price below 1000 USD I believe you will get reliable buddy for you small business for quite some time.

Tuesday, January 19, 2010

Notification services

It is couple of weeks ago I have uninstalled IM+ instant messenger from my Android-powered phone. Due to excesive power consumption the application could easily exhaust my battery just overnight.
Messaging application is something I am really excited about. Idea of 5 or more simultanously running applications acting like IM+, however, is a battery overkill. No doubt: each messaging application must employ very similar notification code which polls server to return as soon as message becomes available. More such applications are running simultaneously the more CPU cycles are needed and more time spent on radio result in higher power consumption.
Then I was thinking, why it is needed five applications to do the same, power-intensive tasks where just single background service could manage it all. Right after I remembered iPhone and his notifications so much disregarded in many discussions. At the end of the day, the idea is not such bad :-) I am really wondering if such thing does not already exist for Android platform.

Generally, idea is simple: remote application server wants instantly notify mobile application client on some event. In case of we are running five or more of such applications, all need to contact respective server on their own, create socket connection and wait for response. Because all problems in computer technology are solved by another layer of indirection, why not have just single notification server and single network connection to it. On client side, Android service would dispatch messages to respective application listeners. This way not only mobile application get simpler. Moreover, only one network-aware code employs CPU at time and only single thread utilizes radio network hardware. In current stage of concept, notifications are meant as a vehicle for URLs which could be used to extract actual message payload from actual application server.


About Me

Peter is a technology enthusiast excited about internet and telecommunication technology which brings new quality of life to our everyday lives. 10+ years software 'veteran', former Oskar, Vodafone and IBM employee in area of service delivery platforms design and development. Started writing his first Basic code at age of 12, through Java, Enterprise Java and Android, Peter is now exploring ways how to bring all of these power toys to the real work.