Saturday, February 26, 2011

Nokia Frustration, cont'd is the source and is for OpenSync 0.2 - we are on 0.22-156.1 so it should be applicable...

OpenSync is a successor of project  Multisync, created by the same people.
To get started with OpenSync you probably need:

    * OpenSync itself, the core: 
          it is a library and does not contain any plugins or user interfaces. It is the engine for synchronization.

    * The format plugins. 
          OpenSync converts every data into standard formats before performing the synchronization. You will require at least one of the following plugins:

    (We do not have any of these nor are they offered by YaST!)

    + vformat: 
          supports vcard, vcal, iCalendar, vtodo and vnote. It is required for devices that directly provide this kind of format.

    + xmlformat: 
          enables to handle any xml compatible data, like documents, bookmarks, notes and contacts. It is the central format for libopensync to perform changes comparison and mergers, this format is required.

    + The peer plugins: 
          there is one plugin per type of thing to synchronize (files, PDAs, smartphones, Google Calendar, whatever). Note that the version number for the OpenSync core must match that of the plugins you want to use. For instance, you can use the Evolution2's plugin 0.22 with OpenSync-0.22 but not with OpenSync-0.36 and viceversa. (All our plugins are 0.22

    * Some kind of user interface (UI): 
          such as Multisync or  Kitchensync for KDE. Multisync contains both a command line tool (osynctool) and a GUI written in GTK. Note that multisync versions older than 0.90 are not relying on OpenSync and won't work''

(We do not have either of these nor are they offered by YaST. Multisync-GUI is available, but as noted yesterday it is only a text editor for the configuration file. The notes on this state "This package is independent from the various multisync-* packages which will be obsoleted once OpenSync has left the beta phase." It would seem that this has already occurred if none of the mulitsync-* packages are offered. gives the latest (0.22) resources for Gentoo, Mandriva, and OpenSuSE. Since our present install is not working there is no harm in nuking it and downloading the Factory package for OpenSuSE. This detail is available on request, but suffice it to say we have the latest and all seem to by in sync among themselves.

But these do not include KitchenSync. offers an UNSTABLE version for OpenSuSE, so we give it a try. But it conflicts with the gnokii plug in, so we let it deinstall that plugin, we can always add it later. But then it wants to wipe the entire opensync install, so we say fuggedabout kitchensync for now.

And that is where the guidance stops.

So other than having replaced the software with slightly newer versions, we are where we ended yesterday.


So OK, we've done due diligence by going to the OpenSync source and RTFM. It's just that the manual is a bit short.

Nuke the old configuration files, reboot, and start again.

OK, from the top:
1. Download files        Done

2. Test if everything went right:
    msynctool --listplugins    Result:
    Available plugins:
We did not get syncml-http-server suggested by the ubuntu site.

All the following are done as user, not root:

3 Create a directory to store your files:
    mkdir ~/files_from_nokia
4. Add a group to sync your nokia to Evolution as user:
    msynctool --addgroup nokia2evo
5. Add members
    msynctool --addmember nokia2evo evo2-sync
    msynctool --addmember nokia2evo syncml-obex-client

6. Detect your phone over bluetooth:
    hcitool scan    This returns
        Scanning ...
                E0:A6:70:FE:9B:DC       Andy's N8

7. Get all services available on this phone:
    sdptool browse E0:A6:70:FE:9B:DC | less    This returns a very long list (253 lines in my case) of services, listed in the sub-tab Services.
    The |less pipe lets you scroll up and down the list using up and down arrows.

    Of particular interest is:
        Service Name: Nokia SyncML Server
        Channel: 10

8. Find the USB services offered by the phone. Plug in the USB cable first  and do
    syncml-obex-client -u    If you don't plug in the cable you will get
        Found 0 USB OBEX interfaces    With the USB cable connected you will get
    Found 4 USB OBEX interfaces
    Interface 0:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: SYNCML-SYNC
    Interface 1:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: PC Suite Services
    Interface 2:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: SYNCML-DM
    Interface 3:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: Haptics Bridge
    Use '-u interface_number' to connect

    The SYNCML-SYNC interface is of particular interest.

9. Configure client 1 evo2-sync:
     msynctool --configure nokia2evo 1    This creates the configuration file and opens it in vi. For this member nothing needs to be done, so just quit (:q[Enter])

10. Configure client 2 syncml-obex-client:
     msynctool --configure nokia2evo 2    Again, this creates the configuration file and opens it in vi. For this member much needs to be done, and done so much more easily in kate or some other GUI text editor so just quit (:q[Enter]) then open the file in your favorite editor. The file to open is:
    /home/$user/.opensync/group1/2/syncmember.conf    where $user is your user name.

    + Bluetooth MAC address: E0:A6:70:FE:9B:DC (yours from the hcitool scan above)

    + Bluetooth channel:
        There is some confusion. Yesterday's work indicated it should be the Syncml Client channel, while today says to set it to the channel being used  by SyncML Server from step 7. above, which returns this as channel 10.

    + The usb interface number of the SYNCML-SYNC target:
        This is the interface number (0) from step 8 above.

    + Set the connection type to use. 5 means obex over usb, 2 means obex over bluetooth

    + The string that the plugin will use to identify itself. suggests PC Suite.
        The phone itself at Settings > Connectivity > Data Transfer > Sync is titled the same.

    + Other settings: suggests:
            * version: 1
            * wbxml: 1
            * usestringtable: 1
            * recvLimit: 10000    Default is 0
            * maxObjSize: 10000     Default is 0
        Don't change contact_db, calendar_db or note_db, and don't put in a username or password
            (perhaps unless you have one set up in the phone).

    + Additional settings not in the default .conf file suggests additional settings for

            You'll need to fix permissions for your USB device. First you should connect your device with the usb cable. Then make sure that the lsusb command lists your device:
            returns a bunch, including
            Bus 001 Device 003: ID 0421:0302 Nokia Mobile Phones
        Now they want us to change some rules, but first let's just see if it flies as is.
        But the response is
                 Error while synchronizing: Invalid answer from plugin process            Bluetooth:
                Member 2 of type syncml-obex-client had an error while connecting: Bluetooth connect error
11. OK, change the rules:
    + Unplug the phone
    + Use kate as root to modify /etc/udev/rules.d/40-nokia-mobiles.rules. The file does not exist. Write it as
        BUS=="usb", SYSFS{idVendor}=="0421", SYSFS{idProduct}=="*", MODE="0660", GROUP="dialout"
        # This might work if the above doesn't :-( (substitutes ATTR for SYSFS)
        # SUBSYSTEM=="usb", ATTR{idVendor}=="0421", ATTR{idProduct}=="*", MODE="0660", GROUP="dialout"
    + Run as root:
        /etc/init.d/boot.udev reload    + Replug the phone

12. Make sure the configuration has been updated using the command below as user:
    msynctool --showgroup nokia2evo    This prints out the configuration file

13. Run the sync:
    msynctool --sync nokia2evo
But no joy:
         Error while synchronizing: Invalid answer from plugin process
        Member 2 of type syncml-obex-client had an error while connecting: Bluetooth connect error

So tomorrow is yet another day...

Friday, February 25, 2011

Woohoo! A simple keylogger!

After a full day of work (below) and a good meal it was time to play.

I enjoyed Jono Bacon's distinction between systematic and opportunistic developers (Linux Format 140 January 2011 Get developing ):

This is me.

Everything I do I do intensely. Document it, analyse it, etc. And I get tired like everyone else, and sometimes just stretch out on the sofa and go to sleep.

So I would like to know when all that intense activity ceased.

Solution? A keylogger. Something that will record any keyboard activity with a time stamp.

I tried inotify. A great program, but much more complex than I need. I just want to know when I checked out.

Tonight I came across logkeys:

Easy install:
     Untar it then (as root)
     make check
     make install

Very simple, very cool, very minimalist, very high entropy. Simply records keystrokes to a log file with a time stamp.


My command is (as root):

     logkeys -s -o /Desktop/logkeys.log &

Doing this as root makes the file unreadable by the user, so again as root:
     cd /Desktop
     chown -R $user:users *
     chmod -R 0755 *

A sample output:

2011-02-25 23:43:27-0500 > doing this as root makes the file unreadable by the user, so again as root:b     b     cd /desktop
2011-02-25 23:44:17-0500 >      chown -r andy"$user:users
2011-02-25 23:44:36-0500 >      chmod -r 0755 *<#+3> *b
2011-02-25 23:45:03-0500 > bvery bcool.
2011-02-25 23:45:15-0500 > <#+67>
2011-02-25 23:45:27-0500 > a sample output:
2011-02-25 23:45:33-0500 >

Very cool.

So it is now late (as shown by the log) but not too late. Tomorrow I'll bet it can be tweaked. For example, I don't really need the time zone and we could do without the scrolling and navigation records.

But all in all very cool for what I want.

Well done.

Fuggedabout MSWin. How about OpenSync?

Having given up temporarily on MSWin sync for the N8 or N900 we undertake opensync. 

is an excellent guide for Bluetooth sync with the E70.

We adapt it here for our machines.

+ Download and install:
    - libsyncml
    - libsyncml-tools
    - libopensync
    - libopensync-plugin:
    - libopensync-tools

libopensync-plugin-kdepim is problematic as it no longer seems to exist.

The multisync-gui is nothing more than a text editor for the configuration files.

+ First create a group to sync your nokia:
    msynctool --addgroup sync_nokia2file

 + List all plugins available to sync your phone:
    msynctool --listplugins

    This returns:
        Available plugins:

+ Now add three members to the group sync_nokia2file:
    msynctool --addmember sync_nokia2file file-sync
    msynctool --addmember sync_nokia2file syncml-obex-client
    msynctool --addmember sync_nokia2file evo2-sync

Clearly this command is in the form of
    msynctool -addmember $groupname $plugin-name

+ Create a directory to store your files:
    mkdir ~/files_from_nokia

+ Set up the phone to sync. My N8 uses
        > Connectivity
            > USB > Nokia Ovi Suite
            > Data Transfer
                > Sync
                    x Contacts
                    x Calendar
                    x Notes
                    x Bookmarks

 + Detect your phone
    hcitool scan    This returns
        Scanning ...
                E0:A6:70:FE:9B:DC       Andy's N8

+ Now get all services available on this phone:
    sdptool browse E0:A6:70:FE:9B:DC | less

    This returns a very long list (253 lines in my case) of services, listed in the sub-tab Services. The |less pipe lets you scroll up and down the list using up and down arrows.

Of particular interest are:

Service Name: SyncMLClient
    Channel: 6

The author states:
Some interesting Nokia code to retrieve information about MAC address:
      #2820#: get the Bluetooth MAC adress
      #62209526#: get the WLAN Mac address

 But at present I do not know how to apply that information.

The service name "SyncMLClient" is the service used for file transfer. It's channel 6 in my case. also helpful in reaffirming that this is the channel of interest:
    Scroll through until you come to the section referring to "SyncMLClient" (NOT the "Nokia SyncML Server" or "SyncML DM Client"). Note down the Channel shown.

+ Now we have to configure all members of the group sync_nokia2file.

+ First is the configuration file that describe the path to future files. Do
    msynctool --configure sync_nokia2file 1

    This should open the vi text editor, where you can enter the configuration data for the member.  
vi isn't very difficult, just arcane.
is just one of zillions of vi howto URLs. These are the key commands needed to process this:
    i    Insert text
    Esc    Exit insert mode
    u    undo whatever you just did
    ← →    Left, Up, Right, Down moves in those directions
    :wq    The colon indicates a command, so write quit

If you'd rather not use vi then this file can be opened with kate or any other text editor at    /home/$user/.opensync/group1/1/file-sync.conf
where $user is your username.

+ Next is to define the channels for a number of services, obviously more difficult.

First, find the available USB services (as root):
    syncml-obex-client -u    This returns:
    Superuser privileges are required to access complete USB information.
    Found 4 USB OBEX interfaces
    Interface 0:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: SYNCML-SYNC
    Interface 1:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: PC Suite Services
    Interface 2:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: SYNCML-DM
    Interface 3:
            Manufacturer: Nokia
            Product: N8-00
            Interface description: Haptics Bridge
    Use '-u interface_number' to connect

Then configure the obex client.
    msynctool --configure sync_nokia2file 2

This step is necessary to create the file, but again, you can avoid vi by exiting and with a text editor modifying

    This has a large number of parameters. Mine are available on request. Read and follow the prompts in this file. I left most things as the default.

Next configure the evolution client.
    msynctool --configure sync_nokia2file 3    

Again, this is necessary to create the file, but you can avoid vi with a text editor modifying

+ To get a resume of your configuration just do a:
    msynctool --showgroup sync_nokia2file

+ Now all is configured: just sync your date from your phone to your computer:
    msynctool --sync sync_nokia2file

Oops. No joy:

Clients 1 and 3 connect, Client 2 does not.

So tomorrow is another day.


Thursday, February 24, 2011

I surrender - Nokia Ovi Suite - Windows XP

+ The Cable Connectivity Driver is hosed. Removing it allows the device to be recognized the first time, except that its mode (which is recognized by Windows) is not recognized by Ovi, which declares that the device is not in Ovi Suite mode, even though it is.

+ The typical mantra (uninstall, reboot all devices, reinstall) does not work.

+ Plugging in the phone gets a report of Bad CDC descriptors. We haven't figured out what that means.

+ Windows recognizes the phone as a Digital Still Camera but also as N8-00 in Ovi Suite mode on occasion.

+ But Ovi will not connect to it.

========== Details ==========  
Ovi Suite is installed. Reboot.
+ Plug in and connect the phone before starting Ovi: not possible since Ovi starts on boot and resides in the system tray.
+ Plug in and connect the phone after disk thrashing subsides. dmesg reports bad CDC descriptors.
+ Click left, right and double on the system tray icon: Nothing
+ Right click the desktop icon: we get and hour glass for a while, then nothing. Correction: after several minutes it starts loading, very slowly.
    Windows Task Manager reports Ovi Suite not responding. Highlight it and click End Task. Then it appears! But shortly after crashes and disappears.
+Reboot without the phone plugged in.
+ Right click Ovi in the system tray. After fifteen seconds it offers
    - Open Ovi Suite
    - Exit
+ Click the desktop icon. Ovi comes up. dmesg has no odd registrations.
+ Plug in the phone. Same as before. Windows recognizes it in the Ovi mode (not storage) but Ovi hangs at a very low rate. I did try touching the USB icon on the phone and reselecting Ovi Suite in case perhaps this had gotten lost, but there is no change. The only choice is to reboot.
+ Reboot, delete the Cable Connectivity Driver, try one more time.
+ Plug in the phone. Now it is recognized. Minor problem: USB Controller Bandwidth exceeded. The USB controller does not have enough bandwidth for the Digital Still Camera. The USB controller wants 95%, the System reserve is reserving 10%. We'll deal with that later.
+ Select the Nokia N8-00. The program responds that it is not in the PC Suite USB mode. YES IT IS! But I reset it in that mode just the same.
No joy, but progress. So reboot, and reboot the phone.
+ Start Ovi, plug in the phone. Same message about USB Controller bandwidth. This time Ovi does not recognize the phone. Shut it down and restart. Still no recognition. Disconnect the phone and replug.
+ Still no joy. Go to Device Manager and uninstall the Digital Still Camera, which is how it is being recognized... No joy.
+ Disconnect, reconnect. No joy.
+ Remove all Nokia software except the Ovi Suite. Click Repair on Ovi Suite. It takes forever, during which I prepare dinner. But eventually it announces that it has been repaired. It has not replaced any of the drivers I had deleted. So start it up and...
    - Windows recognizes both Digital Still Camera and N8-00 Phone Parent
    - Ovi recognizes N8-00
But then slows to a crawl. Windows is now totally frozen. There is not a lot of disk activity, but the CPU is flying.. htop shows it eating 98% of CPU time.

OK enough for today.

Wednesday, February 23, 2011

Nokia Frustration, cont'd

OK. We've been struggling for several days to install a functional version of one or another of the Nokia Suites: Ovi or PC on Windows XP (Service pack 3).

They grind and grind and nothing happens.

So finally we nuke the session, reboot, nuke the software, and try a different iteration.

Then today it occured to me: maybe it is trying to phone home and my (excellent) firewall is not allowing this?

So tonight we try again: delete all traces of Nokia anything, reboot, and restart installation, this time of Ovi Suite, and monitor the firewall log:

+ Ovi Suite itself progresses (slowly) without any firewall activity. But then complains Minimal memory 256 MB . So shut down, adjust memory, reboot, restart the installation.

Yes, indeedy. It is trying to phone home. The firewall reports (dmesg):

[12735.781008] ABORTED IN=wlan0 OUT= MAC=00:24:d2:2b:e1:52:94:44:52:78:f0:28:08:00 SRC= DST= LEN=40 TOS=0x00 PREC=0x00 TTL=47 ID=0 DF PROTO=TCP SPT=80 DPT=2398 SEQ=3165126420 ACK=0 WINDOW=0 RES=0x00 RST URGP=0

To which I respond:
     P1630:~ # whois receive:
netname:        TROLLTECH-NET1-OSL-NO

So TrollTech (QT) is trying to read me because OVI is built on QT. But my firewall is blocking this.

Is this why the app won't install? Why didn't they tell me beforehand?

But before I open the firewall port I want to try all other available options:

OVI Suite has installed successfully, it wants me to do all kinds of things, but gracefully gives me the option of "doing this later".

OK, nevermind, continue. Reboot WinXP, and continue to try to install the phone, this time monitoring the firewall.

First, Ovi asks me to plug in the device. I do.

dmesg reports discovery
    [14282.120826] usb 1-3: Product: N8-00

but also reports a fault:
    [14282.124194] usb 1-3: bad CDC descriptors
    [14282.125721] cdc_phonet: probe of 1-3:1.14 failed with error -22

This is troublesome (probe failed) but Windows XP recognizes the phone in the tray.
    Found new hardware... etc.
Ovi says Please wait while USB drivers are installed on your computer but then freezes.

Firewall log does not show any blocking. But now Ovi is completely frozen. Fortunately WinXP is not, so we shutdown and reboot.

Once again, start up Ovi Suite. No firewall messages, but the above cited bad CDC descriptors complaint. But Ovi never restarts.

OK, shutdown, reboot.

Ooops, black screen of death. Once again, shut down. Period.

Start again.

OK, this time we get a warning about WinXP not having started correctly, we choose Start Normally and up it comes.

Now the test: wait for all the disk thrashing to stop and then try to start Ovi. The thrashing goes on for about one minute (timed).

Plug in the phone. dmesg reports

[16009.828303] usb 1-3: bad CDC descriptors
[16009.830473] cdc_phonet: probe of 1-3:1.14 failed with error -22

and indeed Ovi fails to see the phone.

So there is something in the CDC descriptors that is preventing Ovi (or, I'll bet I get the same result tomorrow from PC Suite) from finding the phone.

Time for bed.

dmesg and kernel hacking

I came across a lot of interesting stuff on kernel hacking:

It says:
     To enable timestamp options on kernel messages:
     Kernel hacking
         [*] Show timing information on printks

But it doesn't say where these [bracketed] options are being set.

It turns out that they are set with
    cd /usr/src/linux
    make menuconfig

and this particular option is already set. So this does not help, but the rest is interesting:
gives details on kernel configuration for SuSE.

    To configure the kernel, change to /usr/src/linux and enter the command make config. Choose the features you want supported by the kernel.

So out of curiosity I did that.

Woh! I hope I haven't done myself in, as this responded with:

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/basic/hash
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o
  SHIPPED scripts/kconfig/
  SHIPPED scripts/kconfig/lex.zconf.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf arch/x86/Kconfig
# using defaults found in /boot/config-
* Linux Kernel Configuration

at which point I bailed out.

So I better go back and finish it, perhaps by hitting return at each prompt unless I want to change it...


It's all coming back to me, kernel hacking back in 2002. And making a mess and having to reinstall...

But wait! It goes on:

“menuconfig” is a more comfortable way to configure the kernel. If necessary, install ncurses-devel with YaST. Start the kernel configuration with the command make menuconfig.

This does indeed require ncurses-devel. So we install that and try again.

Aha! Now this shows the options in the [*] and [ ] formats. The Kernel Hacking option (highlight and hit Enter) is where we want to go.

So we check it all out, exit without saving changes, and (fingers crossed) reboot.

It comes back up just fine.


All this occurred while trying to figure out how to convert the dmesg timestamp to real time.
/var/log/messages has system events that may be able to be correlated with dmesg output. There are allusions to a /var/log/kern.log having real times, but I don't have such a file.

So tomorrow is another day.

Monday, February 21, 2011

More PC Suite angst

A new day after several reboots.

On the N8 Settings > Connectivity > USB > Nokia Ovi Suite defines the use of the USB cable as a synchronizing medium.

If you have ever connected the phone in an incompatible mode then PC Suite remembers this, even if you have changed the phone. So you need to uninstall and reinstall PC Suite and all its components (connectivity kit, anything named Nokia), or search your user settings. Nokia admits this, see:
It says:

Plan A :
 Uninstall PC Suite and its components , Restart PC, Install PC Suite - connect new phone

Plan B :
Exit PC Suite.  Go to C:\Documents and Settings\USER\Application Data\PC Suite. Find Folder Named with IMEI-number and delete it. Now you can start PCSuite; data about the phone will be deleted.


+ Reboot. You may just have to pull the plug, since it doesn't close gracefully.
+ Open the Device Manager (Start > Control Panel > System > Device Manager
+ Plug in each phone and delete the entry that appears with the yellow highlighted question mark.
+ Reboot. Again, you may just have to pull the plug, since it doesn't close gracefully.
+ Reinstall Nokia PC Suite. Plan on reading a magazine while it loads. It takes forever.
+Follow the prompts. DO NOT plug in the phone until told to do so.
+ Plug in the N8 phone. It reports USB Connected Nokia Ovi Suite
+Wait another eternity. I started this step at 18:26 and read a magazine until my patience ran out at . The hash bar runs, the prompt says Windows is installing PC connectivity Cable drivers, please wait. The task bar icon says Found new hardware Nokia N8-00 Phone Parent. The cursor has an hour glass.

AHA! Ctrl-Tab shows a window about participating in a feedback program. It is waiting for confirmation. OK, click the green check mark. It eventually closes (it is now 18:39) and returns to the Get Connected prompt and progress bar.

18:41: still no joy. Click the back button. It turns blue about 30 seconds later.
18:45: try Ctrl-Alt-Delete. No response after a minute.
18:46: pull the plug.
18:48: OK, now we're rebooted. Wait for the disk thrashing to subside.
18:50:30 It has ceased and the diagnostic request screen is up. Before clicking the check mark I look to see if the IMEI file is there, There are two .dat files, but no IMEI.
18:53:30 click the green check mark. Nothing happens.
18:54:30 Start PC Suite. It pops up in fifteen seconds. Very snappy. Good.
18:55:30 Click the get connected box.
18:55:45 Plug in the N8 phone:  Your phone is in the file transfer mode... Well, no it is NOT, but you can't figure that out.
OK. Click OK and now try with the N900:
18:58:00 click the back button. It turns blue, but nothing happens.
19:01:00: OK, we're back at step 1/3. Cable is selected (we've tried IR and Bluetooth, not supported by this machine).
19:02:00: Click next. NO joy, it won't let go of the N8 even though it is disconnected.
Try to get out of this mess,  but no response.
19:05:15 pull the plug.
19:08:00: OK, now we're rebooted. Wait for the disk thrashing to subside.
19:09:00: It has ceased and the diagnostic request screen is up. Before clicking the check mark I look to see if the IMEI file is there, There are two .dat files, but no IMEI. Delete the C:\Documents and Settings\USER\Application Data\Nokia and \PC Suite directories.
19:12:00 Start PC Suite.
19:13:15 Click the connect to phone button
19:14:00 The phone is recognized in PC Suite Mode
19:14:45 click next
19:16:00 the next screen appears (step 3 of 4, with connection options, cable selected),
19:16:30 click next.Read a magazine.
19:21:30 Window pops up implying we have USB connectivity issue. But Windows has seen the phone. It is not our problem, it is Nokia's.
19:23:00 Unplug and replug the N900 phone in PC Suite mode, recognized by Windows.
19:25:00, no joy, pulll the plug.
19:34:00 OK, now we're rebooted. Wait for the disk thrashing to subside.
19:35:30 OK, it has subsided.
19:36:30 Start PC Suite. It pops up in fifteen seconds. Very snappy. Good.
19:38:30 Click the get connected box.
19:38:50 Click next
19:39:40 Plug in the N900 in PC Suite mode. Recognized by Windows as such
20:30:00 No joy, pull the plug.

It does not work.

Now, this is Tomorrow is another day. If I can find an older version that works then everyone wins...

Sunday, February 20, 2011

Nokia Frustration

A couple of very frustrating days trying to install Nokia PC Suite on Windows XP (latest patches). The core program installs, but then the Nokia Cable Connectivity Driver hangs.

I've done the whole routine several times:

+ Start the install. Basic flies, Driver hangs. Reset the machine.

+ Plug in the phone, follow the prompt to install the driver. Driver Hangs. Reset the machine.

+ Go to Control Panel. Delete all traces of software for Nokia: PC Suite, Modems, Connectivity, etc. Anything with a Nokia name
+ Go to Control Panel > System > Device Manager. Plug in the phone, delete the module that pops up with a yellow question mark, reboot.

+ Repeat.

It does not work.

Tried the same with the latest Ovi Suite, same results. The software sucks.

I thought maybe the path was the problem. Initially I wanted to modify the installation path, but then finally accepted the default. No change.

I've owned Nokia gear since their start. Nokia's gear is precious. Beautiful. A pleasure to behold. But their PC sync software, IMHO, sucks. When will they support Linux?


I then also tried this with Ovi Suite with the same results. There is a huge latency with the Cable Connectivity Driver that just does not work for me.

My phones are the latest: the N8 and N900.

Not pleased.

Thursday, February 17, 2011

Solving ALSA and WavePlugin for SqueezeBoxServer

I'm trying to get the WaveInput plugin for SqueezeBox Server working. So I'm trying to sort out ALSA and all its implications. I have figured out the schematic  below based on a number of experiments and other research (click on the figure to get a larger image):
Several notes:
  • All the stuff in blue are functions and controls provided by ALSA.With the advent of the Linux 2.6 kernel, ALSA (the Advanced Linux Sound Architecture) has become the standard sound system for Linux. ALSA comprises both  the base, which provides sound card drivers and firmware, and alsa-utils for user tools. The main application in alsa-utils  is alsamixer. alsamixer is an ncurses-based mixer for controlling your audio interfaces, both playback and recording. There are a number of GUI front-ends for the ncurses (terminal-based) alsamixer, including kmix and a host of others. All of these present the functions embodied in alsamixer. So if, for example, your version of alsamixer does not have a channel for MicIn then none of these front-ends can display such a thing.
  • The diagram shows what alsamixer shows me on my system (OpenSuSE 11.3).

  • The ALSA term for microphone input is MicIn - "low-level, mono microphone input". This does not exist on my system and this is what I need to be able to mute.

  • The red x indicates that there is a MUTE button available for that control. Not all the controls have a MUTE function. In particular, the microphone inputs do not have a mute function. You can set the volume to zero and the sound still is picked up. I have found that the only way to mute the built-in PC microphone is to plug a dead plug into the headset microphone socket. As indicated by the ganged microphone switches in the diagram, this will disable the internal microphone.

  • The Headphone and Speaker outputs also are served by a ganged switch: each of these channels has its own volume control but plugging in a headset blocks the output to the PC Speaker.

  • I don't know where the First Mic Boost Capture channel goes. My assumption is that it is a volume control on the microphone stream, which is then fed back into the sound card to be distributed normally (i.e., to Headphone, Speaker, or Capture channels). But that is a guess...

  • The output Capture channel fills a Buffer. This presumably is read  by some device to then be served to WaveInput. It has an activation checkbox, indicated by the red checkmark. The preferred "device" has been said to be a recording device such as krecord. It turns out that krecord is totally unnecessary, unless you are trying to record the channel. All You Have To Do ... is the detail at the end of this post.

  •  The channel names are those provided by alsamixer (and consequently by all the various GUI frontends for it, e.g., kamix, kmix, gmix, and so forth. These differ from those presented quasi-officially by I have therefore inferred the following correspondence:

    + The ALSA term for microphone input is MicIn - "low-level, mono microphone input". This does not exist on my system and this is what I need to mute. Instead, my system shows Front Mic Boost, which does not have a mute control.

    + The ALSA term for digital stream input is PCM playback - "digital stream from software". This does exist on my system as PCM.

    + The ALSA term for digital stream output is PCM Capture - "digital stream to software". This does exist on my system as Capture.

    + The link cites synthesizer as one of the ALSA channels. This may be what we are seeing as Digital and may be the MIDI input.

    + The link cites Line Out - "analog output to external device" as one of the ALSA channels. This does exist on my system as Headset and controls the analog stereo connection.

  • I am testing all this with streamtuner2. Its feeds happily go to the PC headset (if plugged in) or the PC speaker. But to date, they do not get to the Capture channel and therefore do not get to the Buffer or WaveInput.
OK. So after some reflection and refraction, we hit it again.

The solution was found with the following protocol:
  • Start StreamTuner2
  • Start a stream. This starts kaffeine in Playback mode.
  • Go to kmix, zero and mute all the settings, then open them one by one and wait a long time before the next one. "Long time" turns out to be 34.5 seconds on my system, but YMMV.
Actually the latency is the key impediment to analysis: it takes 34.5 seconds on my system from making a change in kmix before it is reflected in the sound.

Sparing you the details, although if you email an address I'll give you more details, it turns out that (at least on my system) you must:
  • Unmute, max volume the Headphone control
  • Unmute, max volume the Digital control
  • Plug in to the PC headphone socket to disconnect the PC speaker. It has to be a real headset it seems, I tried various other plugs without success.
  • And of course unmute and max volume Master and PCM.
So this is where I am for now:
  • I need a more elegant way of muting the PC microphone than plugging in a blank plug.
  • I need a more elegant way of disabling the PC Speaker than plugging in the headphone.
There are of course many questions remaining to which we may attend in due course. At the top of the list are:
  • Why does it need Headphone when the feed is Digital?
  • Why is not simply muting Speaker enough, rather than requiring a headphone plug?
  • What does it take to actually mute the PC microphone, other than plugging it out?
I suspect these all have to do with impedances and other mysteries. Tomorrow (or next week, or next month) is another day...

For now, very pleased. The sound is beautiful...

So very good work to the author of WaveInput. It now works a charm. I hope this is helpful to others.