-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
I2S Support #427
Comments
I've a test app that use I2S TX and RX in loopback using the ESP8266 SDK... |
I'd really love to have I2S from the ESP/Arduino code to play saved audio/sounds. Here's a naive attempt that makes some buzzes and whistles so shows it compiles and runs, if nothing else maybe it might prompt someone who knows what they're doing to write an example that works ... (I connect an 8ohm headphone directly to gpio3 (i2s output) and its quiet but easily audible. The mp3 demo says thats probably not advisable but it hasn't broken anything for me.) Also, sketch uploads fail while the headphone is connected to gpio3 so need to disconnected to upload.
|
http://www.esp8266.com/viewtopic.php?f=11&t=11790 Here is an example for playing WAV files via I2S interface. |
Arduino reference for the class is here. |
Is there an easy way to convert mono wav files to I2S format in run time? The referenced Arduino I2S lib can only play stereo files but most of the files I want to play are mono coded. |
Is there any way to play 20, 24, 32 bits audio? |
Any news on i2s audio input? |
I tried but it did not work.
從 Windows 10 的郵件傳送
寄件者: Piruzzolo
傳送時間: 2019年9月9日 下午 08:06
收件者: esp8266/Arduino
副本: tedhsieh1966; Comment
主旨: Re: [esp8266/Arduino] I2S Support (#427)
Any news on i2s audio input?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
…---
Avast 防毒軟體已檢查此封電子郵件的病毒。
https://www.avast.com/antivirus
|
Moving to 3.0. The pure Arduino I2S setup is immensely different than the current setup. The support for add'l bitrate/bps is not difficult, but the way that blocks are xfered to the app is quite different than the simple roud-robin async process we have now. |
Hi, Thanks! |
There is an i2sinput example in the repo already. Take a look at it. I've run out on an i2s microphone taken from the Google AIY cardboard box project, and it seemed to go just fine. |
Yes, but what about PDM microphone?
…On Wed, 6 Nov 2019 at 00:15, Earle F. Philhower, III < ***@***.***> wrote:
There is an i2sinput example in the repo already. Take a look at it. I've
run out on an i2s microphone taken from the Google AIY cardboard box
project, and it seemed to go just fine.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#427?email_source=notifications&email_token=ABSX7XIKX3Z6F5RDR6YY3JLQSHWBBA5CNFSM4BIKVJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDEQ2RQ#issuecomment-550047046>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSX7XJXWOBPXJKN7UABXGLQSHWBBANCNFSM4BIKVJAQ>
.
|
Ah, didn't see PDM. That's not I2S, that's pulse density modulation which is an analog (timing/duty cycle) based protocol as far as I understand it. I2S is not the right way to read them, but I suppose with a lot of post-processing you could do it by calculating bit-by-bit density and translating into a 0-N code. It would be horribly CPU inefficient, though. |
Yes, I know. It’s delta-sigma and it’s digital (there is 1 bit data). But
can I read it the same way via i2s input if I clock it out by i2s clock at
1.5mHz(or even 3mHz)? On esp32 there is a special mode for pdm signal, I
didn’t see the same for esp8266...
Thanks for your help
…On Wed, 6 Nov 2019 at 00:24, Earle F. Philhower, III < ***@***.***> wrote:
Ah, didn't see PDM. That's not I2S, that's pulse density modulation which
is an analog (timing/duty cycle) based protocol as far as I understand it.
I2S is *not* the right way to read them, but I suppose with *a lot* of
post-processing you could do it by calculating bit-by-bit density and
translating into a 0-N code. It would be horribly CPU inefficient, though.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#427?email_source=notifications&email_token=ABSX7XN4UL4AN2LD3ONYJDDQSHXBXA5CNFSM4BIKVJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDERTRA#issuecomment-550050244>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSX7XMUIQADQGTC5QKNN6DQSHXBXANCNFSM4BIKVJAQ>
.
|
Yes, you could supersample by setting as high a clock frequency as possible (remember the frequency will be 16-bits * the Fs) then use a popcount (I think there's a GCC internal, if not lots of algorithms are available on DSP processing sites). Filtering this will also be interesting as you will pick up harmonics due to the processing. There's no code or hardware in the 8266 or in my audio libraries to anything like this, though, you will be on your own. If you do get something working, feel free to make a PR for the core or examples. |
Yes, I tried to set i2s rate to 192000 and it gives me around 3MHz clock
output. Mic is working fine with that.
So if I use your example it will give me 16bit samples joined every cycle?
Or should I somehow get bit by bit from i2s?
I think I can write it to flash (maybe with lower clock first) then
download from flash and to test it with some PC player...
…On Wed, 6 Nov 2019 at 00:35, Earle F. Philhower, III < ***@***.***> wrote:
Yes, you could supersample by setting as high a clock frequency as
possible (remember the frequency will be 16-bits * the Fs) then use a
popcount (I think there's a GCC internal, if not lots of algorithms are
available on DSP processing sites). Filtering this will also be interesting
as you will pick up harmonics due to the processing.
There's no code in the 8266 or in my audio libraries to anything like
this, though, you will be on your own. If you do get something working,
feel free to make a PR for the core or examples.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#427?email_source=notifications&email_token=ABSX7XMWKUWOHO3LKHTOYHLQSHYK3A5CNFSM4BIKVJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDESRDY#issuecomment-550054031>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSX7XNGAZD3F65YT7AI43TQSHYK3ANCNFSM4BIKVJAQ>
.
|
No, it won't give you anything other than the binary waveform. No integer values. You need to find a way to postprocess the entire recording from a bitstream into ints of some precision. It's complicated to do properly. And slow since you're processing things bit-by-bit on a moving window. Real I2S microphones just return a nice stream of 16- or even 32-bit samples every clock period and "just work." No processing/etc, the ADC is done inside the mike and it returns the real PCM sample each period which you can use, plot, etc. |
I have sound processing expert nearby, but he’s not familiar with arduino
nor esp8266. Can you point me the way to get a raw pdm bitstream from my
mic? Which function to use to read the bitstream from i2s buffer?
…On Wed, 6 Nov 2019 at 01:03, Earle F. Philhower, III < ***@***.***> wrote:
No, it won't give you anything other than the binary waveform. No integer
values. You need to find a way to postprocess the entire recording from a
bitstream into ints of some precision. It's complicated to do properly. And
slow since you're processing things bit-by-bit on a moving window.
Real I2S microphones just return a nice stream of 16- or even 32-bit
samples every clock period and "just work." No processing/etc, the ADC is
done inside the mike and it returns the real PCM sample each period which
you can use, plot, etc.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#427?email_source=notifications&email_token=ABSX7XMGQU6TSVFQCOU5JU3QSH3TLA5CNFSM4BIKVJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDEUWQI#issuecomment-550062913>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSX7XL5R76GRL5EGOME2RDQSH3TLANCNFSM4BIKVJAQ>
.
|
@artua I suggest looking at the i2s input example. |
Thanks guys,
Seems it simpler for me to use true i2s mic now.
…On Wed, 6 Nov 2019 at 16:17, Develo ***@***.***> wrote:
@artua <https://github.com/artua> I suggest looking at the i2s input
example.
Also, use of PDM is off-topic for this issue. If you would like to
investigate it and contribute an implementation, please open a new issue,
and discussion can proceed there.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#427?email_source=notifications&email_token=ABSX7XLKD7JHPMDA7H3HR4DQSLGW3A5CNFSM4BIKVJA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDGVQ2I#issuecomment-550328425>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSX7XMVDZZFIIWP7Z5JWPTQSLGW3ANCNFSM4BIKVJAQ>
.
|
hi, should I post it here? |
Fixes esp8266#427 Adds a basic I2S class based off of the Arduino-SAMD core. The raw i2s_xxx functions are still a better way to use I2S due to their flexibility, but this will allow basic Arduino sketches to work.
Fixes #427 Adds a basic I2S class based off of the Arduino-SAMD core. The raw i2s_xxx functions are still a better way to use I2S due to their flexibility, but this will allow basic Arduino sketches to work.
Now, we know how work I2S on ESP8266
https://github.com/espressif/esp8266_mp3_decoder/blob/master/mp3/include/i2s_reg.h
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: