Recording is noisy - i.MX6dl with wm8960 codec

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Recording is noisy - i.MX6dl with wm8960 codec

Jump to solution
6,554 Views
kishan
Contributor II

HI,

We are using wm8960 codec in our custom board with i.MX6DL in solo mode. When I record from command line using alsa_arecord, the quality is fine. But when I use android voice recording for recording, the recorded file contains too much noise. This app generates a .3gpp file. I tested with another recording app that saves recorded sound in WAV format, it was fine with no noise.

The same behaviour is observed on i.MX6DL sabresd board.

Does anyone know what the problem is? Is there a patch or something for this?

Thanks

Labels (2)
Tags (2)
1 Solution
4,723 Views
juangutierrez
NXP Employee
NXP Employee

Hi

I received feedback from the R&D guys. They said we can modify this file:  hardware/imx/alsa/config_wm8962.h,

within your myandroid directory for changing the default volume values.

You can give a louder value to speaker volume like 110 or 120 instead of the  default 96. Also you can modify the capture volume too.

/* These are values that never change */

static struct route_setting defaults_wm8962[] = {

    /* general */

    {

        .ctl_name = MIXER_WM8962_DIGITAL_PLAYBACK_VOLUME,

        .intval = 96,

    },

    {

        .ctl_name = NULL,

    },

};

static struct route_setting bt_output_wm8962[] = {

    {

        .ctl_name = NULL,

    },

};

static struct route_setting speaker_output_wm8962[] = {

    {

        .ctl_name = MIXER_WM8962_SPEAKER_SWITCH,

        .intval = 1,

    },

    {

        .ctl_name = MIXER_WM8962_SPEAKER_VOLUME,

        .intval = 121,

    },

    {

        .ctl_name = NULL,

    },

};

View solution in original post

0 Kudos
Reply
17 Replies
4,723 Views
jizaoxiang
Contributor I

Hi,

I am working with wm8960 codec on the platform of imx6。

Now using the command "tinyplay", i can playback the voice。

But “tinycap”  does not work。

Can you give me some help? Maybe give me your imx-wm8960.c file, so i can reference。

My email is jizaoxiang@163.com

Best wishes!

0 Kudos
Reply
4,723 Views
gavinbao
Contributor I

I have the same question.can you exchange experience about wm8960.the record reg init can tell me .

0 Kudos
Reply
4,723 Views
jizaoxiang
Contributor I

I have the same problem with you。

Can you give me some help? My email is jizaoxiang@163.com

Thanks so much!

0 Kudos
Reply
4,723 Views
juangutierrez
NXP Employee
NXP Employee

I have been trying to reproduce the issue. But Im not able to get the iMx6DL SabreSD board workig in solo mode :smileysad:

What did you change to run in solo mode?

Also Im not able to see the alsa_arecord function, where did you get it?

0 Kudos
Reply
4,723 Views
kishan
Contributor II

Hi Juan,

All you have to do is apply the solo patch to sabre sd's boot loader.  I think you can find the patch on freescale's product page for i.MX6DL/SOLO. Thats all we did as I remember.

You will have alsa_arecord as a part of android. You wont have to do anything explicitely. If you are running linux, then you may have to build and deploy alsa_utils package.

Regards,

Kishan

0 Kudos
Reply
4,723 Views
juangutierrez
NXP Employee
NXP Employee

Thanks

Which android release are you using for sabresd?

Are you booting from SD or eMMC?

I'm still not able to boot in solo mode. Not sure what I'm missing :( Would you share your uboot.bin file for sabresd, please?

0 Kudos
Reply
4,723 Views
kishan
Contributor II

Hi,

We are using R13.41.

I am booting from SD card.

Actually, we had taken sabre sd's bootloader and modified it for our need. We had altered mux settings and other things including DDR configuration in the boot loader. So, I don't think our bootloader is going to be of any help to you.

In DL mode also you can observe the noise. Actually I am using sabre sd in DL mode only.

By the way, did you try applying the solo patches?

Thanks

0 Kudos
Reply
4,723 Views
juangutierrez
NXP Employee
NXP Employee

Thanks Kishan

I see, I thought the issue was only in solo mode even in the SabreSD board.

I think I already tried with SabreSD DL (regular mode) and not heard the noise, but I will double-check. I guess I used JB release instead of r13.41. I will try this release too.

Any special steps to reproduce the noisy recording or just record?

0 Kudos
Reply
4,723 Views
kishan
Contributor II

I tried recording using default android app for recording "Voice Recorder". And I observed constant background noise.

I have not tried recording from command line using arecord. That is fine on our board which uses wm8960.

0 Kudos
Reply
4,723 Views
juangutierrez
NXP Employee
NXP Employee

I'm only see an application called "Sound Recorder" and not able to reproduce the issue yet.

Are we talking about the same app? Or where did you get this "Voice Recorder" app

0 Kudos
Reply
4,723 Views
kishan
Contributor II

I think its the same app.

How are you recording? Using headphone right? As I know, sabresd does not have an on board mic.

0 Kudos
Reply
4,723 Views
juangutierrez
NXP Employee
NXP Employee

Hi,

Yes, I'm using the SabreSD DL. I'm using a headset (mic + headphones).

I'm recording with Sound Recorder and then playing back with Music App.

Can you share your SoundRecorder.apk file so I can try it at my side?

0 Kudos
Reply
4,723 Views
juangutierrez
NXP Employee
NXP Employee

Hum, I see the problem is with the speakers right?

The audio in headphones are just fine.

Ok I will investigate the problem

0 Kudos
Reply
4,723 Views
kishan
Contributor II

Actually I was recording using headset with mic only. For me it was noisy when I played it back. I am using the apk that comes with android. Its the default app. (I am sorry I could not attach it, I found control for that on this editor.) I will check it once again and let you know.

0 Kudos
Reply
4,723 Views
kishan
Contributor II

Hey, now I tried with a different headset, and the noise was considerably less. But recording volume was very less. I could hear the recorded sound only on headphone. On speakers it was not audible at all. In codec I have set capture volumes to max.

0 Kudos
Reply
4,724 Views
juangutierrez
NXP Employee
NXP Employee

Hi

I received feedback from the R&D guys. They said we can modify this file:  hardware/imx/alsa/config_wm8962.h,

within your myandroid directory for changing the default volume values.

You can give a louder value to speaker volume like 110 or 120 instead of the  default 96. Also you can modify the capture volume too.

/* These are values that never change */

static struct route_setting defaults_wm8962[] = {

    /* general */

    {

        .ctl_name = MIXER_WM8962_DIGITAL_PLAYBACK_VOLUME,

        .intval = 96,

    },

    {

        .ctl_name = NULL,

    },

};

static struct route_setting bt_output_wm8962[] = {

    {

        .ctl_name = NULL,

    },

};

static struct route_setting speaker_output_wm8962[] = {

    {

        .ctl_name = MIXER_WM8962_SPEAKER_SWITCH,

        .intval = 1,

    },

    {

        .ctl_name = MIXER_WM8962_SPEAKER_VOLUME,

        .intval = 121,

    },

    {

        .ctl_name = NULL,

    },

};

0 Kudos
Reply
4,723 Views
juangutierrez
NXP Employee
NXP Employee

Yes, I can see audio output in speakers is very low

I change it the audio volume to a louder value using amixer

#Digital Playback Volume (max 127)

alsa_amixer cset numid=18 120,120

I also noticed the capture volume is at maximum which can lead to saturation or capture environment noise

# Digital Capture Volume (max 127)

alsa_amixer cset numid=8 110,110

However i noticed that the Playback volume is kept all the way after you set it with amixer.

However the Capture Volume is changed  by the SoudRecored app each time the record button is pressed. so I needed to change the capture volume on the fly (after the recording was started)

I will try to check if there is a way to configure this values other that write directly using the amixer controls.

0 Kudos
Reply