iPod integration in the car

October 13th, 2008 3 comments

Cars are getting to be pretty advanced and feature rich. [CNET has an article that talks about how iPods are integrated into more than half of 2009 models](http://reviews.cnet.com/8301-13746_7-10064887-48.html?part=rss&tag=feed&subj=TheCarTechblog “Raising the bar: iPod integration in more than half of 2009 models | Car Tech: An automotive blog from CNET – CNET Reviews”). QNX likely has contributed a large portion to many of these models. Its satisfying to see your work end up in real-world product.

[The article](http://reviews.cnet.com/8301-13746_7-10064887-48.html?part=rss&tag=feed&subj=TheCarTechblog “Raising the bar: iPod integration in more than half of 2009 models | Car Tech: An automotive blog from CNET – CNET Reviews”) also has some interesting stats on hard drives and bluetooth integration in cars. The head units in cars these days are as powerful as many desktop computers and have even more peripherals.

Now unfortunately, the one thing the article has completely wrong is that “Microsoft Automotive Platform … offers the most universal integration”. If I were to compare MS Auto to QNX Car, I’d like to point out:

* CD’s are not dead. MS Auto currently doesn’t do CDs, or CD Changers. QNX is shipping in many cars today with that feature. We also support MP3-CD’s
* Ripping CDs, or USB Sticks. QNX’s MME manages all this for you so that when you ask to rip a CD or list of USB tracks to your hard drive it will do that as fast as possible without interrupting your playback. And if you power off your car, it’ll continue where it left off.
* Embedded hard drive support: without ripping, do you support a hard drive?
* Internet Radio integration.. how connected are you without the internet?
* QNX Car also has the same “most universal integration” features that MS has: USB Mass Storage, iPod, PlaysForSure, Zune, Bluetooth.
* QNX Car is shipping in many other makes than Ford. In fact the last stat I heard is that it is in over 40% of the 2009 models! I should talk to marketing to get a completely accurate number.

As usual, Microsoft has lots of dollars to spend on advertising, but the real question is how good is their product? QNX has always been quality driven, and therefore is chosen to run space equipment, nuclear power plants, and the fancy features in your car.

Categories: Multimedia, QNX, Uncategorized Tags:

Last.fm announces subscription service

January 23rd, 2008 No comments

[Last.fm](http://www.last.fm/ “Last.fm – The Social Music Revolution”) lets you choose an artist or tag and play music in a streamed fashion just like a radio station would only you have a large choice of what to play from since you can start with any artist or tag you like.

Today they announced that from the website you can play full-length tracks of your choosing a few times and after that you can pay for a subscription. Another subscription service but this one also offers independent artists a chance to share their music and get paid for it also. [Here is the last.fm blog post.](http://blog.last.fm/2008/01/23/free-the-music “Last.fm – the Blog · Free the Music”)

As usual with legal agreements with the big labels, this hasn’t rolled out in most of the world yet.. And if it’s anything like the [Apple iTunes](http://www.apple.com/itunes/ “Apple – iPod + iTunes”) movie sales I won’t be expecting it in Canada sometime soon.

Categories: Multimedia Tags:

QNX 6.3.2 on Parallels 3.0

January 3rd, 2008 15 comments

I spent some time getting QNX working on [Parallels](http://www.parallels.com/ “Virtual pc, virtual machine and multiple operating system solutions by Parallels, Inc.”) 3.0. Its working well with the exception of video which I know can work, I just haven’t spent the time to get it going yet. If you get it working please comment on this post with how to do it.

First off, why use Parallels now that [VMWare](http://www.vmware.com/ “VMware: Virtualization, Virtual Machine & Virtual Server Consolidation – VMware”) is working? I use Parallels instead of VMWare because it is much faster for what I use it for. I have all my work on my mac and export that folder using nfs to my virtual machines. On my virtual machines I do builds as well as run and test my code. I did a quick test comparing QNX 6.3.2 building the multimedia engine and it took 9.5 minutes on VMWare Fusion 1.1, it took Parallels slightly less than 3 minutes to do the same thing. I also find a significamarknt difference in performance while running my application also.

# Issues:
There are 3 issues with QNX 6.3.2 running on Parallels out of the box:
1. Kernel doesn’t work
2. Network driver (ne2000) doesn’t work
3. Graphics detect vga mode only

There is only one issue with running QNX 6.3.2 on VMWare Fusion out of the box:
1. USB doesn’t work

I’ve got problems one and two fixed for Parallels, here are the steps to get yourself a QNX 6.3.2 virtual machine running on Parallels 3.0 build 5582. There are two floppy images you’ll need to get for this off my server:

1. *Boot floppy*: [http://www.mediatype.ca/wp-content/uploads/parallels/QNX632ParallelsBoot.fdd](http://www.mediatype.ca/wp-content/uploads/parallels/QNX632ParallelsBoot.fdd “”)
2. *Installation floppy*: [http://www.mediatype.ca/wp-content/uploads/parallels/QNX632ParallelsInstall.fdd](http://www.mediatype.ca/wp-content/uploads/parallels/QNX632ParallelsInstall.fdd “”)

# Create the virtual machine:
1. get the [QNX 6.3.2 ISO](http://www.qnx.com/download/feature.html?programid=16783 “QNX Downloads: Documents and Software”)
2. open Parallels
3. click file | new
4. choose custom. OS type: Other OS Version: Other
5. Choose the amount of RAM to give QNX. I choose 300.
6. Create a new hard disk image. I make mine 3000GB expanding.
7. Shared networking
8. Give it a name
9. Optimize for VM
10. Click more options, then select ISO image, then choose the image you got from step 1.
11. uncheck “start guest operating system”
12. Click menu item “Edit” then “Virtual Machine…”
13. Click “Add…” I add a usb adapter
14. Click “Options” Then click the “Booting” tab on the right. Choose “Floppy, Hard Disk, CDROM”
15. Click “Floppy” on the left. Check the “Connect at startup” checkbox. Click the “…” for the image file and choose the QNX632ParallelsInstall.fdd file.
16. Click OK. Then start the VM.

# Install QNX:
Follow the steps on the screen. You’ll need your license key to perform the installation. Make sure to install to the complete hard drive. Myself I install all the tools and GPL utilities. When it asks you to reboot, just turn off the virtual machine by hitting the red stop button on the top right.

# Prepare the VM for regular booting:
1. Click “Edit” | “Virtual Machine…”
2. Click Floppy
3. Check the “…” for the image file and choose QNX632ParallelsBoot.fdd
4. Click OK. Start the virtual machine.
5. This part you need to do quickly. While the virtual machine is booting, click on the black part where the VM text will come up to put your cursor into it. Then when it asks if you want to enter boot options by hitting the space key, hit the space key on your keyboard.
6. Press F5 to have it drop to a shell during boot
7. Type these commands in the shell to replace the stock 6.3.2 network driver with one that works included in the boot image:
cd /lib/dll
/bin/cp devn-ne2000.so devn-ne2000.so.bak
/bin/cp /proc/boot/devn-ne2000.so devn-ne2000.so
8. Hit CTRL-D twice
9. It should continue booting. Only the vga option will present itself at first, continue using these settings.

Categories: QNX Tags:

Audio CD metadata and running MusicBrainz with SQLite

November 11th, 2007 1 comment

An important part of multimedia systems is metadata. Audio CDs themselves don’t have metadata
encoded on them and therefore other technologies are important to fill that gap.

There have been several community projects that have taken place over the past few years. CDDB was the first and was started in 1993. There is a very interesting history about CDDB and how it became Gracenote over the years changing from a community project into a commercial one. Even though Gracenote has one of the most restrictive licenses I’ve ever seen they are the defacto standard for commercial CD metadata. For some interesting reading:

http://en.wikipedia.org/wiki/CDDB
http://yro.slashdot.org/article.pl?sid=06/12/02/1955245&from=rss

FreeDB attempted to be a replacement but it has a fairly polluted database as well as a weak unique ID calculation. This results in being fairly likely to get the information for the wrong Audio CD when you do a lookup.

MusicBrainz is a newer community project that provides metadata for Audio CDs. What makes it better than FreeDB is that it has a better unique ID calculation as well as a moderation and editing system to ensure a higher level of data quality.

The product I’m most interested in is MusicBrainz data which is licensed as Public Domain. This can be downloaded as a PostgreSQL format which makes it very easy to import into other databases. At QNX we’re working on embedded media systems that offer this kind of functionality and it is very nice to have this option available.

I’ve converted the database into SQLite format which is our native database format currently so it fits into our architecture very nicely. The database with all indexes converted into 4.2GB. I dropped most of the data that we wouldn’t need and this resulted in 1.7GB which is still a bit large for an embedded system, but not that much bigger than other options that are available to embedded systems. I suspect that with SQLite’s read-only compression option that this could be significantly reduced in size making it ideal for embedded Audio CD metadata.

If you’re interested in how to convert the PostgreSQL dumps of MusicBrainz into SQLite format download this package. See the makesqliteminimal.sh script as a starting point.

Categories: Uncategorized Tags:

pkgsrc for installing open source

October 18th, 2007 No comments

I’ve always found it a lot of work to install open source software on QNX.. until today. pkgsrc is fantastic!

From the QNX community website:

‘pkgsrc’ is a framework for building third-party software and managing the resulting packages. Originally developed on NetBSD, pkgsrc has evolved according to NetBSD’s principle of portability and currently supports 13 different platforms (hopefully QNX will be number 14). Over 6400 packages are in the base distribution.

This handles dependencies and can build packages on your desktop, very important for a good UNIX system. So far I’ve got bash, openssh, and perl installed… more to follow :)

If you haven’t given it a shot it is quite simple to get started with, you can find the instructions on the wiki.

Categories: QNX Tags:

Unblock Handler

September 21st, 2007 No comments

I had fun writing my first unblock handler in a resource manager. unblock handling is required when clients are currently blocked on a resource manager service and are requesting to be unblocked because of being hit by a signal or other reasons. The kernel will detect that they’d like be unblocked and will send a pulse to the server passing the rcvid and ocb that need to be unblocked and that resource manager can decide what to do with it.

So the reason I was adding this was to support timeouts on the API. This is relatively easy to do from a client API:

struct sigevent api_timeout_event;
api_timeout_event.sigev_notify = SIGEV_UNBLOCK;
api_timeout_value = 100 * 1000 * 1000;  // 100 ms
TimerTimeout(CLOCK_REALTIME, _NTO_TIMEOUT_SEND | _NTO_TIMEOUT_REPLY, &api_timeout_event, &api_timeout_value, &hdl->api_timeout_left);
rc = MsgSend(fd, &msg, sizeof msg.to, NULL, 0);
if (rc == -1 && errno == EINTR) {
	fprintf(stderr, "Interrupted!\n");
}

Supporting this in a server is more difficult. The server is already in the middle of processing the request, potentially
already blocked itself. Ideally we could cancel the request but sometimes that isn’t possible.

Lets just say you can, your unblock handler could be as simple as:

int io_unblock(resmgr_context_t *ctp, io_pulse_t *msg, RESMGR_OCB_T *ocb)
{
	struct _msg_info	info;

	if (MsgInfo(ctp->rcvid, &info) != -1 && (info.flags & _NTO_MI_UNBLOCK_REQ)) {
		cancellation_flag = true;  // other code knows to check this periodically and cancel
		                           // if it's set.
	}
	return(_RESMGR_NOREPLY);
}

It’s important to do that MsgInfo check first because its possible that since getting the pulse the client may have already been replied to.

For the full docs on the QNX site visit http://www.qnx.com/developers/docs/6.3.0SP3/neutrino/prog/resmgr.html#HANDLING_UNBLOCKING

Categories: QNX Tags:

QNX Videos

September 11th, 2007 No comments

Lots of exciting things coming from QNX these days. QNX released several new technical videos to YouTube today. Mine included is posted there although it isn’t that technical. Its good to start with an overview and I’ll get some more done in the future I’m sure.

Here is a list of current QNX Videos:

Instrumented Kernel – Collin Burgess

Momentics Overview – Doug Schaefer

QNX Multimedia Components – Dan Cardamore

Categories: QNX Tags:

Virtual Machine woes

September 10th, 2007 2 comments

My goals for setting up my development environment are:
– Keep code files off of virtual machines so that I can work on my laptop without killing the battery
– have full access to tools like gcc and gdb
– not too worried about using the IDE since I typically work with another editor

For a while it was difficult since I picked up one of the first Macbook Pro’s and at that time there were no virtual machine environments for it. Eventually came Parallels and then VMWare.

I started with setting up Mac OS X Tiger to be an NFS file server. Leopard is going to use /etc/exports to make this easy to do, but until then while you’re running Tiger your best bet is to use NFS Manager. I create a /w folder which I put all my source code checkouts and QNX stages into and when I mount it on my virtual machine it gets the same /w pathname. This way it doesn’t matter which system I’m on, its /w either way.

In my experience so far, parallels is very fast. Even single CPU it out performs VMWare Fusion 1.0 running QNX 6.3.0. Keep in mind however that parallels doesn’t support QNX and the standard 6.3.2 neutrino doesn’t run on Parallels. Colin Burgess managed to get the kernel running on Parallels and that worked well for a while. io-audio, io-net, io-graphics, and io-usb all work well on Parallels. The only problem is that its gotten quite unstable for me, I’m not sure if its because of a Parallels update that I’ve installed or not, but io-audio seems to hang now and then, and in addition parallels itself crashes fairly frequently.

VMWare is stable, io-audio, and io-net work. It has SMP which is good for testing multi-threaded access to applications. The downsides is that its a dog… it is very slow to compile compared to Parallels, somewhere in the order of 5-8 times slower which is very noticeable. And io-usb gives errors but I haven’t spent much time at all trying to get this working. Because parallels has gotten so unstable I’m going to spend a bit more time trying to get this working better.

Many months ago I had built the QNX toolchain on Mac OS X so that I could build QNX applications directly on Darwin. I’m going to take a crack at this again. The reason why I went away from this in the past was because I had only compiled GCC 3.3.4 and we typically ship 2.9.53 binaries so my executables were often incompatible. Parallels back then was very fast and stable and there was no big performance difference while building small apps on the virtual machine. Now that things have gotten so unstable or slow depending on virtual machine I choose I’m going to rebuild the toolchain for Darwin and do testing in VMWare.

One thing that is very nice about this problem, is that I have a choice :)

Categories: QNX Tags:

Welcome to Heads up QNX

September 6th, 2007 3 comments

This blog will be many things related to QNX. I’m in an excellent position in that I work at QNX, and I’m given full freedom to blog my thoughts and experiences at QNX on my own website.

To start off with, I’d like to introduce myself:

Hi, I’m Dan Cardamore.

I’m currently employed with QNX as a software developer and work in the multimedia team. I’ve been at QNX for almost three years now so I’m still fairly new to lots of QNX technologies, but on the bright-side if you’re reading this blog hopefully you’ll enjoy learning with me as I post my thoughts on subjects here.

As far as software development goes, I have to say that multimedia is a lot of fun. You can talk to anyone on the street or in your family regardless of age or technical understanding and say “I work on multimedia systems, like the CD player in your car only with color screens”. Our middleware software is called “MME” and stands for MultiMedia Engine and allows other developers to create multimedia applications quickly leveraging all the work we’ve done.

I’m not the usual developer at QNX. I use Mac OS X as my desktop OS rather than a supported development environment from QNX. As far as I know I’m the only one, but I hope someday that will change. QNX is an awesome OS, especially when you want to make an embedded product or you require real-time or multi-node capabilities, but I prefer a bigger fancier desktop OS. Linux is an excellent OS but its nowhere near as polished as Mac OS X for desktop use and doesn’t have the same application support. I won’t even bother mentioning what I think of Windows as a desktop.

Its late and I need to sign off, but in my next post I’ll talk more about my development environment and how I set it up.

Categories: QNX Tags: