Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 05-09-2011, 03:46 PM   #1
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Device connectivity related questions

I wanted to confirm some behaviour that I see with my Kindle to see if it is an across devices/Calibre "design" feature. This is building on top of some information given previously by chaley regarding some signals posted here on the BookSync thread.

If anyone could confirm the following for me as some have relevance for my next version of Book Sync:
  1. If I have any kind of dialog open at the time I connect my device, the "connection" attempt is ignored. I have to unplug the device and plug it in again (while no dialogs open)?
  2. Likewise once I click Eject on the device button, there is no way of getting Calibre to see my device again until I unplug it and plug it in again?
  3. Connecting to iTunes as a "device", it has no uuid/device info type structure. So the assumption is there can be only one instance of iTunes, and it is identified as being connected to iTunes by get_current_device_information()['info'][0] being 'iTunes'?
  4. All "other" devices (connecting to folder, or to a genuine device) will have the drive info information in ['info'][4] to retrieve a name, uuid etc. And ['info'][0] contains some kind of "device class" information, that does not change regardless of how a user renames their device?
  5. I see that driveinfo information from ['info'][4] potentially could contain multiple locations. Not owning a device that has such capabilities, is this something I should be concerned with? It seems each location would have its own name and uuid?
  6. Related to this, release 0.7.45 had some info about sending news preferentially to main memory and falling back to other locations on the device if no space available. I have no idea where this logic lives. chaley suggested I could use self.gui.sync_to_device() - does that contain the logic within it?

I'm thinking about how I can configure the Book Sync plugin. I would have a section on the plugin configuration dialog which the user can use to add a device, delete and rename it.

I will require a device to be connected to interrogate the driveinfo. So if the user does not have a device connected, they must cancel out of the dialog, plug their device in, go back into the configuration dialog, and at that point I can detect what they have connected and automatically stick it in the list of devices for them (with some "enabled" checkboxes and a delete button). They will also be able to rename a device, which I will write back using the set_driveinfo_name() function.

Sync lists will then be per device per library stored in my config file.

I think my biggest question right now relates to which location(s) to support. I think my "easy way" is to only support "main" just like existing news does, and trust that if I call sync_to_device() it will take care of any issues like space etc.

However I know from people who have posted in the past that there are users who want to have their books on a different storage card other than "main". They can do this I believe for normal books by setting a default storage card? However for news they cannot. Presumably for me to support this I would need to list all the locations retrieved from driveinfo as potential sync lists, leaving it to the user to uncheck ones they are not interested in storing. How does sync_to_device() respond if there was not sufficient space to put the books on the chosen non-main location?

Thoughts appreciated.
kiwidude is online now   Reply With Quote
Old 05-09-2011, 04:25 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,728
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kiwidude View Post
If anyone could confirm the following for me as some have relevance for my next version of Book Sync:
Confirm is strong.
Quote:
[*]If I have any kind of dialog open at the time I connect my device, the "connection" attempt is ignored. I have to unplug the device and plug it in again (while no dialogs open)?
I assume this question arises from experimentation?

My guess is that it is not ignored, but instead the signal message is being tossed because nothing is listening for it on the current event loop. Are you connecting to device_metadata_available? If so, are you using a synchronous connection or a queued connection?
Quote:
[*]Likewise once I click Eject on the device button, there is no way of getting Calibre to see my device again until I unplug it and plug it in again?
This is true. It is a feature of windows.
Quote:
[*]Connecting to iTunes as a "device", it has no uuid/device info type structure. So the assumption is there can be only one instance of iTunes, and it is identified as being connected to iTunes by get_current_device_information()['info'][0] being 'iTunes'?
This is also true. It will be true of any device that doesn't inherit from USB. Currently, that is only the Apple device.
Quote:
[*]All "other" devices (connecting to folder, or to a genuine device) will have the drive info information in ['info'][4] to retrieve a name, uuid etc. And ['info'][0] contains some kind of "device class" information, that does not change regardless of how a user renames their device?
See the answer above. Drive_info exists only on drive-based devices.
Quote:
[*]I see that driveinfo information from ['info'][4] potentially could contain multiple locations. Not owning a device that has such capabilities, is this something I should be concerned with? It seems each location would have its own name and uuid?
I also don't have such a device, but yes, it should be possible. An SD card can migrate from device to device.
Quote:
[*]Related to this, release 0.7.45 had some info about sending news preferentially to main memory and falling back to other locations on the device if no space available. I have no idea where this logic lives. chaley suggested I could use self.gui.sync_to_device() - does that contain the logic within it?
Use the source, luke.
Quote:
I will require a device to be connected to interrogate the driveinfo.
This means that by definition, you won't support non-drive devices. As I noted above, there is only one such device, but it is possible that some of the Android reader applications might fall into this category.
Quote:
I think my biggest question right now relates to which location(s) to support. I think my "easy way" is to only support "main" just like existing news does, and trust that if I call sync_to_device() it will take care of any issues like space etc.
What? I can't store my books to my SD card? Give me my purchase price back!
chaley is offline   Reply With Quote
Advert
Old 05-09-2011, 05:06 PM   #3
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Quote:
Originally Posted by chaley View Post
I assume this question arises from experimentation?

My guess is that it is not ignored, but instead the signal message is being tossed because nothing is listening for it on the current event loop. Are you connecting to device_metadata_available? If so, are you using a synchronous connection or a queued connection?
I was just using a synchronous connection, but I note that the main library view wasn't changing/toolbars not changing etc when I had any dialogs open. So it appeared that as far as Calibre was concerned the device connection "opportunity" was ignored.
Quote:
This means that by definition, you won't support non-drive devices. As I noted above, there is only one such device, but it is possible that some of the Android reader applications might fall into this category.
Not entirely - just that I have to "special case" them to support them. Thanks for confirming that iTunes is the only such case currently.
Quote:
What? I can't store my books to my SD card? Give me my purchase price back!
Yeah I know. But I have seen the question asked a number of times. I wanted to know why Calibre just plain won't support it for news. Perhaps it is something to do with Calibre not storing per device information to even "know" what storage a device should use when sending. After all, this device id stuff was only added relatively recently. I am just curious if there are some scary technical issues I need to be aware of if I allowed users to choose non-main locations.
kiwidude is online now   Reply With Quote
Old 05-09-2011, 06:05 PM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,728
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kiwidude View Post
I was just using a synchronous connection, but I note that the main library view wasn't changing/toolbars not changing etc when I had any dialogs open. So it appeared that as far as Calibre was concerned the device connection "opportunity" was ignored.
Confused.

I started calibre, opened the Find Duplicate dialog, then plugged in my Sony. It was detected just fine. The status line changed, the metadata sync job ran, on-device updated.

Did I not do the correct experiment? Are you referring to something else?
chaley is offline   Reply With Quote
Old 05-09-2011, 06:29 PM   #5
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Hmmm. I tried it at least 3 times and on none of them did it ever connect. I've just tried it now and it has worked no matter which dialogs I had open. Weird. I have restarted my PC in between so maybe that had something to do with it.

Ok, that's cool, at last as a user I won't need to close the configuration dialog to get my device being able to appear in the list for configuration.

EDIT: I did just get a nasty Calibre crash when I cancelled out of the dialog I had open. So maybe all is not well.
kiwidude is online now   Reply With Quote
Advert
Old 05-10-2011, 01:39 AM   #6
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Quote:
Originally Posted by kiwidude View Post
EDIT: I did just get a nasty Calibre crash when I cancelled out of the dialog I had open. So maybe all is not well.
It'll do that if you click your plugin toolbar icon while a device is connected, then disconnect, and then close the dialog. Happened to me and Kovid said it was losing context somewhere and would need looking at. Never did open a ticket as I worked around it by only showing an icon when device is connected.

P.S. Would have been a longer replied, but 11.04 crashed - again - and I lost it...
meme is offline   Reply With Quote
Old 05-10-2011, 03:43 AM   #7
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,635
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Thx meme for confirming that bug. Unfortunately I can't use the same workaround as this plugin by nature needs to be accessible both when a device is connected and is not. I should create a ticket by the sound of it.
kiwidude is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Classic 3G connectivity with softroot 2.5.1 faust Nook Developer's Corner 3 06-14-2011 04:24 AM
Couple of questions : Import and copy to device folders niji Calibre 2 12-20-2010 04:35 PM
Troubleshooting 3G Connectivity Jongwe Amazon Kindle 3 11-24-2010 06:55 AM
Questions about device/screen size ragzy General Discussions 13 06-30-2010 11:08 PM
A couple of questions about the Kindle 6" global wireless device s7whitecoral Amazon Kindle 1 06-23-2010 08:11 PM


All times are GMT -4. The time now is 12:46 AM.


MobileRead.com is a privately owned, operated and funded community.