Skip to content
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

Microphone possibilities #2

Open
bacpac opened this issue Jul 15, 2024 · 7 comments
Open

Microphone possibilities #2

bacpac opened this issue Jul 15, 2024 · 7 comments

Comments

@bacpac
Copy link

bacpac commented Jul 15, 2024

Thanks a lot for making this public, it works like a charm :)

I was wondering if you know what the microphone possibilities of Dash are. I'm looking into if it should be possible to expose the microphone registered sounds from Dash somehow. I'm not sure if he only has a clap sensor with direction or if he physically should be able to pass on audio; the latter would be awesome and open up so much more possibilities.

After analysing the sound and connecting to a LLM, one or two custom sound slots could be used to upload response audio to.

It would probably be very slow, but nonetheless a widening of options.

@mewmix
Copy link
Owner

mewmix commented Jul 16, 2024

Hey thanks for the support! It really helps :)

To answer your question, this has been requested before in the reddit thread I released this software in, and frankly I wanted this as well. For a quick summary of the issue:

To record & set the sysvoice(found here) there are actually multiple async bt transactions that take place, most easily explored via turning on the hcibtsnoop log in Android (if using the Android Application) -) Unfortunately even with my logs I have been struggling to parse everything in a tidy manner. I've narrowed based on timestamps what transactions are what but my skills with wireshark have really fleeted.

TLDR: this is something I want for the very same reasons, just need to take some time to parse bluetooth packets. If you'd like to help I will attach what logs I've taken later tonight. :)

@mewmix mewmix pinned this issue Jul 16, 2024
@bacpac
Copy link
Author

bacpac commented Jul 17, 2024

Very interesting, thanks for sharing your experience / workflow. I don't have much experience on that level, but it sounds like a nice challenge for me to dive more into. If it's no problem, I'd be glad to take a look at those logs.

I'll also check if I can generate / view the logs of the app myself with my (non-rooted) Android device, to get a better grasp. In developer options I can see that I can enable the Bluetooth HCI snoop logs, so that sounds promising. I've mainly used tools like wireshark for in/outgoing traffic on my laptop, so it's time to go a bit further with that.

No idea if I can be of any help on this part soon, but I'm interested to play around with this.

@mewmix
Copy link
Owner

mewmix commented Jul 30, 2024

Sorry for the delay, broke my laptop X_X. Thanks for keeping an eye on our issues here.

Re: Bluetooth Logs~

I've had the best luck generating logs from Pixel devices, will be attaching the logs below as a silo for our development. Will update this message with better information soon.

Pixel Logs:

bluetooth_log.txt

If you use the timestamps from the above adb_logcat output you can sync them up to the bluetooth stack log below. You will need wireshark installed to inspect this file.
btsnoop_hci.log

OnePlus12:

This is the cleanest log file output (no packets tho) to get an idea for what the transactions we need to identify are; Here I did 2 samples of file transfer & selected sysvoice 1 & sysvoice 2
adb_logcat_grep_bt.log

@mewmix mewmix closed this as completed Jul 30, 2024
@mewmix
Copy link
Owner

mewmix commented Jul 30, 2024

Woops fat fingered this closed.

@mewmix mewmix reopened this Jul 30, 2024
@bacpac
Copy link
Author

bacpac commented Aug 13, 2024

Thanks for sharing the logs, I've been looking into it but could not find any leads yet on how to continue.

I've also been looking into other options to get logs, like with their browser app which also directly uses Bluetooth (Chrome only as it's made for Chromebook):
https://code.makewonder.com/landing/

Perhaps for some parts it might be easier to skip the Android device logs and tail them directly with Wireshark and Packetlogger based on the Chrome connection with Dash.

Another interesting thing is that the JS is easy to inspect on that site:
https://code.makewonder.com/blockly/js/blockly.js (can be mapped to source in the Chrome network tab for readability)

Entry point for upload of audio:

{
  key: "transferSound",
  value: function() {
      this.setState({
          transferStartTime: Date.now()
      }),
      this.props.robot.isSimulator ? (window.simhal.saveSoundRecording(this.state.soundIdx, this.resampledInt16Array),
      this.onRecordList()) : (RobotMgr.transferCustomSound(this.props.robot.id, this.float32Array, this.state.soundIdx, this.sampleCount, this.sampleRate, this.targetSampleRate),
      RobotMgr.setTransferStatusCallback(this.onTransferStatus))
  }

I believe this might make reverse engineering more easy of at least the audio upload functionality. Will get back with you when I find something of interest or if I got something working ( when my spare time allows it :) ).

@mewmix
Copy link
Owner

mewmix commented Aug 16, 2024

Yes this is a much better path. Thank you for sharing. I will investigate too some time very soon, excited to see what you and I find :)

@SimonCoulombe
Copy link

hey, I dont't have the skillset to help here, just wanted to say I'm following with interest :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants