I'm in the process of reverse engineering the Creative Soundblaster G3 (Bluetooth controlled USB DAC) to have more/better control of the volume & EQ as well as external integration into apps. I've narrowed down and been able to replicate the Bluetooth data and use it with hcitool and Android Bluetooth libraries, no problems.
However, I've never been able to figure out how to specific an exact volume - I've only been issuing known values. Take the following examples, the bold bytes are the ones that change for different volume values:
- 5a230500000EB00 = 25%
- 5a230500000F500 = 50%
- 5a2305000000000 = 100%
I've tried to look at the official Android app's code (SBCommand) but there's a lot of obscurification still so I've not managed to figure it out. All I've picked out is key points like the seekbar element is a 0-100 scale and there's some conversion functions used for turning the progress value to dB and vice versa. There's no simple gattCharacteristic.writeValue(VOLUME_BYTE_ARRAY)
like I was expecting; it's quite a detailed, complicated app due to the amount of Creative devices it supports.
Has anyone had similar experience and could either point me in the right direction or is able to understand how the hex translates to those values? I apologise if this is a vague question, I'm only a novice coder and have recently come back to it after several years away from any code!
Thanks in advance.
I speculate that the volume is expressed in dB. F5-EB=0A, which is equivalent to 10 in decimal. A 10dB gain typically corresponds to a doubling of the volume. E100 might represent 12.5% volume.