This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Audio problems with DM365 internal codec.

Dear all, I'd like to use DM365 internal codec.

I've compiled my kernel with these options:

#
# Sound
#
CONFIG_SOUND=y

#
# Advanced Linux Sound Architecture
#
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_SEQUENCER=y
CONFIG_SND_SEQ_DUMMY=y
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_DYNAMIC_MINORS=y
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
# CONFIG_SND_VERBOSE_PRINTK is not set
# CONFIG_SND_DEBUG is not set

#
# Generic devices
#
CONFIG_SND_DUMMY=y
# CONFIG_SND_VIRMIDI is not set
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set

#
# ALSA ARM devices
#

#
# System on Chip audio support
#
CONFIG_SND_SOC=y

#
# SoC Audio support for SuperH
#

#
# ALSA SoC audio for Freescale SOCs
#

#
# ALSA SoC audio for DaVinci SOCs
#
CONFIG_SND_DAVINCI_SOC=y
CONFIG_SND_DAVINCI_SOC_I2S=y
CONFIG_SND_DAVINCI_SOC_I2S_VCIF=y
CONFIG_SND_DM365_SOC_EVM=y
CONFIG_SND_DM365_INTERNAL_CODEC=y
# CONFIG_SND_DM365_EXTERNAL_CODEC is not set
CONFIG_SND_SOC_CQ0093VC=y

#
# Open Sound System
#
CONFIG_SOUND_PRIME=y
CONFIG_OSS_OBSOLETE_DRIVER=y
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
# CONFIG_SOUND_TVMIXER is not set

When I try to acquire audio, I open the sound device with:

Sound_Input soundInput = Sound_Input_MIC;
sAttrs.soundStd = Sound_Std_ALSA;
sAttrs.sampleRate = 8000;
sAttrs.mode = Sound_Mode_INPUT;
sAttrs.soundInput = soundInput;
hSound = Sound_create(&sAttrs);

Then, in a loop, I read from the device with:

if (Sound_read(hSound, hInBuf) < 0) {
            ERR("Failed to read speech buffer\n");
            goto cleanup;
        }

Where hInBuf is a buffer long 160 bytes.

If I save the buffers in a file, what I have is a completely distorted signal, that *repeats* itself all along the file (I didn't calculate the period, but it repeats itself ~ every 4.6 seconds @ 8000Hz - I have saved the signal for you to look at, if it's usefule).

It's like what I'm reading has nothing to do with the real microphone input, but the driver gives me the same memory contente ever and ever.

Moreover, if I open alsamixer, I have the Master, Synth, Line, CD and Mic options in the Capture section, but even if can select them, I can't change their volumes, which is always 0 (maybe I'm not compiling the kernel correctly?)

Thank you,

Cristiano.