where and how to get analog input volume data for level meter display ( 8 analog inputs,I2S 24bits format)

All the latest news and announcements from XCore and XMOS.
susanyin0501
Active Member
Posts: 41
Joined: Thu Apr 20, 2017 9:00 am

where and how to get analog input volume data for level meter display ( 8 analog inputs,I2S 24bits format)

Postby susanyin0501 » Mon May 22, 2017 9:14 am

Hi all,
we are preparing for analog inputs voulme level meter display on panel, i tried to read out ADC convert result from deliver( ) in audio.xc
but g_in_0 didn't change almost even inputing analog voice signal (from Micphone, we can record and playback voice with Audacity tool )
where and how to get analog input volume data ? Thanks!

[code][/#pragma loop unroll
/* First time around we get channel 7 of TDM8 */
for(int i = 0; i < I2S_CHANS_ADC; i+=I2S_CHANS_PER_FRAME)
{
// p_i2s_adc[index++] :> sample;
// Manual IN instruction since compiler generates an extra setc per IN (bug #15256)
unsigned sample;
unsigned sample_0;
asm volatile("in %0, res[%1]" : "=r"(sample) : "r"(p_i2s_adc[index++]));

/* Note the use of readBuffNo changes based on frameCount */
if (i ==0){
sample_0 = sample & 0x7fffffff;
sample_0 = sample_0 >> 7;
SET_SHARED_GLOBAL( g_in_0, sample_0);
// vu_calc_in_0(sample_0);
}

if(buffIndex)
samplesIn_1[((frameCount-2)&(I2S_CHANS_PER_FRAME-1))+i] = bitrev(sample); // channels 0, 2, 4.. on each line.
else
samplesIn_0[((frameCount-2)&(I2S_CHANS_PER_FRAME-1))+i] = bitrev(sample);
}code]
User avatar
xsamc
Active Member
Posts: 55
Joined: Fri Mar 04, 2011 3:38 pm

Postby xsamc » Tue May 23, 2017 11:50 am

Hi there,

The code you have added in yellow occurs before the bitrev is performed, are you sure 'sample' is in form you're expecting?
Cheers,
Sam
susanyin0501
Active Member
Posts: 41
Joined: Thu Apr 20, 2017 9:00 am

Postby susanyin0501 » Thu Jul 06, 2017 3:51 am

i'm not sure, i don't know where should i get them?

Who is online

Users browsing this forum: No registered users and 9 guests