All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Alexander Epaneshnikov <aarnaarn2@gmail.com>
Cc: qemu-devel@nongnu.org, brltty@brltty.app
Subject: Re: baum: NVDA does not detect usb-braille
Date: Sun, 18 Oct 2026 22:49:10 +0200	[thread overview]
Message-ID: <atUwxiof87wlNm83@end> (raw)
In-Reply-To: <atUfTcaPUHqBQdno@alex-pc>

[-- Attachment #1: Type: text/plain, Size: 905 bytes --]

Re,

Alexander Epaneshnikov, le dim. 18 oct. 2026 22:35:58 +0300, a ecrit:
> On Sun, Oct 18, 2026 at 09:10:39PM +0200, Samuel Thibault wrote:
> > Does the device sends the cell count first or the device identity
> > first?
> 
> I don't know for sure, as I don't have a real Baum display; mine is a
> HumanWare Brailliant, which uses its own protocol. The comment in
> NVDA's driver lists them as "device id, serial number and number of
> cells", so the identity seems to come first, but that is the only hint
> I have. BRLTTY's Baum driver doesn't use 0x15 at all, it asks for each
> of them explicitly.
> 
> NVDA itself doesn't depend on the order: it stores the cell count and
> the identity separately as they arrive and continues once it has both.
> I tested sending the identity first and then the cell count, and NVDA
> detected the display.

Ok, could you check the attached patch?

Thanks,
Samuel

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 2360 bytes --]

diff --git a/chardev/baum.c b/chardev/baum.c
index 166d6f2f09..db0a4fff75 100644
--- a/chardev/baum.c
+++ b/chardev/baum.c
@@ -97,6 +97,7 @@ struct BaumChardev {
     brlapi_fileDescriptor brlapi_fd;
     unsigned int x, y;
     bool deferred_init;
+    bool protocol_on;
 
     uint8_t in_buf[BUF_SIZE];
     uint8_t in_buf_used;
@@ -337,13 +338,27 @@ static void baum_write_packet(BaumChardev *baum, const uint8_t *buf, int len)
     }
 }
 
+static void baum_send_cell_count(BaumChardev *baum)
+{
+    uint8_t cell_count[] = { BAUM_RSP_CellCount, baum->x * baum->y };
+    baum_write_packet(baum, cell_count, sizeof(cell_count));
+}
+
+static void baum_send_device_identity(BaumChardev *baum)
+{
+    uint8_t identity[17] = { BAUM_RSP_DeviceIdentity,
+        'B','a','u','m',' ','V','a','r','i','o' };
+    identity[11] = '0' + baum->x / 10;
+    identity[12] = '0' + baum->x % 10;
+    baum_write_packet(baum, identity, sizeof(identity));
+}
+
 /* Called when the other end seems to have a wrong idea of our display size */
 static void baum_cellCount_timer_cb(void *opaque)
 {
     BaumChardev *baum = BAUM_CHARDEV(opaque);
-    uint8_t cell_count[] = { BAUM_RSP_CellCount, baum->x * baum->y };
     DPRINTF("Timeout waiting for DisplayData, sending cell count\n");
-    baum_write_packet(baum, cell_count, sizeof(cell_count));
+    baum_send_cell_count(baum);
 }
 
 /* Try to interpret a whole incoming packet */
@@ -441,17 +456,18 @@ static int baum_eat_packet(BaumChardev *baum, const uint8_t *buf, int len)
         uint8_t protocol;
         DPRINTF("SetProtocol\n");
         EAT(protocol);
-        /* ignore */
+        if (!baum->protocol_on && protocol) {
+            /* Switching on, answer with device identity and cell count */
+            baum_send_device_identity(baum);
+            baum_send_cell_count(baum);
+        }
+        baum->protocol_on = protocol;
         break;
     }
     case BAUM_REQ_GetDeviceIdentity:
     {
-        uint8_t identity[17] = { BAUM_RSP_DeviceIdentity,
-            'B','a','u','m',' ','V','a','r','i','o' };
         DPRINTF("GetDeviceIdentity\n");
-        identity[11] = '0' + baum->x / 10;
-        identity[12] = '0' + baum->x % 10;
-        baum_write_packet(baum, identity, sizeof(identity));
+        baum_send_device_identity(baum);
         break;
     }
     case BAUM_REQ_GetVersionNumber:

  reply	other threads:[~2026-10-18 20:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <atNoDNz0dQucxzFN@alex-pc>
     [not found] ` <atNo9sk_7jCAi98u@end>
2026-10-17 19:13   ` baum: NVDA does not detect usb-braille, and following the input-linux grab Alexander Epaneshnikov
2026-10-18 16:26     ` Samuel Thibault
2026-10-18 18:52       ` Alexander Epaneshnikov
2026-10-18 19:10         ` baum: NVDA does not detect usb-braille Samuel Thibault
2026-10-18 19:35           ` Alexander Epaneshnikov
2026-10-18 20:49             ` Samuel Thibault [this message]
2026-10-18 19:17         ` baum: NVDA does not detect usb-braille, and following the input-linux grab Samuel Thibault
2026-10-18 19:26           ` Alexander Epaneshnikov
2026-10-18 19:30             ` Samuel Thibault
2026-10-18 19:39               ` Alexander Epaneshnikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=atUwxiof87wlNm83@end \
    --to=samuel.thibault@ens-lyon.org \
    --cc=aarnaarn2@gmail.com \
    --cc=brltty@brltty.app \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.