Microphone Bias Voltage Level

380 views
Skip to first unread message

Tristan Phillips

unread,
Jun 3, 2014, 12:14:27 PM6/3/14
to beagl...@googlegroups.com

Hi,

I'm wondering how I can set the mic bias voltage level on the Audio Cape, it is currently off and I cannot get my mic to work.  Can I do this via alsa or something similar?

Thank you,

Tris

Maxim Podbereznyy

unread,
Jun 3, 2014, 12:48:15 PM6/3/14
to beagleboard
Hi!

diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 7ad7b37..e196aa5 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -117,15 +117,13 @@ static const struct snd_soc_dapm_route audio_map[] = {
 	{"Line Out", NULL, "RLOUT"},
 
 	/* Mic connected to (MIC3L | MIC3R) */
-	{"MIC3L", NULL, "Mic Bias 2V"},
-	{"MIC3R", NULL, "Mic Bias 2V"},
-	{"Mic Bias 2V", NULL, "Mic Jack"},
+	{"LINE2L", NULL, "Mic Bias 2.5V"},
+	{"LINE2R", NULL, "Mic Bias 2.5V"},
+	{"Mic Bias 2.5V", NULL, "Mic Jack"},
 
 	/* Line In connected to (LINE1L | LINE2L), (LINE1R | LINE2R) */
 	{"LINE1L", NULL, "Line In"},
-	{"LINE2L", NULL, "Line In"},
 	{"LINE1R", NULL, "Line In"},
-	{"LINE2R", NULL, "Line In"},
 };



--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Tristan Phillips

unread,
Jun 3, 2014, 12:51:15 PM6/3/14
to beagl...@googlegroups.com
Thank you, does that mean I need a device tree overlay that tells the driver I'm using a mic as well as line in?

Will I need to recompile the kernel to apply this patch?

Maxim Podbereznyy

unread,
Jun 3, 2014, 12:58:20 PM6/3/14
to beagleboard
I think you just need to recompile the kernel with the code provided. Then you use alsamixer to tell which device captures sounds

Tristan Phillips

unread,
Jun 4, 2014, 1:04:10 PM6/4/14
to beagl...@googlegroups.com
Is there a dummies guide to replacing a kernel on a BBB built with a flasher with a new one?

Maxim Podbereznyy

unread,
Jun 4, 2014, 2:18:58 PM6/4/14
to beagleboard

sns

unread,
Feb 20, 2015, 12:11:02 AM2/20/15
to beagl...@googlegroups.com
Did it work? Can you please say the procedure? I am working on a project that has a similar requirement.

John Syne

unread,
Feb 20, 2015, 12:27:59 AM2/20/15
to beagl...@googlegroups.com
On Feb 19, 2015, at 9:11 PM, sns <sv.z...@gmail.com> wrote:

Did it work? Can you please say the procedure? I am working on a project that has a similar requirement.
The mic bias voltage on the TLV320AIC3104 isn’t connected on the audio cape so you will need external circuitry to use a mic.

Regards,
John

On Tuesday, June 3, 2014 at 9:44:27 PM UTC+5:30, Tristan Phillips wrote:

Hi,

I'm wondering how I can set the mic bias voltage level on the Audio Cape, it is currently off and I cannot get my mic to work.  Can I do this via alsa or something similar?

Thank you,

Tris

sns

unread,
Feb 20, 2015, 1:21:09 AM2/20/15
to beagl...@googlegroups.com

If i use usb audio interface instead of the cape, is there a need for biasing ?

Fredrik Olofsson

unread,
Feb 24, 2015, 9:52:17 AM2/24/15
to beagl...@googlegroups.com
all the usb soundcards i've tried so far can don't need biasing.  just solder an electret mic directly to a minijack and connect it to the input of the usb soundcard.  though note that sound quality varies.  some cards make a lot of noise (one logilink model even was blinking a led when active and that interfered and could be heard in the mic input signal.)
terratec aureon dual usb is the best sounding card i've found so far.  though i don't own an audio cape so i can't compare.

Zainab S.V

unread,
Feb 26, 2015, 4:23:20 AM2/26/15
to beagl...@googlegroups.com
What about using microphone input from a headphone for recording and using the headset for playback? Does it need any extra circuitry?

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/qBpwQ0UZcIM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

Zainab S.V

unread,
Mar 11, 2015, 12:49:16 AM3/11/15
to beagl...@googlegroups.com
Will USB headset with mic work for audio application that records sound and playback on beaglebone with quality?Here is there is no need for separate pre- amplifier or circuit that requires biasing mic voltage?

keerthana....@gmail.com

unread,
Jul 14, 2016, 6:33:44 PM7/14/16
to BeagleBoard

Hi there, 

I'm looking to use an electret microphone with a beaglebone black for my project. Can't I directly plug the mic into an analog pin and use the data?
Do I need a pre amplifier circuit kind of thing to use the mic with a BBB?

John Syne

unread,
Jul 14, 2016, 10:16:50 PM7/14/16
to beagl...@googlegroups.com
You would be better off using an audio codec for this purpose. Unfortunately, the Audio Cape doesn’t bring out the microphone circuitry, but you could use a audio preamp and connect to the audio cape audio input. 

Regards,
John




You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/a441645a-2159-4a64-8be5-5ebab130f289%40googlegroups.com.

TJF

unread,
Jul 15, 2016, 10:42:53 AM7/15/16
to BeagleBoard, keerthana....@gmail.com
Hi!


Am Freitag, 15. Juli 2016 00:33:44 UTC+2 schrieb keerthana....@gmail.com:
I'm looking to use an electret microphone with a beaglebone black for my project. Can't I directly plug the mic into an analog pin and use the data?
Do I need a pre amplifier circuit kind of thing to use the mic with a BBB?

The AIN pins range is 0 to 1V8. You'd need an amplifier to shift the mic voltage (by 0V9) and limit the output (to 0V9). But no need for any codec nor Audio Cape. For high speed ADC (>4kS/s) use libpruio.

BR

John Syne

unread,
Jul 15, 2016, 12:05:40 PM7/15/16
to beagl...@googlegroups.com, keerthana....@gmail.com
@TJF,

You do realize that audio is more than just an ADC. Think equalization, dynamic range, etc. Also, you need streaming and that requires a lot more code on the ARM side which isn’t necessary when you use a CODEC and the ALSA framework. 

Regards,
John




--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.

John Syne

unread,
Jul 15, 2016, 1:10:55 PM7/15/16
to Beagle Board, keerthana manivannan
OK, so without using PRU you would read from /dev/iio:device0, but the sampling rate isn’t going to be fast enough for you. You can increase the sampling rate by modifying the ADC dts parameters which you will find in the ADC overlay.

sudo sh -c "echo ‘BB-ADC' > /sys/devices/platform/bone_capemgr/slots"
Problem is as you increase the sampling rate, the CPU utilization increases because the driver uses interrupts for each scan cycle. 

Currently the ADC driver is configured for 16x oversample, Open Delay = 152 cycles and Sample Delay = 1 cycles.


 time in us for processing a single channel, calculated as follows:

 num cycles = open delay + (sample delay + conv time) * averaging

 num cycles: 152 + (1 + 13) * 16 = 376

 clock frequency: 24MHz / 8 = 3MHz
 clock period: 1 / 3MHz = 333ns

 processing time: 376 * 333ns = 125us

Regards,
John




On Jul 15, 2016, at 9:31 AM, keerthana manivannan <keerthana....@gmail.com> wrote:

oh. I'm like completely new to this but curious to learn:

1. I have an electret mic (this one ) which I'm trying to get signals from using a beaglebone black. So if I level shift the analog signal outputs from the mic and read it from ADC pins like sys/devices/platform/omap/tsc/ain1 (or whatever pin), what will that result in?

Thanks for responding so quickly. I really really really really appreciate you taking time to help.


John Syne

unread,
Jul 15, 2016, 5:00:33 PM7/15/16
to Beagle Board, keerthana manivannan
Please ensure your replies include beagleboad group e-mail list. 

The standard ADC driver is based on IIO framework and does not use the PRU, hence you will find the driver under /drivers/iio/adc/ti_am335x_adc.c. 

The libpruio was developed by jeli.f...@gmail.com and you should ask him about his library. He has excellent documentation here:


The library is based on UIO and the following documentation will help you understand the concepts:


Regards,
John




On Jul 15, 2016, at 11:16 AM, keerthana manivannan <keerthana....@gmail.com> wrote:

oh ok. so that's where PRUs come into picture here. That's why you wrote the libpruio. ok ok. cool. AWESOME.

ybea...@rehut.com

unread,
Jul 18, 2016, 3:32:22 PM7/18/16
to beagl...@googlegroups.com, John Syne
From a pin allocation prospectively, allocating the right McASP pins may
introduce other problems (pin sharing, etc). The ADCs have dedicated analog
pins to avoid this.

For basic ("telephony quality") audio, the ADCs are quite work able. Things
you need to consider are -
- Signal conditioning (converting the mV range into a signal that fits
0-1.8V). Biasing is pretty easy - a cap and a resistor should work with many
mics.
- Noise filtering.
- Software
- The reference on the BBB is hard wired to 1.8V.

I have gone down this path and have it working with PocketSphinx. Highlights
of the journey -
- Opamps or single transistor AMPs do work but there is a lot of tuning needed
keep a usable signal from the ADC. over a range of distances to the mic
without having to do a lot of shouting or dealing with clipping.
- Using a single chip AGC/mic preamp does make things a lot easier to tune.
- The ADC is quite noisy.
- The output sample rate is 8KHz. There are different settings that can give
you 8KHz on the ADC but they have different noise characteristic. The settings
will have to be tuned to match the signal conditioning circuit.
- Data output via a simple character driver. Original plan was to get this
into ALSA but haven't found time for that yet. IIO is nice but that requires
some kind of userland decoding for pocketsphinx. The character driver outputs
match the 'file' input format for pocketsphinx.


On Thursday, July 14, 2016 19:16:30 John Syne wrote:
> You would be better off using an audio codec for this purpose.
> Unfortunately, the Audio Cape doesn’t bring out the microphone circuitry,
> but you could use a audio preamp and connect to the audio cape audio input.
>
> Regards,
> John
>
> > On Jul 14, 2016, at 3:26 PM, keerthana....@gmail.com wrote:
> >
> >
> > Hi there,
> >
> > I'm looking to use an electret microphone with a beaglebone black for my
> > project. Can't I directly plug the mic into an analog pin and use the
> > data? Do I need a pre amplifier circuit kind of thing to use the mic with
> > a BBB?
> >
> >
> > On Tuesday, March 10, 2015 at 11:49:16 PM UTC-5, sns wrote:
> > Will USB headset with mic work for audio application that records sound
> > and playback on beaglebone with quality?Here is there is no need for
> > separate pre- amplifier or circuit that requires biasing mic voltage?
> >
> > On Thu, Feb 26, 2015 at 2:53 PM, Zainab S.V <sv.z...@gmail.com
> > <javascript:>> wrote: What about using microphone input from a headphone
> > for recording and using the headset for playback? Does it need any extra
> > circuitry?
> >
> > On Tue, Feb 24, 2015 at 8:22 PM, Fredrik Olofsson <red...@gmail.com
> > <javascript:>> wrote: all the usb soundcards i've tried so far can don't
> > need biasing. just solder an electret mic directly to a minijack and
> > connect it to the input of the usb soundcard. though note that sound
> > quality varies. some cards make a lot of noise (one logilink model even
> > was blinking a led when active and that interfered and could be heard in
> > the mic input signal.) terratec aureon dual usb is the best sounding card
> > i've found so far. though i don't own an audio cape so i can't compare.
> >
> > If i use usb audio interface instead of the cape, is there a need for
> > biasing ?

--
Hunyue Yau
http://www.hy-research.com/
Reply all
Reply to author
Forward
0 new messages