[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdepim-users
Subject:    Re: [kdepim-users] Kpilot: Problems using "usb:"-device?
From:       "Jason 'vanRijn' Kasper" <vr () movingparts ! net>
Date:       2007-01-09 3:15:44
Message-ID: 200701082215.44312.vR () movingparts ! net
[Download RAW message or body]

On Friday 05 January 2007 13:07, Martin Bernreuther wrote:
> Am Freitag, 5. Januar 2007 03:39 schrieb Jason 'vanRijn' Kasper:
> > > Just to install some programs, I was looking for an "Install
> > > only"-Button, which I didn't find or doesn't exist.
> >
> > Well, if you bring up the kpilot interface (click the kpilot icon in the
> > panel or just run "kpilot" manually), the second icon from the bottom on
> > the left is a "File Installer" where you can add files to install, etc.
>
> Yes, but isn't it like:
> - first choose the Files to install and then
> - the installation happens with the next hotsync together with all the
> other stuff... To "just install" you have to go to the preferences and
> deselect all the other conduits and then start a fast sync process.
> (In my case, I also have to adjust the "standard sync method")
> I think, pilot-xfer -i is much more straightforward.

Ahh, now I understand what you're saying.  Yes, of course, you're right.  
Actually, there should be another sync type of "Install only".  Would you 
please enter a bug for that for me?  I know exactly how to fix that--I just 
need a reminder to do it.  =:)

> > > Using "usb:" I first had no problems at all (like with pilot-xfer).
> > > Hitting the Sync-Button once and that's it. I noticed that kpilot
> > > always freezes, if I start it and a kpilotDaemon is already/still
> > > running in the background.
> >
> > So it sounds like usb: works?  Cool.  I've never tried it myself.  =:) 
> > But I'm not clear on the "freezes" part.  Are you saying that kpilot
> > freezes by itself when the sync is done?  If so, can you please run
> > kpilotDaemon from within gdb and if/when the freeze happens again, press
> > control-c and get a backtrace (bt) and send it to the list?
>
> No. It freezes just if I start it. (No Palm interaction)
> I don't have problems starting kpilot with "PilotDevice=/dev/pilot" in my
> ".kde/share/config/kpilotrc" and I change it to usb:.
>
> But if I have "PilotDevice=usb:" in the kpilotrc, start kpilot (no
> kpilotDaemon running) with

Yep, I know where that problem is too, but finding a solution is tricky.  The 
long version of the problem is that kpilot does this:

try to open a socket
fail
try to open a socket
fail
try to open a socket
... assume that you connect the device here...
open successful
try to bind
bind successful
use QSocketNotifier and ask to be notified when data is available to be read
(now the daemon is free to respond to GUI or DCOP requests)
...
eventually, get notified
go through pi_listen and pi_accept
start syncing

And this works wonderfully for normal devices (not libusb).  But with libusb, 
we are able to open and bind to a device even though it doesn't exist.  Then, 
when we ask to be notified when the socket is ready to be read from, we're 
told that it is immediately.  We pi_listen and pi_accept and there we wait 
indefinitely until the device is connected.  While we're blocking on 
pi_accept, the daemon is completely unresponsive to user requests, GUI 
updates (the icon won't even show up in the panel), DCOP interaction, etc.

The trick is going to be figuring out how to do all of the device interaction 
stuff in a different thread than the GUI thread in kpilotDaemon, while still 
allowing GUI interaction from the conduits (conflict resolution dialogs).  
That's what I need to look into next when I get time.

> >gdb kpilot
>
> (gdb) run --nofork
> and go to the Kpilot settings, I get after a freeze and after Ctrl-C
>
> (gdb) where
> #0  0xb7f4c410 in ?? ()
> #1  0xbf957e58 in ?? ()
> #2  0x00000008 in ?? ()
> #3  0xb6a7c55f in _kde_IceTransRead () from /opt/kde3/lib/libDCOP.so.4
> #4  0xb6a75fef in _kde_IceRead () from /opt/kde3/lib/libDCOP.so.4
> #5  0xb6a7abaf in KDE_IceProcessMessages () from /opt/kde3/lib/libDCOP.so.4
> #6  0xb6a66419 in DCOPClient::callInternal () from
> /opt/kde3/lib/libDCOP.so.4 #7  0xb6a666fd in DCOPClient::callInternal ()
> from /opt/kde3/lib/libDCOP.so.4 #8  0xb6a6b147 in DCOPClient::call () from
> /opt/kde3/lib/libDCOP.so.4 #9  0xb6a6b1a7 in DCOPClient::call () from
> /opt/kde3/lib/libDCOP.so.4 #10 0x080b5baa in
> PilotDaemonDCOP_stub::nextSyncType (this=0x81622f8) at
> /home/hpcbern/SVNwork/kpilot/build-Linux2_6_18_2_34_default/kpilot/pilotDae
>monDCOP_stub.cpp:76 #11 0x0808db0a in runConfigure (daemon=@0x81622f8,
> parent=0x81396b0) at /home/hpcbern/SVNwork/kpilot/kpilot/kpilot.cc:817 #12
> 0x0808e123 in KPilotInstaller::configure (this=0x81396b0) at
> /home/hpcbern/SVNwork/kpilot/kpilot/kpilot.cc:1029 [...]

The problem here is that kpilot has started the daemon and then tries to 
connect to him via a DCOP call.  The call blocks because of kpilotDaemon 
waiting for pi_accept to complete and therefore kpilot hangs.

> (gdb) where
> #0  0xb7fab410 in ?? ()
> #1  0xbfe9c898 in ?? ()
> #2  0x00000008 in ?? ()
> #3  0xb6adb55f in _kde_IceTransRead () from /opt/kde3/lib/libDCOP.so.4
> #4  0xb6ad4fef in _kde_IceRead () from /opt/kde3/lib/libDCOP.so.4
> #5  0xb6ad9baf in KDE_IceProcessMessages () from /opt/kde3/lib/libDCOP.so.4
> #6  0xb6ac5419 in DCOPClient::callInternal () from
> /opt/kde3/lib/libDCOP.so.4 #7  0xb6ac56fd in DCOPClient::callInternal ()
> from /opt/kde3/lib/libDCOP.so.4 #8  0xb6aca147 in DCOPClient::call () from
> /opt/kde3/lib/libDCOP.so.4 #9  0xb6aca1a7 in DCOPClient::call () from
> /opt/kde3/lib/libDCOP.so.4 #10 0x080b7435 in
> PilotDaemonDCOP_stub::statusString (this=0x8161f10) at
> /home/hpcbern/SVNwork/kpilot/build-Linux2_6_18_2_34_default/kpilot/pilotDae
>monDCOP_stub.cpp:201 #11 0x080907a9 in KPilotInstaller::startDaemonIfNeeded
> (this=0x8139680) at /home/hpcbern/SVNwork/kpilot/kpilot/kpilot.cc:165 [...]

Yep.  DCOP-attempted-communication again with the blocked kpilotDaemon.

> > Ohhhh wait.  Did you uninstall the previous version of kpilot on your
> > system? Where did you install the new kpilot version to?
> >
> > The problem is that if you still have the old version of kpilot on your
> > system and you run "kpilot", it will start up the version that you would
> > expect but may launch kpilotDaemon from the old version, thereby causing
> > problems like this.
>
> Yes, you're right. I just did a make, make install (to overwrite the other
> installation). Now I removed the rpm (rpm -e). But this doesn't change
> anything and the symptom stays.

The blocking/stuck GUI will stay until you either don't use libusb or until I 
find time to fix it, unfortunately. But installing kpilot clean will avoid 
other complications.   =:/

> > > Is there also a possibility to synchronize the "pTunes"-stuff.
> > > (Starting "ptunes" will just crash my TX.)
> >
> > What do you mean sync the ptunes stuff?  Install the program file?
>
> pTunes is the "Music application" you get preinstalled with the TX.
> I asked the Palm support, but they didn't tell me how this application
> stores it's data on the SD card. (a directory with a specific name? iTunes
> like?)
> The manual starts with: "Start the WindowsMediaPlayer, go to
> Synchronization and choose the Palm device..." (I tried that on a foreign
> windows machine and even after an WMP update and the ptunes installation
> nothing showed up. You see: also for Windows things are sometimes not
> working...) The solution might be to use the
> DIOplayer (originating from http://www.diotek.co.kr/, but now found at many
> places...), The Magic Lantern
> (http://sourceforge.net/projects/magiclantern/,
> http://sourceforge.net/project/showfiles.php?group_id=126700&package_id=139
>855), TCPMP(http://tcpmp.corecodec.org/)...
> Here, you just create a directory on the SD card and copy all your files
> there...

Yeah, actually, I have ptunes on my Treo and it scans your SD card for 
supported music files, iirc (I haven't used it since I won an iPod nano in a 
give-a-way  =;) ).  So, since kpilot doesn't yet support transferring files 
to the SD card (VFS), you need another way of copying your music files (MP3s, 
I'm assuming) from your computer to your SD card.  If you want to do it the 
software route solely, you can look at Card Export (iirc), which makes the 
Palm emulate an external USB disk and attach to the SD card.  Or, alternately 
(and this is the route I took), spend $20 or so and buy yourself a nice 
little external media reader (I got a belkin 6-in-1 reader for ~ $20, iirc) 
and transfer your music that way.

> > Thanks again for your e-mail, Martin!!  =:)  I very much appreciate your
> > help in making kpilot work for you.  =:)
>
> No. I have to thank you for your time and the advices!

Well, then, thanks for the thanks and your patience.  =:)

-- 

,-----------------------------------------------------------------//
| Jason 'vanRijn' Kasper ::  Numbers 6:22-26 
 `
 | All brontosauruses are thin at one end, much MUCH thicker 
 | in the middle, and then thin again at the far end.  That is 
 | the theory that I have and which is mine, and what it is too.  
 ,
| bash$ :(){ :|:&};:
`----------------------//
_______________________________________________
KDE PIM users mailing list
kdepim-users@kde.org
https://mail.kde.org/mailman/listinfo/kdepim-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic