Monday, November 24, 2008

Sending WM_WININICHANGE message on device with HTC TouchFlo 3D will crash the device

Today I finally solved a very strange bug in a Windows Mobile project Im currently working on. The bug would only show up on HTC devices, and not our HTC devices we had at our location. After the application was installed and the user started it, the whole device would freeze and reboot itself after a minute or so.

After some digging around, rebuilding, re-installing for way too many times; we found out that if the HTC TouchFlo 3D today plugin was enabled the device would crash. With that knowledge I was able to pin point the location of the failure which was that the installation DLL sends a
WM_WININICHANGE message to refresh the PocketPc Today plugins.

As many
sites and forum posts states, this is the only way to refresh the Today plugins.

::SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0xF2, 0);

Of course, this is not documented anywhere within MS documentation; and the
documentation that exists states that the wParam isnt used at all (which in fact it is).

It seems that the HTC TouchFlo 3D isnt capable of handling the
WM_WININICHANGE properly, and even just opening the calendar application after that sending that message will crash the device. So if your WindowsMobile application sends that message, I would advise you to look into this. Using the replacement message WM_SETTINGCHANGE does not change anything, the device will still crash.


One solution is to check if the HTC TouchFlo Today plugin is enabled, which can easily be retrived through the regkey
"HKLM\Software\Microsoft\Today\Items\TouchFLO 3D\Enabled". If it is enabled, then do not send the WM_WININICHANGE message.

Tuesday, November 04, 2008

Trying out SimplifyMedia on Debian

I just noticed SimplifyMedia, and wanted to start sharing music from my home media server. The server is running Debian etch (4.0), and there is no debian repository for it (not surprinsgly as it is not open source). Here's a short description on how I got it to work on my Debian machine.

Startup

  1. Download the package from SimplifyMedia Downloads.

  2. Unpack the contents to a folder

    tar zxfv simplifymedia.tar.gz

  3. Install all necessary debian packages to get the SimplifyMedia server running
    aptitude install libavahi-client3 libavahi-common3 libavahi-compat-libdnssd1 libavahi-core5 libc6 libdaemon0 libdbus-1-3 libfreetype6 libgcc1 libidn11 libpng12-0 libssl0.9.8 libstdc++6 libx11-6 libxau6 libxdmcp6 libxext6 zlib1g

  4. First you need to register for an account, start the SimplifyMedia GUI and enter all needed details. After registering close the GUI.

    simplifymedia/SimplifyMedia

  5. Start the simplifymedia server using the newly created credentials

    simplifyserver/simplifyserver.sh -n USER -l HomeTest -p PASSWD -s /home/media/Music/

  6. Now the server will start scanning your folders, and soon publish the location.




Gotchas/Problems

  • I'm using the Winamp plugin on my Windows XP laptop, and many of the files does not played when selected. This is a major issue, but I'm hoping it will be fixed soon.

  • The server did not find all my mp3's, it's currently missing 15% of my files.

  • Even though I'm almost sitting next to the server (using Wlan) the playback stutters sometimes.

  • There is no daemon support, so I need to fix something.

  • The password is shown in clear text when doing a ps aux



Impression
I was more impressed when reading about it than now after I've used it. The problems that it can not find all files, not able to play all files on a client; are a little too much for me to accept. But hopefully it will improve and become something great!