UART for audio streaming (24bits/96Khz)

1,371 views
Skip to first unread message

manick

unread,
Jul 26, 2011, 8:59:03 AM7/26/11
to ioio-users
Hi,

Would it be possible to use UART part of the IOIO board to stream out
digital audio signals ?

Here is a small flow diagram of my idea,

Android phone -> google ioio -> DAC -> Stereo speakers


Specification of Audio Quality:

No:of bits per channel : 24 bits
Sampling Frequency : 96Khz
No: of channels: 2

So is it possible to have a baud rate per channel =
24 * 96000 = 230400 bits/s.

I would like to know the maximum baud rate that could be handled by
the UART ioio board. Where can i find more information/documents about
the limitations of the board?


Best Regards,
Manick.

Ytai Ben-Tsvi

unread,
Jul 26, 2011, 3:31:10 PM7/26/11
to ioio-...@googlegroups.com
On Tue, Jul 26, 2011 at 3:59 PM, manick <s.a.m...@gmail.com> wrote:
Hi,

Would it be possible to use UART part of the IOIO board to stream out
digital audio signals ?

Here is a small flow diagram of my idea,

Android phone -> google ioio -> DAC -> Stereo speakers


Specification of Audio Quality:

No:of bits per channel : 24 bits
Sampling Frequency : 96Khz
No: of channels: 2

So is it possible to have a baud rate per channel =
24 * 96000 = 230400 bits/s

I think you missed a zero :)
So we're talking around 4Mbit/sec for both channels, which is on the edge of what the USB channel can handle, and that is only if you use OpenAccessory mode, which is currently in Beta.
I'm also not sure about the UART maximum speed, but before I check:
What sort of D/A did you have in mind that can speak UART? It surely has to have a buffer - how much does it buffer? What is the flow-control algorithm? I'm not familiar with any module that works like that - is it a real module or just something you assumed would be available?
I think there are protocols that are much better designed for audio than UART (e.g. SPDIF). With some firmware coding, it is probably not too hard to implement one on the IOIO, but unless you use lower bitrate or some kind of compression, I doubt if the connection and the IOIO will be able to handle this throughput.


I would like to know the maximum baud rate that could be handled by
the UART ioio board. Where can i find more information/documents about
the limitations of the board?


Best Regards,
Manick.

--
You received this message because you are subscribed to the Google Groups "ioio-users" group.
To post to this group, send email to ioio-...@googlegroups.com.
To unsubscribe from this group, send email to ioio-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ioio-users?hl=en.


ZHANG Yan

unread,
Jul 26, 2011, 11:10:45 PM7/26/11
to ioio-...@googlegroups.com

Take a look at the specifications of the usb sound cards(very common stuff in the market). You might dig out some useful protocols.

Yan

Eric42

unread,
Jul 27, 2011, 6:55:01 AM7/27/11
to ioio-users
Can't you use some Audio decoder between the ioio and your DAC? like
this one: http://www.pjrc.com/store/sta013_sop28.html
It would dramatically reduce the bandwidth need between the phone and
the ioio.

Sample application here: http://www.pjrc.com/tech/mp3/sta013.html .

Eric

ManickaVasagam

unread,
Jul 27, 2011, 8:37:26 AM7/27/11
to ioio-...@googlegroups.com
Oh yeah! Thanks for noting the missing zero :)

DAC is something that i assumed which would be available.

Thanks for all your comments for my questions.

I have the following comments/remarks,

1. I would like to have a dynamic range of audio from 0 to 120dB. Hence the 24bits/96Khz.

2. I would like to change the audio on the fly as well. So would it be possible to compress the audio on the fly (encoding to MP3) and sending the data via USB and then decoding+DAC? I am not sure how much would be the delay be.

3. If i would like to implement SPDIF on google ioio, could you please guide me how to implement it?

4. There are some videos on youtube which streams even the video data over the USB and much more.
http://www.youtube.com/watch?v=CR0yRU8Vtr0

I guess the HD video data rate is higher than the high quality audio which i mentioned above.

May be i have made a dumb comparison, but i feel that high quality audio could be transferred from the android phone via USB. The biggest problem i face is how :).

Ytai Ben-Tsvi

unread,
Jul 27, 2011, 8:56:51 AM7/27/11
to ioio-...@googlegroups.com
DAC is something that i assumed which would be available.
I'm not sure whether a DAC that speaks UART is available... UART is not exactly a natural protocol for audio, as it is asynchronous. 

1. I would like to have a dynamic range of audio from 0 to 120dB. Hence the 24bits/96Khz.
96KHz seems a bit excessive, and I'll assume you know where to get content with this format... 

2. I would like to change the audio on the fly as well. So would it be possible to compress the audio on the fly (encoding to MP3) and sending the data via USB and then decoding+DAC? I am not sure how much would be the delay be.
I don't think the latency will necessarily be high, only that if you're using 96KHz and 24bit, you're probably expecting some extreme fidelity, which is not going to like MP3. Perhaps eAAC+ or some kind of a lossless compression (e.g. FLAC) will be a better choice. 

3. If i would like to implement SPDIF on google ioio, could you please guide me how to implement it?
First, IOIO is not a Google product. In its initial stages it was developed with some help from Google folks. It is also acknowledged by Google as one of the OpenAccessory-compatible boards. I'm wondering how you got this impression, so we can make sure others don't make this mistake.
Second, I can't guide you specifically on SPDIF nor on PIC-programming if you're completely entry level, but if you come up with concrete questions regarding how to compile and package the IOIO firmware, or on the code structure of the existing firmware, I will be more than happy to help.
 

4. There are some videos on youtube which streams even the video data over the USB and much more.
http://www.youtube.com/watch?v=CR0yRU8Vtr0

I guess the HD video data rate is higher than the high quality audio which i mentioned above.
May be i have made a dumb comparison, but i feel that high quality audio could be transferred from the android phone via USB. The biggest problem i face is how :).
Atrix supports high-speed USB (480Mb/s), which IOIO does not. IOIO works with full-speed (12Mb/s).

Guillem

unread,
Jul 27, 2011, 12:49:26 PM7/27/11
to ioio-...@googlegroups.com
That question is like the one I was thinking to do, the mp3 decoder chip is a good idea.

I was thinking maybe is better to send the data of the mp3 file direct to ioio board, which that the phone don't have to convert the data. Obviously the mp3 file have to be with the same parameters 24bits/96Khz but when you export the mp3 file since the computer to the Android can make the need transformation.

On the other hand if I can make some SPDIF PIC-programming the implementation can be better but more difficult. If someone else can make it maybe can do some work, I have notions with the family 18F and the C programming but not familiar with the 24f.

I thought the ioio was from google too. I saw some pictures with the name google on it or something like that..

Regards

    Guillem


--

Chris Stratton

unread,
Jul 27, 2011, 2:19:42 PM7/27/11
to ioio-...@googlegroups.com
On Wednesday, July 27, 2011 8:56:51 AM UTC-4, Ytai wrote:
DAC is something that i assumed which would be available.
I'm not sure whether a DAC that speaks UART is available... UART is not exactly a natural protocol for audio, as it is asynchronous. 

So, for that definition of asynchronous, is SPDIF.  In both cases, the clock is recovered from the data stream, rather than provided separately.  However, SPDIF depends on the clock embedded in the data stream being low jitter.  A hardware UART fed from a decent oscillator might actually achieve this, if it's never allowed to 'run dry' of data.  A software one, or one which must be fed over a shared bus, probably not without extremely careful design.

More complicated SPDIF receivers (something including non-trivial DSP) might end up re-timing the data and not simply recovering the output DAC clock from it.


1. I would like to have a dynamic range of audio from 0 to 120dB. Hence the 24bits/96Khz.
96KHz seems a bit excessive, and I'll assume you know where to get content with this format... 

It would take a truly expert circuit designer and a high quality clock to create a board producing 120 dB of dynamic range.   For that matter, just because a DAC accepts 24 bits doesn't mean it has that kind of truly linear dynamic range in practice.  The poster should spend some time staring at data sheets and figuring out the degree to which they can actually trust the DAC and downstream circuits and transducers, and then not bother feeding more than a little bit more data than is required to achieve that.

3. If i would like to implement SPDIF on google ioio, could you please guide me how to implement it?
First, IOIO is not a Google product. In its initial stages it was developed with some help from Google folks. It is also acknowledged by Google as one of the OpenAccessory-compatible boards. I'm wondering how you got this impression, so we can make sure others don't make this mistake.
Second, I can't guide you specifically on SPDIF nor on PIC-programming if you're completely entry level, but if you come up with concrete questions regarding how to compile and package the IOIO firmware, or on the code structure of the existing firmware, I will be more than happy to help.

Indeed, porting the IOIO concept to a moderately sophisticated system-on-a-chip with good audio IO and perhaps onboard decompression capability is likely the only realistic way to approach these rather extreme performance requirements.

Reply all
Reply to author
Forward
0 new messages