View Single Post
Old 04-17-2024, 10:55 AM   #14
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
Quote:
Originally Posted by PeterT View Post
One concern I have is that the three new devices all have the same USB device ID; 0x4237. Kovid has added a single entity LIBRA_COLOR_PRODUCT_ID. Now David has a series of helper functions; isTouch / isGlo etc that are used by set_device_name to assign the correct value to device_name. There is no default device_name in this function.

They are also used by cover_file_endings to assign the supported cover types to _cover_file_endings. Luckily there is a default value here

One place that I know does use the device_name value is the Kobo Utilities plugin.

So as far as I can see we either need to use a generic device_name of (say) Kobo Colour Family or hope that by some magic it is possible to distinguish the devices.

Thoughts?
Based on the existing KOBOTOUCH driver and the Kobo Utilities plugin, it's clear that David thought it valuable to know exactly which Kobo device was connected.

Early adopters of the 2 colour devices are probably going to care more than most about the appearance of the cover thumbnails, particularly fullsize screensavers, that calibre transfers. So it's important to try and get the _cover_file_endings stuff correct which means being able to distinguish between the fullscreen size of the Libra Colour (1264x1680) and the 2 Claras (1072x1448). IIRC @NiLuJe thought that it was far preferable, for visual quality, to let the calibre driver do as much of the image manipulation work as possible rather than leaving it to the Kobo device itself. It's why he contributed the extra KOBOTOUCH covers code (letterboxing and B&W dithered images/PNG optimisation).

I find it surprising that Kobo don't distinguish between the three 2024 models with a unique PRODUCT_ID for each. It's never happened before, has it? Anyway, we need to try to find our own method, if possible. Is there any possibility that the BCD value (whatever that is) will be different?

Failing that, my first idea was a method I used many years ago for distinguishing between Sony models. The Libra Colour comes with 32Gb storage and the 2 Claras only 16Gb. Perhaps we could use self.gui.device_manager.connected_device.total_spa ce() to decide whether the connected 'Kobo 2024' device is a Libra or a Clara? Just knowing that much would let us send the correct fullsize screensavers.

Another possibility is to examine the contents of .kobo/version file. Can we use the first few chars of the SerialNo to determine the model? There's already functions in Kobo Utils to read and parse .kobo/version, namely action.py device_version_info() and device_serial_no()

Other than that, an automated way to distinguish between ClaraBW/ClaraColour isn't immediately obvious but I don't *think* there's any current Kobo/calibre option which needs to know. Obviously users will want to send colour thumbnails (of all sizes) to a colour device but that decision is already under user control in KOBOTOUCH options.

Maybe once someone who knows what to look for has one of these colour models in their hands we'll see that some extra file or directory is present on colour models and we can use that? If all else fails and there's a compelling need there's always the fallback option of a user manually adding a zero-length, no-file-extension specially named file to the root dir of the Kobo (e.g. is_a_kobo2024_clarabw).
jackie_w is offline   Reply With Quote