-
-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for serial braille displays #426
Comments
Comment 1 by jteh on 2009-12-08 05:24 |
Comment 2 by jteh on 2009-12-08 05:25 |
Comment 3 by jteh on 2010-05-18 04:39 |
Comment by jteh on 2010-09-24 07:26 |
Comment 5 by jteh on 2011-01-23 05:10 |
Comment 6 by jteh on 2011-06-09 03:25 |
Comment 8 by aliminator on 2012-08-28 08:48 Furthermore a user has to change (eventually) the com port only once. There is only BRLTTY as an alternative if serial braille devices are not supported natively. |
Comment 9 by jteh (in reply to comment 8) on 2012-08-28 09:08
From past experience, this causes a lot of confusion for novice users. However, given the high cost of new braille displays, I agree we should eventually support this.
Requiring the user to edit a file is unacceptable for this in the core, as is having a separate config file just for the port specification. Of course, add-ons can do what they like.
For sure. Ultimately, this is what we will need.
How do you anticipate this working as far as the UI is concerned? Is it per device or global to all devices? What happens to this setting when the display is changed? |
Comment 10 by ragb on 2012-08-28 10:45 Given the still many available displays that support only RS232 communication, I truly believe NVDA must support these natively (Brltty is orders of magnitude harder to configure then a COM port, which users of these displays are somehow used to). However, as Jamie states, there are many issues that come up, most of them related with user experience and usability.
If it is provided by NVDA, I can think of two possible designs:
For the add-on interface, I think adding a dialog to the preferences menu (as it's done on the OCR add-on) is the best option.
For the Papenmeier case (#1265) we could for instance integrate the driver with only USB and bluetooth support (does it support bluetooth at all?) but... then someone would create an add-on, with similar code, just to support serial displays. That doesn't seem very ... clever I think (can't get a better word). Further more, I think NV Access and the NVDA community should clearly state if they want or not to natively support braille devices, so this issue does not come up again. My opinion is yes, thay/we shoud, but has consequences (more support load and code maintenance). It would also be interesting to have an idea of howmany serial braille devices are still in utilization, if pople use real RS232 ports or are using USB to serial adaptors (which tend to change COM ports randomly), etc... |
Comment 11 by jteh (in reply to comment 10) on 2012-08-28 11:49 Replying to ragb:
I'm okay with this in the longrun as long as it is an action that the user must take; e.g. press a button which pops up a warning explaining that this could impact other devices on the system. However, manual port selection still needs to be an option.
I'd prefer to generalise this and make it a "port" choice. This way, it can contain "default" or "USB/bluetooth" or similar. The question is: how does a display specify the types of ports it supports? It doesn't make sense to show ports a display can't support. Also, how is this stored in the configuration? If it's stored in a display specific section, that means the author has to take this into account in their config spec if they want to add their own display specific settings in the future. How is the display initialised with this port?
In general, I agree. However, there are cases where this isn't realistic; e.g. too many dependencies, excessive size, not fitting nicely within NVDA's architecture, etc. |
Comment 12 by ragb (in reply to comment 11) on 2012-08-28 13:03
This seems to be a good solution. At least we can say "you've been warned." wen probing serials ports. Manual selection is also a must-have, I agree.
Seems an interesting possibility. But:
I thing this needs heavy refactoring :). Firstly the display driver must explicitly state what commuinications protocol it supports. Probing capabilities and specific should also be stated on the driver, then the GUI can act accordingly. Something like the supportedSettings mechagnism on synth drivers. I have some dobts about the user interface though, and this is not something I've beeing thinking that much so there might be other dificulties, but there is something that really concerns me: Side note: if we do a refactoring on braille displays we can thing about automatic display detection.
I agree. The drivers (braille, or synth drivers) must be integrated into NVDA, not external code that for some reason is distributed within NVDA. |
Comment 13 by jteh (in reply to comment 12) on 2012-08-28 23:23
Actually, on further thought (and I need feedback here), I'm not convinced this requires total refactor. Note that this is different to synth settings, as those are only relevant once the synth is initialised. The port setting has to be available before initialisation. My idea is this:
Question:
This is a bit different to probing, as it should be non-dangerous; probing is active, whereas auto-detection is passive. I guess we can have an autoDetect() method or similar which passively scans for USB/bluetooth. Again, I don't think we should do this for the initial implementation. It's good to have someone to brainstorm this with. Frankly, one of the other reasons I haven't been willing to do this is that I need an advanced dev who actually cares about this/is affected by it and can test it. |
Comment 14 by nvdakor on 2012-08-28 23:52
|
Comment 15 by jteh (in reply to comment 14) on 2012-08-29 01:16
I meant display name as in the name of the port; e.g. "serial: com1". The issue you mention is relevant to bluetooth detection, though.
Imo, we shouldn't handle pairing and should instead leave it up to the user and OS, at least for now. That is what we currently expect for bluetooth displays and many other applications expect this also. |
Comment 16 by aliminator (in reply to comment 13) on 2012-08-29 10:58
In case of an exception, NVDA can fall back to the standard method of querying braille drivers so that no existing driver needs to be modified.
Like the subsection in the speech's one. |
Comment 17 by ragb (in reply to comment 13) on 2012-08-29 13:51
True.
This method returns USB, bluetooth and/or serial ports, (or those that are supported). Is that right?
Yes. For instance, those drivers that are based on vendor libraries (Freedom scientific, for instance) could report better display names and such (I don't know if the fs library supports display listing, this was for example purposes only).
I think so. If there are other specific display settings to store (can you think of any?) we could also store them on that section. Maybe we should generate the config spec based on this, as in synth drivers. However I can't imagine other specific display settings.
Agreed. And not for the first implementation phase.
If the first alternative is called with all ports reported be !etPossiblePorts (the method you mensioned above) this seems to work. However the 2nd alternative makes posible the driver to check on a different order or something. I'm for the first one though.
That makes sence. For USB devices we can use device IDS, as it's done on most drivers now. For bluetooth we can have name checks, but (when possible) bluetooth addresses (those have some manofacture part which might be useful. Just a thought though).
That is good to know :). |
Comment 18 by ragb (in reply to comment 14) on 2012-08-29 14:03
If the manofactures colaborate maybe we can find a better wy to identify bluetooth devices, using bluetooth address, for instance. But I dobt this.
I'd say USB, bluetooth, serial. If one connects a display via USB he/she wants to use it that way, I supose.
As Jamie has stated, I think we should only consider already paired devices. Handling various bluetooth stacks is a mess, or at least it was before...
I don't think we need the complexity of multi-threading for this. The only real advantage I see is checking various ports at the same time, because checking for the presence of various displays implies hard synchronization problems. It's doable but I don't think we need that, and no determinism in display choice, etc. However it is possible to do, I believe.
Note that this is non-deterministic. That is, the returned display can be different on different runs, even with the same connected hardware. I don't think this is good for the user experience.
Don't think the performance enhancement woud be that high so I'm for te single thread aproach. This is not that important, though. |
Comment 19 by ragb (in reply to comment 15) on 2012-08-29 14:06
+1. Handling bluetooth stacks is not something I'd like to do, whenever possible. |
Comment 20 by jteh (in reply to comment 17) on 2012-08-30 08:47
Technically, it can return whatever ports it likes, but yes, this will usually return USB, bluetooth and serial ports. |
Comment 21 by ragb on 2012-08-30 12:26 |
Comment 23 by jteh on 2012-10-19 07:45 |
Comment 24 by jteh on 2012-10-23 02:38 |
Comment 25 by ragb on 2012-11-02 14:26 |
Comment 26 by ragb on 2012-11-02 15:44 http://bzr.nvaccess.org/nvda/braillePorts/
Question: Waht to do for drivers that can't support automatic detection, such as serial-only displays? Don't show the automatic setting? So, in that case, what would be the default for those displays? (we have nothing like that in NVDA of course, but will possibly have, since we want to support serial-only displays). |
Comment by ragb on 2012-11-03 12:02 Adding blocking information ad reassigning to me 8since I have a device here to text with). |
Comment 28 by jteh (in reply to comment 26) on 2012-11-05 03:57
Nice work! Looks pretty good!
I'm not sure i follow the need for this. I guess i see the point in having USB and bluetooth options, but why list the bluetooth ports separately? I guess a user might have multiple FS displays paired via bluetooth, but that seems extremely rare.
It'd be great if the port choice could be disabled if only the auto port is available.
Makes sense.
Yes.
Hmm. I thought of this a few days ago too. I think the best we can do is default to the first port. This is entirely arbitrary, but the only other option is to have a "none" option, which is just silly. I also wonder whether we should introduce some functions in hwPortUtils to get lists of port names and descriptions in the right format given certain criteria. This way, anyone wanting to support serial ports, bluetooth ports, etc. can just call those functions. An added benefit is that the descriptions will be localised consistently; e.g. "serial: com1", "bluetooth", etc. |
Comment 29 by ragb (in reply to comment 28) on 2012-11-05 11:32
:)
My point was more wards to show the bluetooth name of the device, so the user is sure of what device he will connect to. If it is to be automatic, he can simply choose the automatic option. Having two paired displays is more of a side benefit. But it was just a momentary decision, I'm happy to put just bluetooth there and have the driver choose the first bluetooth device, which, unless you happen to work for some FS dealer or something, would be always the right decision (the only one)..
Yes, let me see how one does that with wx Python. Probably we can hide that, but I guess making it disabled would be better.
Ok. My idea is to add another property to the base
Agreed.
will be localised consistently; e.g. "serial: com1", "bluetooth", etc. Makes all sence. Many of the same logic is already duplicated on many drivers, this will help on that too. |
Comment 30 by ragb (in reply to comment 28) on 2012-11-06 09:36
I've got some dobts here. For serial ports, you simply list COM ports and return (in the description) something like "serial: COM1". But for bluetooth ports, what to do? Returning simply bluetooth? This way we may have more than one port with the description "bluetooth". Same question for USB ports: We should just return USB in the description? What to do if more than one USB found? This is a rare case of course. One idea is simply to only return the first USB or bluetooth port found. BTW, these listing functions must receive some sort of predicate to filter the returned ports: i.g. list of bluetooth ports with blutooth names on smoe list, or starting with something (the driver must know those details). |
Comment 31 by jteh (in reply to comment 30) on 2012-11-07 09:17
That doesn't help for Freedom Scientific because the bluetooth name is always the same.
True, though that will always prefer USB if present.
Personally, that'd be my vote. I'm not convinced the fs driver needs port selection at all, since it can all be done automatically, but I'm assuming you wanted this for a reason.
I see you've done that. Looks fine to me. My original idea was that the driver itself would provide the automatic option. By default, this means that drivers that don't need port selection have no ports at all. This avoids the need to specially support an automatic option. I'm happy with your approach, though I'm curious as to what you think of this simpler approach. Replying to ragb:
Hmm. You're right. This idea doesn't really work in practice, does it? :)
USB doesn't fit into hwPortUtils anyway because there are no standard USB port IDs. I'm starting to think we should just leave it alone for now. :) |
Comment 32 by ragb (in reply to comment 31) on 2012-11-09 13:33
For the same moel yes. But it seems that now there are the focus 14 blue, which we don't have the name for. I'll add another ticket to solve that. But yes, for each model the name is the same.
Yes.
I wanted this so I can choose bluetooth, even if the driver is connected via USB. On one hand I can be charging it and disconnect without loosing braille and, when using virtual machines, it's easier to switch the display from host to guest if they are connected in different ways. But this is a very peculiar usecase. And that is the display I have here for testing so I coded it to easily test the port selection. I'm happy to revert it and just use automatic port selection, if you and others think would be better to.
Probably not. But we can have soe more utility methods on hwPortUtils to get bluetooth ports and such, to easy on the implementation of
True.
If we find many duplication o implementing drivers we can simply refactor the code and create some utility methods there. |
Comment 38 by jteh (in reply to comment 37) on 2012-11-22 21:07
My idea was that the driver would be responsible for returning an automatic option in getPossiblePorts if required. If getPossiblePorts is not implemented, there are no ports; it isn't applicable. For displays which have only one connection possibility, I'm not sure the name "automatic" makes sense. This also avoids the need for the extra canDoAutomaticPortSelection attribute. Replying to ragb:
What sort of check? We can only be sure of bluetooth ports, as the user might want to use a USB serial converter or similar and there's no standard way to detect those.
Why not just do "serial: {friendlyName}"? From what I've seen, the friendly name usually includes the port as well, and if it doesn't, the user probably renamed it. Also, I prefer "serial: " instead of "serial port: ", as port is redundant here. |
Comment 39 by ragb (in reply to comment 38) on 2012-11-23 16:11
I understand. in braillePorts,5602 I removed the attributed and returned automatic as another port in the FS driver. The problem I found is on what to store on the config when no port selection is possible (or not applicable). I'm storing auto, but maybe None would be a better option. What do you think? Replying to ragb:
I was talking about the check on the braillenote driver to filter out bluetooth ports (as we only want serial ports, either native or using a converter).
It seems a bit week IMO, but I can't get with a better implementation.
Agreed. Done in change set:braillePorts,5603 |
Comment 40 by jteh (in reply to comment 39) on 2012-11-24 06:51
Just to be sure, do you think this is actually a good idea? I wasn't entirely certain myself, which is why I was curious about your thoughts.
Perhaps None or an empty value? I'm not sure how configobj handles None and empty.
I'm not sure if the COM startswith is necessary. These should all be COM ports anyway. Is there something else you're trying to filter out? I don't see how you could possibly do any better or why you would want to. |
Comment 41 by ragb (in reply to comment 40) on 2012-11-25 13:16
I think so. This way we can diferentiate between displays that can use automatic port selection and those which can't do port selection at all.
Does this not return also USB ports? Say for mobile phones, or something connected. Usually those have different names from "COMx", unless acting as a modem or something. |
Comment 42 by jteh (in reply to comment 41) on 2012-11-25 22:09
I guess we can just always select the first port if there's no port in the config.
I think catch the exception. This avoids the need for another attribute.
This won't ever happen for built-in drivers. All of the current built-in drivers support automatic port detection, so they won't suddenly be unable to . Unfortunately, the situation isn't as clear for add-on drivers and I guess we'll need to throw an exception for those as you suggest. This does raise another issue, though. I guess the port name for automatic as returned by drivers should always be None. Otherwise, initialising from a previous config won't work.
Well, USB emulated serial ports, yes.
I've never seen a USB serial port with a different name, but that's not to say there aren't any. Can you give an example? |
Comment 43 by jteh (in reply to comment 42) on 2012-11-25 22:12
I guess this was one advantage of your previous implementation. Auto was always None; the author didn't have to explicitly know that. Tricky. Now I'm not sure which implementation we should go for. :) I'm not keen on making displays support both "auto" and None for auto port detection; seems rather inelegant. |
Comment 44 by ragb (in reply to comment 42) on 2012-11-26 20:11
Agreed. I implemented it that way in change set:braillePorts,5604 and simplified that code a bit.
Agreed. Now it throws a type error because drivers that don't support automatic setting (hipoteticaly) require a port argument. If no port is selected code will invoke the driver constructor with no arguments, so the type error. (probably a bit confusing, easy to write in code).
For now, I'm storing "auto" if automatic port is select (on the GUI) and "" if nothing was selected (None doesn't work due to configobj implementation - see brailePorts,5605). What happens is that (at least the fs driver which is the only one supporting explicit automatic port selection) as the port argument defaultin to "auto", which makes it work as old driver (when passing no arguments).
I think I've seen those, but can't find one now. Lets ignore it until I find :). |
Comment 45 by ragb (in reply to comment 43) on 2012-11-26 20:16
The choices are "auto" or "" (None doesn't work for storing). As it is implemented now, we can have both stored, however they mean slightly different things: "" means nothing was selected on the GUI before (old drivers and drivers that weren't configured at least once) and "auto", which means "auto" was selected on the GUI for the display. Practically speaking they mean the same, because all builtin-drivers fallback to automatic port selection which is the current behavior for main and previous versions. However, if we add i.g. the braillenote driver, "auto" doesn't make sence for it (at least while bluetooth support is not implemented). |
Comment 46 by jteh on 2012-11-28 05:08 A tiny bit of code review: In braille.py:
Needs translators comment.
Change the C{blah} to L{blah}, as this entity will be in the documentation, so using L{blah} will create a link to it. In brailleDisplayDrivers/brailleNote.py:
Needs translators comment.
This is really minor cosmetic stuff and is more preference, but thought I'd mention it anyway. I prefer to avoid the \ line continuation sign and instead use brackets, which seem more natural. In this case, you already have brackets, so it is redundant. Also, it might be helpful to indent the continued line by one more tab to make it clear it's a continuation. The User Guide needs to be updated for these enhancements, including adding documentation for the !BrailleNote driver. The !BrailleNote driver also needs a What's New entry. Aside from these points, I'm happy for this to be merged. |
Comment 47 by ragb (in reply to comment 46) on 2012-11-28 14:25
[...]
Ok. I'll probably you to review the gramar and such but I'll do it.
Nice :) |
Comment 48 by jteh on 2012-12-03 08:04
I'd probably simplify this to:
I'd also consider removing the portSelectionPossible check altogether and instead just doing a boolean check on possiblePorts. The condition Also, Joseph's recent log on #2012 highlights the case where a port was previously configured but is not present on the system when the dialog is opened. You can probably fix this and simplify the code like this:
|
Comment 49 by ragb (in reply to comment 48) on 2012-12-03 11:56
Yes, that variable is not needed, unless for readability or something. Done in change set:braillePorts,5615
Actually I considered this case but I had implemented it wrong :$. Thanks. It's commited too. |
Comment 50 by aliminator on 2012-12-05 09:51 |
Comment 51 by jteh on 2012-12-05 11:26 |
Comment 52 by aliminator on 2012-12-05 11:35 |
Comment 53 by jteh on 2012-12-05 11:45 |
Comment 54 by ragb on 2012-12-05 16:24 I pushed my changes (mostly documentation). It probably needs some language corrections before merging into main. I'm not sure if the changes entries are right (please confirm). |
Comment 55 by jteh on 2012-12-05 22:53 |
Comment 56 by aliminator on 2012-12-06 10:21 |
Comment 57 by jteh on 2012-12-07 06:04 |
Comment 58 by ragb (in reply to comment 57) on 2012-12-07 10:55
I prefer you to merge it, if you don't mind. I'm still not confortable with bzr merges, and I don't want to screw up main :). |
Comment 59 by jteh on 2012-12-07 11:05 |
Reported by drein on 2009-09-24 09:45
NVDA should have a dialog box in which an user could select port of the Display Braille and BaudRate.
Blocking #2012, #2679
The text was updated successfully, but these errors were encountered: