8 ms·
Show HN: TCP over sound on Android
- deleted 10y ago[deleted]
- theprotocol 10y agoI don't have much to say other than I love the concept of doing something like this.
- advisedwang 10y agoBrings home just how easy it can be to break out of an air-gapped computer.
- CompuHacker 10y agoVacuum-gapped computers, anyone?
- GroSacASacs 10y agoWhat range of wawes can a typical microphone record ?
- brian-armstrong 10y agoIt really depends. On average 100 Hz - 20 kHz isn't uncommon. Some only go down as far as 16kHz though.
- esaym 10y agoOne needs to also take into account what the microphone is plugged into. For instance, you could use this to transmit data over a walkie talkie, but they are choked at around 6khz
- deleted 10y ago[deleted]
- thirdreplicator 10y agoHow about TCP over light?
- j4_james 10y agoActually p2p file transfer via an infrared port[1] was a fairly common feature on laptops back in the day (this was probably before bluetooth took off). If you're on Windows, have a look in the "Network and Internet" section of the Control Panel. You may still have an Infrared utility there if your computer has that functionality. [1] https://msdn.microsoft.com/en-us/library/aa940293(v=winembedded.5).aspx https://msdn.microsoft.com/en-us/library/aa940293(v=winembed...
- pacaro 10y agoIR was also used for syncing with phones, and printing. Some PDAs (I'm looking at you psion) could print over IR
- mSparks 10y agoBack in the day. i used an Orange contract nokia 8310 ir modem and the free phone 0800 number that came with BT internet to give my laptop intenet. Lasted around 6 months of near 24/7 use before Orange started detecting data and charging contract customers to call 0800 numbers.
- tonyedgecombe 10y agoI seem to remember the protocol was IrDA, it never worked very well for me.
- krallja 10y agoMost of it is, yeah? Fiber-optic cables transmit via laser beams.
- kalleboo 10y agoData transfer over QR codes http://stephendnicholas.com/posts/quicker-video-qr-codes http://stephendnicholas.com/posts/quicker-video-qr-codes
- joshumax 10y agoFor anyone interested, there is an app called Chirp by Animal systems that attempted to make data transfer over audio a relevant form of communication. It actually works quite well to push links from my computer to my phone on Airplane mode with the help of a custom python script.
- moreati 10y agoFurther offtopic: Chirps include reed-solomon error correction. I'm seeking assistance with reverse engineering it https://math.stackexchange.com/questions/663643/discover-parameters-of-a-reed-solomon-code-from-its-output https://math.stackexchange.com/questions/663643/discover-par...
- brian-armstrong 10y agoIf there's anything that Chirp does that you feel is missing from Quiet, please let me know. I'd love to expand the feature set and make it more useful.
- john_reel 10y agoDo you think that you could share the script?
- joshumax 10y agoSure, the base is just https://github.com/joextodd/chirp.io/blob/master/chirp.py https://github.com/joextodd/chirp.io/blob/master/chirp.py, nothing too fancy...
- steventhedev 10y agoSeems like this would benefit from not using standard TCP (which assumes that a dropped packet is always due to congestion), and maybe use one of the WiFi retransmission protocols (the names are slipping my mind at the moment). Might increase that bandwidth from 7kbps to something more comfortable.
- brian-armstrong 10y agoMaybe - in my experience with this, when the devices are within a foot or so, there really isn't much packet loss, maybe as low as 10^-6 or so. But I haven't really explored moving further apart. I suspect that this suffers from a sharp knee where it starts out reliable and then very quickly fades off. To be clear, the 7kbps is the raw frame throughput, not the effective rate with TCP. There are two ways I can see to boost this number. One would be to pack more bits into each symbol, e.g. to use a wider QAM mode. I find that in practice the degradation from using speaker/mic makes this somewhat impractical. The other would be to use a more broadband signal (the width of the the main audible channel is a few kHz). But this is also kind of undesirable since it has to compete with more interference across the spectrum and can also be a less pleasing sound.
- anindha 10y agoIs the packet loss the same when there is background noise?
- noselasd 10y agoPresumably the old V.42 protocol used for modems would be quite suitable for this - it does re-transmissions.
- zokier 10y agoWould it be feasible to implement this on a microcontroller, lets say medium sized Cortex-M or ESP8266? Would be useful in IoT, especially for initial setup phase.
- brian-armstrong 10y agoI haven't tested it on that particular hardware but I think it might be feasible. Some modem profiles are more computationally expensive than others, and receiving is more expensive than transmitting. At some point I'd like to try it on an RPi across a piezo and a cheap mic
- mschuster91 10y agoYou could try making a "real" C library (with proper Makefile etc) out of it and compile it on a Pi, with a pulseaudio (or ALSA) configured to do loopback (i.e. route the audio output to the line-in input).
- brian-armstrong 10y agoWay ahead of you ;) https://github.com/quiet/quiet-lwip https://github.com/quiet/quiet-lwip In fact, the Android library is just a wrapper on this, although a fairly non-trivial one. libquiet's tests actually run exactly as you describe on a loopback alsa device
- revelation 10y agoWhy would you add a reasonably expensive ADC+microphone if you can just use BLE that's likely to have some other useful purpose for your IoT device? Or, well, WLAN or 6LoWPAN, it is IoT after all.
- brian-armstrong 10y agoIn general, I think you are definitely right about this. Sound does have some potentially interesting applications. For example, if you had an exhibit that you wanted guests to interact with, that would probably eliminate many wireless choices. NFC would be a valid option, but not all phones support it, and you might need to make the user install an app. Quiet's sound transmission can work from the browser by using quiet.js. In general I think it's ever so slightly more versatile, or at least until browsers make it easier to access wireless options.
- emcrazyone 10y agosome home appliances use this technology. I have a refrigerator that can you hold your phone next too during a support call whereby the refrigerator emits some tones that the support person can receive presumably into some computer program designed to decipher the tones as some error or diagnostic codes. I'm old enough to know all about those old school modems. I think this is stuff is cool for those niche type applications.
- brian-armstrong 10y agoThat's a neat idea. You could imagine doing this in DTMF. The fridge could even place the call!
- ex3ndr 10y agoIn most modern networks like GSM DTMF are send via non-sound channel. Actually that was done because of famous Woz's blue box.
- kranner 10y agoIt is offered in some LG washing machines, to be paired with their iOS app. Unfortunately the last time I tried it, I could not make it work after 10 tries - 'too noisy' 'bring the phone closer to the speaker' etc. I don't live in a noisy neighbourhood either.
- milankragujevic 10y agoI have a small spy cam that I put on quadcopters. It has WiFi but it has no interface so to configure it you download a phone app and type in wifi credentials then it modules that into sound and plays the sound and the camera picks it up and configures itself and then you can watch the stream live over WiFi.
- cuu508 10y agoI did contracting work on an Android app which records diagnostic data from smoke alarms. You press a button on the alarm and it emits a high-pitched series of chirps. Phone records, decodes and displays stuff like battery level, time of last recorded alarm etc. The recording scheme was rather simple, only 10 or so bits per second, and used Manchester coding. Most problems I ran into were due to audio hardware differences on different Android phones. Some phones have multiple mics and there is no consistent way to specify which one to use (or, more precisely, to know the location of the mic used). One workaround for this was to record in stereo--phones would usually record the each mic to its own stereo channel. Then the app can look at both, and use the one with a better SNR. Some phones do proprietary audio filtering and noise reduction at hardware or driver level--you don't get access to the raw recorded audio data. On the upside, all phones these days are plenty fast to do CPU intensive audio processing.
- jewel 10y agoThis would be great for cross platform zero-config party games. A lot of game genres can get by with surprisingly little bandwidth. Although for a noisy environment like a party you may need to do a little mesh networking in order for everyone in a room to be able to participate.
- Jyaif 10y agoAFAIK, this is actually the only way to do Android <=> iOS multiplayer games without connectivity ( iOS restricted the usage of bluetooth too much ).
- droopybuns 10y agoMissed naming opportunity: AirgAPP
- ryanlm 10y agoInteresting use of the JNI. Why did you need to use JNI?
- brian-armstrong 10y agoWell, the JNI means you get to run native code. For something like this, I think that's actually a requisite. My reasoning would be a) This is real-time and could potentially be disrupted by GC pauses b) JNI means you get to use OpenSL, the best and lowest latency sound engine on Android c) This builds on top of libquiet, a C library, which itself builds on liquid dsp, another C library. Rewriting these in Java would be significantly more work than building the JNI wrapper. Especially true for liquid which is a mature library with lots of code
- kuschku 10y agoSo why not JNA then?
- mbrock 10y agoWhat modulation scheme does this use?
- brian-armstrong 10y agoThe main audible profile uses OFDM + QAM. It also has a GMSK profile. This is thanks to liquid dsp's myriad modulation choices. If you want to see quiet's configuration flexibility try this in Chrome https://quiet.github.io/quiet-profile-lab/ https://quiet.github.io/quiet-profile-lab/
- mbrock 10y agoCool, thanks. Years ago I was playing around to learn some DSP and made a simple modem for speakers and microphone to send text messages via sound. I used "continuous-phase frequency shift keying" on a couple of different frequency pairs, and the receiver used FFT for decoding... Never managed to get it working reliably above 300 bps. It would probably be much better to use the Goertzel algorithm tuned to the specific frequencies instead of using chunked FFT. I'm curious about why some modulation schemes are better than others in this situation, but it seems like a lot of tricky math and information theory is needed to get it. OK, some Wikipedia articles later: so OFDM basically means you send relatively long pulses of many parallel bit streams on many "orthogonally" spaced frequencies, each stream itself being modulated by some other scheme (in your case QAM, which uses four amplitude levels to encode two bits). The frequency spacing is chosen to avoid spectral interference, and the pulses are spaced to avoid temporal interference. With the relatively long pulse times and the many frequencies, FFT is probably the best method.
- amelius 10y agoDoes it also solve collision problems, when there is more than one transmitter?
- maxaf 10y agoData over sound is a common enough thing in the IoT space. For example: https://help.canary.is/hc/en-us/articles/204772717-Why-can-t-Canary-hear-my-device- https://help.canary.is/hc/en-us/articles/204772717-Why-can-t... (I work at Canary.)
- jrz53 10y agoIf I remember correctly, the DS game Bangai-O Spirits used sounds to share player-made levels between consoles.
- larvyde 10y agoCMIIW but didn't modems use to work like this? Like, put your phone receiver on top of the modem while it makes strange bleeping sounds?