-
Notifications
You must be signed in to change notification settings - Fork 6
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
How is the audio hardware set up exactly? #3
Comments
I'm at office, don't have a picture with me right now, but I've added a diagram in readme to show what I've done. The GND wire just connects to the nearby via. To connect the microphone, connect mbed codec GND, MIC BIAS, MIC IN to the microphone circuit's AGND, MIC BIAS, MIC IN respectively. |
Thanks for the explanation. The sentence "Wires were soldered from the 2 MIC and GND pins of the IC to the unused side of the header." is too ambiguous for me to understand. It sounds like I have to solder the ICs multiple GND pins to a header, but using the "hole" besides the "IN" connector is far easier. |
Thanks for the feedback. That's what happens when I don't proofread. :-) You could try this connection: Play around with the max gain (by shorting Gain to either Vdd or GND) if it's too loud. |
No problem :) Ah ok, I bought it because you listed it here and I didn't want to experiment with hardware I have no clue about. Do you mean "NC" by "float" ? |
Yes, float is NC. Yes, Vdd ---> mbed codec 3V3 is correct. The MIC BIAS is for driving the mic directly. Here you have the MAX9814 supplying its own mic bias, and yes, there's no need to bring the MIC BIAS out from the mbed codec chip. As for the capacitor, 100uF should work just fine. The MAX9814 output is DC biased, so we use the capacitor to filter out the DC component. |
ok, but I can't get it to work at all. A arecord -L outputs:
So the codec seems to be connected to the Pi. A sudo i2cdetect outputs a "UU" at addresses 1b and 3b. It seems that this stands for "reserved" or something? So I tried: The resulting "my_record.wav" contains no sound though. I tested the MIC on an oscilloscope, it produces output although I had to connect it to 5V on the PI because the 3V3 on the mbed codec didn't suffice. So I got no idea what else to test, this audio part is driving me crazy... What I don't understand is that even if the microphone wouldn't work or wouldn't even be connected, it still should record some static noise, right? I tested playback on the mbed codec and I could hear some static noise, but that's due to the fact that I haven't shortened the connector-cables yet. I want to get it to work first, then assemble it and cut the cable lengths accordingly once everything is in place. By the way: are you sure that CS hast to be connected to the PIs 3V3 instead of connecting 3V3 to 3V3, same for MODE connecting to GND instead of connecting GND to GND!? Could you maybe provide an image of a working RaspBian instance to double check whether it's hardware related or software related? |
Sorry, I just realized that I've left out the mbed 3V3 and GND connection in the readme. You'll have to connect the 3V3 from Pi to mbed CS and 3V3, GND from Pi to mbed MODE and GND. That may be the cause of your audio problem. For testing, there's a plot_wave python script in tests directory. You can try using that to plot the wav file that you've captured and see what values you're getting. |
I added the 3V3 and GND connections and I transfered the recordings to a PC to listen to them but there's nothing in those recordings, they just don't contain any sound. Anyways, even after adding the two connections it still isn't working. Could you maybe post your kernel.img, or better yet, your boot folder here? I just had the bright idea to scope the I2S lines. Turns out that there's nothing coming in at the PIs DIN (P5-05). So the mbed codec doesn't send any data, which in turn produces no output in the WAV file. So the question is, why is there no data being sent. |
It sounds like your mbed codec chip is not even running. Did you remove the crystal on the mbed codec? If you remove it, you're going to need to feed the GPCLK0 into the mbed codec's MCLK pin. Btw, there's no need to remove the crystal. Here's a working kernel and drivers. It assumes the Pi's GPCLK0 is fed into the mbed's MCLK pin (pin 25 on the codec chip). |
I removed the crystal and followed your "main" guide (https://github.com/jasaw/bbPiCam/blob/master/README.md) for setting up the software and hardware. Even with the kernel and drivers you sent me I didn't get it to work. I ordered another codec to make sure it isn't defective. I think it's running though, because I can find it via aplay -l and arecord -l. Oh and I also bought this (http://au.rs-online.com/web/p/condenser-microphone-components/8837917/), in case I can't get the mbed codec to work. I have no idea yet of how I would implement the software part of this, but the hardware part seems perfect. |
It's odd that you're not getting any signal out of the codec. I don't know what else to try. You're in luck, there's already a driver for the MEMS microphone. |
I will report back when I get the new hardware. I have seen that driver, but it hasn't found its way into the raspbian repository so I think I am out of luck here. |
I am still waiting for the hardware, because this time I wanted to let someone else handle the soldering - just in case. |
I received the new mbed codec and I am actually able to record from the microphone now. However, there is a lot of static noise making this not feasable as an audio source. I tried connecting the mic via capacitor and without capacitor, and with and without resistor (all combinations)... I even held its contact pin directly on the pin of the mbed codec... didn't make a difference, it sounds like there's wind blowing into the microphone all the time. |
Which mic are you using? Are you using the mic with automatic gain control (MAX9814)? If you are, try limiting the max gain. Also check the actual samples you're recording. I plotted the samples using the plot_wave python script which is quite helpful for debugging. |
I am using the MAX9814 one, yes. I tried to limit the gain but it didn't help. |
I would like to see some detailed pictures of how your mbec codec looks like with those wires soldered to it as well as how the microphone circuit is connected.
The text was updated successfully, but these errors were encountered: