View Single Post
Old 06-17-2021, 12:09 PM   #523
geek1011
Wizard
geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.geek1011 ought to be getting tired of karma fortunes by now.
 
Posts: 2,808
Karma: 7423683
Join Date: May 2016
Location: Ontario, Canada
Device: Kobo Mini, Aura Edition 2 v1, Clara HD
Quote:
Originally Posted by davidfor View Post
Yes, very sure.

I asked about the apparent audio support and was given a very firm no. But I was told Bluetooth would be used for pairing keyboards. I questioned that as I had not seen any reference to this before. I am not sure, but I don't I think that it is in the firmware that was on the few review devices, but it is in the firmware that has been discovered.
I do indeed see stuff which looks for HID devices, but the thing is, that same code also looks for audio devices (and they're both over DBus, so I don't think it's for other devices). Now, since I do see AVRCP-related stuff, one possibility is that they're planning to allow audio devices to be paired to use their keys to control book pagination. That would fit in with the large amount of new stuff related to key debugging. And, the devs might have experimented with audio for fun (it might be possible to make use of it if they leave that code in the final version, though). Or, alternatively, whatever they're using for BT might have a GStreamer dependency to support AVRCP.

Either way, none of it will actually be usable right now since it isn't connected to the UI, and the Bluetooth DBus daemon isn't shipped (at least in the firmware update).

---

I think I might be able to dig up what the AVRCP key stuff is for though, which should clear things up a bit. For anyone interested, here's the hex I need to figure out the encoding of to be able to give a more confident response about what the A2DP and AVRCP stuff is for:

Spoiler:
514d41500000000100000026000000000161ffff0101000000 0000000067ffff0100001300000000006cffff010000150000 00000069ffff0100001200000000006affff01000014000000 00008bffff0100005500000000016affff0100009000000000 016cffff010000910000000000aeffff010000000000000000 0bffff00000030000000000002ffff00000031000000000003 ffff00000032000000000004ffff00000033000000000005ff ff00000034000000000006ffff00000035000000000007ffff 00000036000000000008ffff00000037000000000009ffff00 00003800000000000affff00000039000000000034ffff0000 002e00000000001cffff01000005000000000192ffff010001 18000000000193ffff01000119000000000195ffff0100ffff 0000000000abffff01000109000000000166ffff0100010900 0000000164ffff01000000000000000073ffff010000720000 00000072ffff01000070000000000071ffff01000071000000 0000c8ffff010000800000000000a6ffff0100008100000000 00c9ffff010000850000000000a3ffff010000830000000000 a5ffff010000820000000000a7ffff010000840000000000a8 ffff010000c50000000000d0ffff0100010200000000.


I think it's https://doc.qt.io/qt-5/qmap.html, so I'll probably just try reading it from a QDataStream.

Edit 3: Hmm, it's not a plain QMap. I'm going to have to put a bit more effort into this.

Edit 4: So, it appears to have a header composed of a few int32s, then an array of structs containing int16s, int8s, and int32s. I'll have put something together to decode them, then figure out what they mean.

Edit 5: Here's a quick dump. I'll need to do some guessing and/or cross-reference against /usr/local/Kobo/generic/libkeys.so.

Spoiler:
Code:
 000  struct { Magic int32; H2 int32; H3 int32; H4 int32 }{Magic:1364017488, H2:1, H3:38, H4:0}
 016  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:353, B:-1, C:16842752, D:0, E:0, F:0}
 028  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:103, B:-1, C:16777235, D:0, E:0, F:0}
 040  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:108, B:-1, C:16777237, D:0, E:0, F:0}
 052  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:105, B:-1, C:16777234, D:0, E:0, F:0}
 064  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:106, B:-1, C:16777236, D:0, E:0, F:0}
 076  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:139, B:-1, C:16777301, D:0, E:0, F:0}
 088  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:362, B:-1, C:16777360, D:0, E:0, F:0}
 100  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:364, B:-1, C:16777361, D:0, E:0, F:0}
 112  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:174, B:-1, C:16777216, D:0, E:0, F:0}
 124  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:11, B:-1, C:48, D:0, E:0, F:0}
 136  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:2, B:-1, C:49, D:0, E:0, F:0}
 148  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:3, B:-1, C:50, D:0, E:0, F:0}
 160  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:4, B:-1, C:51, D:0, E:0, F:0}
 172  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:5, B:-1, C:52, D:0, E:0, F:0}
 184  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:6, B:-1, C:53, D:0, E:0, F:0}
 196  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:7, B:-1, C:54, D:0, E:0, F:0}
 208  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:8, B:-1, C:55, D:0, E:0, F:0}
 220  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:9, B:-1, C:56, D:0, E:0, F:0}
 232  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:10, B:-1, C:57, D:0, E:0, F:0}
 244  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:52, B:-1, C:46, D:0, E:0, F:0}
 256  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:28, B:-1, C:16777221, D:0, E:0, F:0}
 268  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:402, B:-1, C:16777496, D:0, E:0, F:0}
 280  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:403, B:-1, C:16777497, D:0, E:0, F:0}
 292  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:405, B:-1, C:16842751, D:0, E:0, F:0}
 304  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:171, B:-1, C:16777481, D:0, E:0, F:0}
 316  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:358, B:-1, C:16777481, D:0, E:0, F:0}
 328  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:356, B:-1, C:16777216, D:0, E:0, F:0}
 340  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:115, B:-1, C:16777330, D:0, E:0, F:0}
 352  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:114, B:-1, C:16777328, D:0, E:0, F:0}
 364  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:113, B:-1, C:16777329, D:0, E:0, F:0}
 376  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:200, B:-1, C:16777344, D:0, E:0, F:0}
 388  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:166, B:-1, C:16777345, D:0, E:0, F:0}
 400  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:201, B:-1, C:16777349, D:0, E:0, F:0}
 412  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:163, B:-1, C:16777347, D:0, E:0, F:0}
 424  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:165, B:-1, C:16777346, D:0, E:0, F:0}
 436  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:167, B:-1, C:16777348, D:0, E:0, F:0}
 448  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:168, B:-1, C:16777413, D:0, E:0, F:0}
 460  struct { A int16; B int16; C int32; D int8; E int8; F int16 }{A:208, B:-1, C:16777474, D:0, E:0, F:0}
 472  EOF
Code:
package main

import (
	"encoding/binary"
	"fmt"
	"io"
	"os"
)

func main() {
	f, err := os.Open("/home/patrick/src/qrc/test/17623/keys/avrcp.qmap")
	if err != nil {
		panic(err)
	}
	defer f.Close()

	var hdr struct {
		Magic int32
		H2    int32
		H3    int32
		H4    int32
	}
	if off, err := f.Seek(0, io.SeekCurrent); err != nil {
		panic(err)
	} else {
		fmt.Printf("% 04d  ", off)
	}
	if err := binary.Read(f, binary.BigEndian, &hdr); err != nil {
		panic(err)
	}
	fmt.Printf("%#v\n", hdr)

	for {
		var it struct {
			A int16
			B int16
			C int32
			D int8
			E int8
			F int16
		}
		if off, err := f.Seek(0, io.SeekCurrent); err != nil {
			panic(err)
		} else {
			fmt.Printf("% 04d  ", off)
		}
		if err := binary.Read(f, binary.BigEndian, &it); err == io.EOF {
			fmt.Printf("EOF\n")
			break
		} else if err != nil {
			panic(err)
		}
		fmt.Printf("%#v\n", it)
	}
}


Edit 6: It appears that field C is a Qt::Key.

Last edited by geek1011; 06-17-2021 at 01:07 PM.
geek1011 is offline   Reply With Quote