Wireless Instrument System

Status
Not open for further replies.

Chuckkh

Member
Hello! I'm checking out Teensy for this project. Systems can be found for about 100 Euros. They use adaptive fsk, 24 bit audio at 48k samples/second, but if I make my own I'm willing, and obligated, to accept 16 bits at 44k1 samples/s. I was planning to use an Arduino, but the consensus seems to be most of them just can't handle it.

I only need mono line in, by the way, and from looking at the Teensy audio board schematics, I believe I'd only need to solder 14 out of the SGTL5000's 32 pins, i.e., no headphones, no audio out, no memory. It just needs to read in 44k1 samples a second and pass them to a radio device. If I only do this for 1 channel, about how likely is a Teensy 3.2 to keep up with both the ADC and a 2.4 ghz transceiver? Should I just fork out the dough for a pro system with a warranty and preamp (and higher fidelity)? BTW, the plan is to receive with a Raspberry Pi 3 to add effects before the amp. On that end I could use headphones, dac, etc. I think I can make the Teensy audio library work on RPi easily, no? I in fact already grabbed a 24 bit adc and a 24 bit dac, but with minimal usage info, and finally, I need to leave myself time to practice, too (this is for an electric banjo, incidentally). So I guess my main question is still whether Teensy 3.2 will keep up writing from the CD-quality mono adc to a 2.4 GHz transceiver.
Thanks for reading!

Chuckk
 
thats an ambitious project .... One thing about the rpi 3 ... the audio output on that thing is like the audio output on the rpi2, I think .... pretty terrible (although there is hdmi out ...), you would want a usb dac or something otherwise you are wasting the 'CD quality' fro the teensy transmitter... And I don't see how the teensy audio library would run on the rpi (is that what you are asking??) .... different processors etc . there is a thing called the hifi berry which is linux based audio board for rpi....

On the teensy side you will need a preamp, of course ... linking a radio to the digital output of the audio shield library has probably been done ... it sounds like quite a project, very cool.

The teensy 3.2 will keep pace alright by my back of the matchbook calculation .... putting it all together .... that's a different story..

You do know you can buy audio adapter boards from pjrc already made up??
 
Last edited:
44Ksps and using 2.4GHz.. A cheap Nordic won't be fast enough, nor 802.15.4 a la XBee.
Need BLE or WiFi.
 
Good point ... it is 44.1 kilosamples per second, at 16 bit per sample, .... that changes the radio bandwidth 'equation'.... what is BLE ....? Bluetooth?? is a HC-05 module fast enough??? lets say 3 bytes per sample as a conservative estimate ..... that is 132kBs or somewhere arount 1Mbps?? Can buetooth ala HC 05 do that ... the teensy 3.2 can do that on its serial output I understand.... What about the cheap wifi modules that people talk about ...ESP8266??

But what is the latency??? you hit a chord on your banjo and then 15milliseconds later the signal arrives at the amp ... 15milliseconds is close to unusable for many people. 4milliseconds is the upper bound really, for most people.

What is the latency?
 
BLE is the latest revision of Bluetooth. These versions all use frequency hopping where the two paired units have to keep in stepping sync. I doubt you'll have excessive latency if 50mSec is OK as an average.
The average data rate, net of all overhead (and most all wireless is high overhead), is probably < 1Mbps. 44Ksps without compression like run-length-encoding or delta-sigma, and with 16 bit (2 byte) samples, packed into one frame, etc, will work, I'd think. BLE's range and tolerance of non-line-of-sight (human body block at 10m) can be challenging if you hit those conditions.

IEEE 802.15.4 is net about 30Kbps. The air link bit rate is 250Kbps.

WiFi is high overhead but brute force high bit rates. Much higher battery power consumption.

Beware the wireless vendors' marketing: They promote the raw air link bit rate which excludes the high overhead.

I'd try bluetooth serial protocol profile radios for a start.

There's also the issue of multiple pairs in RF proximity... will work though speed may reduce due to air time sharing. Bluetooth can help as it is freq. hopping. But it can be unpredictable.

So overkill the excess capacity in wireless to get the worst case latency you need for a performing artist who can't have glitches.
 
are you saying 50microseconds or 50milliseconds latency ... I take it that a hc-05 will not cut it ... the serial protocol looks good, and yes maybe squeeze into two bytes but I was thinking 'over-capacity' as a virtue. Nothing could be worse thanlatency AND failing to keep up.
 
50millisec.
I write uSec for microseconds

HC-05. I've not used it. But most such bluetooth serial things aren't used at more than 9600 to 115200 baud. The air link burst bit rate may be 1Mbps, but that's irrelevant due to things that cause overhead, such as

  • Freq. hopping: radio is "off" until freq. change completes. I'd guess the change takes on the order of a millisecond - phase locked loop oscillator lock time.
  • Coding (FEC), meaning that for error detection and/or correction, not all bits transmitted are your data; the coding "rate" in any modern digital wireless system is the ratio of data to non-data bits. It is often 50%, to include header bits for addressing, link management, etc. The Xbee (802.15.4) has a burst raw bit rate of 250Kbps but yields about 30Kbps sustained due to overhead. For 802.15.4 and 802.11, these are not freq. hopping, but rather than are CSMA/CA (listen for a clear channel before transmitting). This listen time slows throughput some.
  • Retransmissions for error correction. Errors due to interference or weak signal
  • Competition for air time: unlicensed band you either do CSMA/CA (as above) or freq. hop and hope for rare collisions with other pairs/networks.

It may be that some Bluetooth serial radios are better than others in terms of sustained net yield.
And some, I read, can't run their simple UART interface at high baud rates due to too-cheap.

So I'd say bluetooth can work if you understand the above and choose radios wisely and have lots and lots of excess data rate to accomodate the overhead and still get you the latency worst-case that you want.

High quality wireless Audio is an FM analog thing unless a special digital system on a dedicated band is used, as in wireless mics used in stage performances.
 
Last edited:
@stevech got you. 50millisecs is of no use. I can personally live with 10 - 20 ms ...maybe more, but 50ms is out of the question.

Senheisser make some nice systems, and there are some dedicated guitar systems (which are not for the 'purist':rolleyes:), and really, in the final analysis, it sounds quite tricky to DIY, in that its on the margin of 'simple' tech. Thankyou for your time.

BT serial is certainly my tech level (FM radio ... what is that???) , and getting 800kbps *sustained* out of one of those radios (even if their serial interface is quick enough) sounds 'marginal' ... so regardless of the ability of the teensy to pump out 1Mbps into one of them, it sounds a bit tricky to pull off end to end.

I buy American made conquest cables myself..... oh yeah.

I'm guessing ethernet is just incredibly laggy..
 
Thanks for the replies. I was really wondering, though, whether a Teensy 3.2 could handle copying that amount of data from one serial device to another.
As for the radios, I was planning to ask about that in other places, although it seems I've found something made just for this that 1. isn't expensive, 2. isn't terribly complicated to put in a circuit, and 3. can run *without* a MCU: TI's CC8520 http://www.ti.com/product/CC8520 - It can run headless, with only the ADC (which I have), the CC8520 and the external components in the package. I will want to see about having the option of taking the receiver straight to an external DAC or putting it through the RPi.
I don't believe 20 ms latency is too much, though much more would probably not work. I play bluegrass banjo, and we get pretty fast. Also, I know that pjrc sells audio adapter boards, but don't overestimate the economy of Romania. Shipping would undoubtedly add 200% to the cost. If I'm only using one mono ADC on one board, it seems worth it to buy the chip and make my own board; on the other end, with the RPi, I'd consider buying the audio board if it plays nicely with RPi.
 
teensy 3.2 can do 1Mbps + on a serial line, so no worries there ... For me 20ms is absolutely tops latency wise ... I too play fast music and can't cope with more than 20ms, and less is better ...realtime audio through an rpi is going to be a challenge I suspect .... I'm interested in a radio product that has enough throughput to deal with cd quality mono audio ...what kind of interface does it have? Do you need the teensy / audio adapter to feed digital data to it?? I will have a look at the specs .... thankyou.

Edit ... that part looks interesting, but quite difficult to use ....On the upside it is i2c, so there should be a way to feed it data from the teensy ... however, I think its latency is around 512 samples, or 11ms *best case* .... by the time you add in conversion latency, I would think that rpi would be completely out of the question ....

I suppose the pjrc audio board could be made to work with an rpi, but you would need to write your own driver, I suspect ....
 
Last edited:
Thanks for the thoughts there. You have given me reason to reconsider the TI wireless audio system. I did find something else that might be interesting:
http://www.semiconductorstore.com/cart/pc/viewPrd.asp?idproduct=50595#Features
It claims to have 3 ms latency, so who knows?
But it's mystifying. I just read that some commercial wireless instrument systems were tested to be faster than cables. I might just give up. Too many children in my life (1) to start developing my own electronics!
I have decided, after lots and lots and lots of research, to get a Teensy audio board anyway; there is a driver in the typical Raspbian kernel for the SGTL5000. I was very, very close to building an mbed Audio Codec board from their published schematics and PCB layout, until I saw that they simply have board power routed directly to both analog and digital VCC, with nothing at all separating them. One's gotta watch out. And I found several European distributors carrying the Teensy audio adapter.

I'll post again if I get anywhere with this...
 
that simblee looks really interesting 3ms end to end latency it says !! and a 1 mbps uart interface, spi , 400k i2c interface ... anyway...its not cheap!! but then again... looks pretty amazing.

As for a wireless sytem being faster than a cable .... Hmmm that is just plain weird
 
I had a thought about using a teensy and a teensy audio adapter with the excellent audio library PaulStofreggen has written.

I think that the audio library has a fixed latency of 2.9ms, so if you were using teensys with audio libraries on both ends you would have *at least* 5.8 ms latency right there .... So you really do need a 3ms latency end to end for the radio link..... 10ms latency is bearable, but not ideal....

Might be wrong about the fixed latency but might be worth thinking about ....

The latest and greatest wireless system (using a nordic radio) boasts sub 2.3ms latency end to end for the whole system *including conversion* etc) .....See here. Still slower than a cable, I would have thought!!

As i said, for the rpi you are going to get much worse latency figures for sure.
 
I had a thought about using a teensy and a teensy audio adapter with the excellent audio library PaulStofreggen has written.

I think that the audio library has a fixed latency of 2.9ms, so if you were using teensys with audio libraries on both ends you would have *at least* 5.8 ms latency right there .... So you really do need a 3ms latency end to end for the radio link..... 10ms latency is bearable, but not ideal....

Still, that would be some bang for the buck. Alllllmost under $100. There are some systems available for about that, and they have the advantage of some kind of warranty.

The latest and greatest wireless system (using a nordic radio) boasts sub 2.3ms latency end to end for the whole system *including conversion* etc) .....See here. Still slower than a cable, I would have thought!!

As i said, for the rpi you are going to get much worse latency figures for sure.

That's amazing. I feel a little better, actually, foregoing a wireless system, seeing their criticism of all of the other existing systems. Rather than make me want to buy, they've made me reprioritize!
I have used Linux for many years. I used to use a RT kernel, but I haven't bothered in quite some time. They claimed this offered lower latency than Mac or Windows (not exactly stiff competition, of course, but for running Csound it used to be OK). I have seen that there are a plethora of other OSs available for Raspberry Pi. For my other project - a wired MIDI banjo - I opted to buy a RPi for more program space and faster GPIO switching than what I had before (albeit I never had a Teensy). Maybe it's possible to scrape Linux off of the thing and run something barer?

-Chuckk
 
Wireless for audio at any real performance level would seem to be quite tricky for your 'average' diy er. A midi banjo sounds interesting ... you might be surprised at how competent the teensy is in the midi department ....
 
Status
Not open for further replies.
Back
Top