**** BEGIN LOGGING AT Sun Nov 27 02:59:59 2016 Nov 27 11:13:45 hi, all. Is there an open-source way of using the ADC as a microphone device? Nov 27 11:13:52 maybe even using the PRU? Nov 27 11:14:18 I see the ADC band width is 20 mega samples Nov 27 11:25:38 I don't know if there is an open-source way, but i think that for such a project you should use the PRU or an external ADC hardware with buffering Nov 27 15:09:36 hello i just created a sudo account and im trying to log back in as root but i dont remember setting a root password and im getting authentification failure Nov 27 15:10:10 is there any way around this to log back in as root or reset the password from su account Nov 27 18:05:50 ars23: the ADC supports DMA, so no need for PRU to look after it Nov 27 18:06:19 it would probably give crappy audio though Nov 27 18:07:47 yes, but it will still be at OS disposal. and that's a problem if is not used an realtime os Nov 27 18:08:05 if that were a problem then no audio of any kind would work Nov 27 18:10:28 all that's needed is a sufficiently large buffer to avoid overflowing it when the is a bit sluggish to deal with it Nov 27 18:10:33 *the OS Nov 27 18:12:55 if a linux distro is used and we talk about an userspace application, is not enough with a large buffer. a char driver instead, with a large buffer, should be enough... correct me if i'm wrong... Nov 27 18:13:15 I never said userspace Nov 27 18:13:38 then I agree with you Nov 27 18:13:39 :) Nov 27 18:14:00 though more because setting up DMA from userspace is rather tricky Nov 27 18:14:37 agree with you! Nov 27 18:14:38 not impossible though, I actually use it for the ADC, but simply to a static ring buffer from which I can then read the latest measurements whenever I want (i.e. I'm not streaming the data) Nov 27 18:16:04 I think streaming would be perfectly possible though, especially on an RT kernel though I don't think that's even strictly needed (but it'll help) Nov 27 18:16:45 if userspace can't keep up, then what are you going to do with the audio stream anyway? Nov 27 18:18:10 and again, if userspace would be unable to keep up then audio simply wouldn't work, since even with a kernel driver the data is still produced or consumed by a userspace process Nov 27 19:42:03 hi, all. Is there an open-source way of using the ADC as a microphone sound device? Nov 27 19:43:23 the ADC supports DMA Nov 27 19:44:25 if you want it to show up as a real audio device you'd need to make an alternative driver for it to glue it to ALSA Nov 27 19:45:07 using the PRU, yes, so this will give a high sample rate, still I need a sound device Nov 27 19:45:09 I wouldn't expect the ADC to be audio-quality exactly though Nov 27 19:45:14 I see no need for PRU Nov 27 19:45:23 no use for it even Nov 27 19:45:47 ok, but the ADC can get upto 18Khz Nov 27 19:46:02 it can get up to 2 MHz iirc Nov 27 19:46:12 but it has low resolution, and is noisy Nov 27 19:46:27 but maybe filtering will help Nov 27 19:46:45 just make it a character device Nov 27 19:46:49 quick and simple Nov 27 19:47:03 ALSA has a lot of "audio" eccentricities Nov 27 19:47:07 voice is in the 2K any way Nov 27 19:47:25 yeah I wouldn't feel a strong urge to make an alsa driver either Nov 27 19:47:28 biggest problem with the ADC is noise Nov 27 19:48:19 but I have a cpu to filter the noise - no? Nov 27 19:48:25 DMA isn't strictly needed Nov 27 19:48:27 any idea what the spectrum of the noise is, especially when sampled at high rates? Nov 27 19:48:47 not strictly, but the adc fifo isn't large Nov 27 19:49:04 zmatt: didn't think there was a pattern... the lower 3-4 bits are garbage Nov 27 19:49:15 the fifo is more then sufficient for PIO Nov 27 19:49:16 citylight2: if the noise lies mostly outside the band of interest Nov 27 19:49:28 ds2: that's not the same as spectral information :) Nov 27 19:49:53 the exact nature of the noise will determine whether or not you can filter it out Nov 27 19:49:54 zmatt; correct... the FT's I ran on it didn't show much info... maybe it was aliased in... I wanted 8K samples Nov 27 19:49:59 8KHz samples Nov 27 19:50:12 it was rather broadband Nov 27 19:50:59 an external AGC really helped Nov 27 19:52:30 if it's white noise with a certain magnitude/sample that doesn't depend on sample rate then you can just oversample 16x and filter to gain 4 extra bits of resolution Nov 27 19:52:34 well, I plan to use an adruino microphone kit, I hope it has AGC Nov 27 19:52:53 I did that already Nov 27 19:53:09 (filter using a real filter, not the crap one built into the adc) Nov 27 19:53:37 the ADC is just an averaging one... you suggesting soemthing steeper? Nov 27 19:54:19 simple averaging is a pretty abysmal low-pass filter Nov 27 19:55:47 citylight2: btw do make sure you have an analog low-pass filter to avoid aliasing Nov 27 19:56:18 ok, but I guess I still need to write a sound driver Nov 27 19:56:32 no, just stream the ADC to a character device Nov 27 19:56:40 it is pretty brain dead simple Nov 27 19:56:57 for non DMA - configure ADC settings in init. Nov 27 19:57:09 I'd take ds2's suggestion of making it a simple char device, and if you absolutely need a sound device then just use an alsa loopback device and pipe your char device output into that Nov 27 19:57:11 request interrupts; on interrupt read it into a local buffer Nov 27 19:57:24 on device read, send out buffer Nov 27 19:57:34 but I would still want to use it with a VoIP later so I will it to be ALSA Nov 27 19:57:35 ds2: sounds like you already have one though, perhaps open source it? Nov 27 19:57:52 thnaks zmatt Nov 27 19:58:19 thanks ds2 Nov 27 19:58:26 zmatt: it is for 3.2 and interwoven with the tsadc stuff as an experiment (read - it take the tsadc stuff for a ride but does not care if it breaks tsadc) Nov 27 19:58:30 dma would be better for higher sample rates, which may be useful for better noise filtering (and to reduce the demands on the analog anti-aliasing filter) Nov 27 19:58:39 ds2: heh ok Nov 27 19:58:39 zmatt: so... would like to clean it up? :D Nov 27 19:58:44 lemme think Nov 27 19:58:45 no Nov 27 19:58:51 :D Nov 27 19:59:01 but yes, I do have one and it is working fine with pocketsphinx Nov 27 19:59:10 next I wish I could use the PWM as aplayback device Nov 27 19:59:23 hehe... also have PWM as an alsa output device too :D Nov 27 19:59:33 along with a working TTS Nov 27 19:59:38 can you share the code? Nov 27 20:00:27 citylight2: it is for 3.2 and interwoven with a first attempt at putting the ADC stuff in that I gave up on Nov 27 20:00:32 ds2, which hardware do you use for the mic? Nov 27 20:00:45 if you think that garbled mess is useable... we can talk Nov 27 20:01:01 originally - it was a condenser mic with a single transistor amp Nov 27 20:01:28 replacing the transistor with an AGC chip improved it a lot Nov 27 20:02:05 10x Nov 27 20:02:10 citylight2: it is probally quicker for you to get the pwm driver working yourself - Nov 27 20:02:27 take the x86 one, and replace the in/out's with calls to the PWM api Nov 27 20:02:42 the 3.2 stuff had an early API that didn't make it upstream Nov 27 20:02:55 another idea would be to do sigma-delta encoding in software and just send that to some synchronous serial port (e.g. McASP) Nov 27 20:03:05 dunno how cpu intensive that is Nov 27 20:03:26 zmatt: that assumes you have the McASP pins free Nov 27 20:03:35 one yes Nov 27 20:03:41 oh and you want to use the ehpwm stuff Nov 27 20:04:31 another path is to take the result of an old GSoC project that took the same x86 driver and patched it into the classic Beagle's PWM Nov 27 20:06:21 hmm, my intuition actually says that sigma-delta encoding shouldn't take that much cpu time, and it wouldn't require any kernel code Nov 27 20:08:17 zmatt: or just go OMAP4. I think it has HW for that Nov 27 20:09:30 afaik you're right, but needless to say this info is not particularly helpful :P Nov 27 20:10:55 I wonder if it would be easier to have the M3 do it Nov 27 20:11:03 should be slow enough the M3 can keep up Nov 27 20:12:01 possible? maybe. easier? definitely not Nov 27 20:12:33 why would it not be easier? Nov 27 20:14:04 it adds an extra link to the chain, no dma available Nov 27 20:14:12 also it has access to almost no peripherals Nov 27 20:14:15 very little ram Nov 27 20:14:45 and a miniscule fraction of the cpu power the a8 has Nov 27 20:19:40 bit bang Nov 27 20:19:52 M3's are reasonably powerful Nov 27 20:20:16 been playing with the M0's lately and a lot can be squeezed in Nov 27 20:21:50 like I said, it's possible. but if you want to bitbang it then PRU is a far more suitable choice Nov 27 20:23:00 computing it in blocks and shipping those by dma to a synchronous serial port to have it bitbang for you is however still much simpler, since most of the code already exists and all you need is a bit of userspace code **** ENDING LOGGING AT Mon Nov 28 03:00:00 2016