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.

Using the internal microphone (M1) and speaker (SPK1) on the DM365 EVM

Other Parts Discussed in Thread: TVP5146

I need to use the demos with the internal microphone (M1) and speaker (SPK1) on the DM365 EVM, instead of the MIC input and LINE_OUT output.

I couldn't find this subject in the documentation.

I'm using a DM365 on a DM36X EVM REV E by Spectrum Digital.

Thanks.

  • Hi!
    I need too.
    DVSDK 4_00_00_22 (Oct 2010) does not support the built-in processor voice-codec!
    This DVSDK has Arago Linux Kernel 2.6.32, which does not support the codec CQ93VC (dm365 built-in voice-codec).
    This codec was introduced in Linux 2.6.35 kernel.

     

    Related posts are

    http://e2e.ti.com/support/embedded/f/354/t/74345.aspx

    http://e2e.ti.com/support/embedded/f/354/p/56231/226155.aspx

     

     

  • And what about previous DVSDK versions?

    Are you saying that currently there isn't any support  for the built-in mic and speaker of the EVM?

    I really need it.

  • I am guided by the latest current release DVSDK, and I do not know how this is the case in previous releases.
    Believe me, I would also like you really need to work with this embedded voice codec ( which are connected to SPK1 and MIC1) and as soon as possible.
    I'm novice and I'm very difficult to do anything other than what is in the manual for DVSDK. But as the need is very urgent, I'll try to do something))))
    If I have anything should happen, I'll try to write about any progress, probably in to this topic.
    Good luck!

  • Hi, "E M"!
    There is good news.
    The speaker (SPK1) is working on my DM365 EVM board.
    I managed to do so to play audio files on this internal speaker SPK1.
    All this happened after modifying some files in the DVSDK 4 package.
    Now I write detailed instructions (step by step) on how to make such changes
    to be able to work with built-in processor codec.
    In the very near future, I will publish the recipe and give reference to you in this thread.

  • Thanks a lot!

    I'm waiting for the instructions.

  • So..
    I can record audio through the microphone(MIC1) using 'arecord' command. Also I can playback sound files through a speaker(SPK1) using 'aplay'.
    But I announce that the sound level is quite low, despite the fact that the settings are set to maximum levels.
    ENCODE and DECODE demos are work.

    I wrote a detailed instruction.
    There are a lot of text, but you can do all the work to modify files in less than 1 hour.
    Good luck.

    I would like to publish instructions on the wiki, but I can see that the login here and there not related. Because I'm starting to write pieces of text, right here.
    See below...

  • How do I change the DVSDK4 to DM365EVM board could operate with a built-in speaker (SPK1) and microphone(MIC1).

     

    A list of related topics:

    http://e2e.ti.com/support/embedded/f/354/t/74345.aspx

    http://e2e.ti.com/support/embedded/f/354/t/68773.aspx (DVSDK is not v4)

    http://e2e.ti.com/support/embedded/f/354/t/7617.aspx (DVSDK is not v4)

    http://e2e.ti.com/support/embedded/f/354/p/56231/226155.aspx (very useful!! Mentioned that DVSDK is v4)

    http://e2e.ti.com/support/embedded/f/354/p/83687/289523.aspx

     

    Attention! This article refers to the DVSDK version 4_00_00_22 (Oct 2010).

     

     

    DM365EVM has a speaker (SPK1) and microphone (MIC1). However, the latest (at time of this publication) release DVSDK 4_00_00_22 (Oct 2010) only works with an external codec AIC (external inputs and outputs such as Mic, LineOut etc). And inside the DM365 processor we can see builtin audio codec which are connected to SPK1 and MIC1 and we would like to use it. What to do?

     

    This article shows the steps of how to change something in DVSDK it to work with SPK1 and MIC1.

     

    The first, built-in codec must be supported by the Linux kernel.

    There are two projects of the Linux kernel for Davinci.

     

    Khilman (at this moment, it uses 2.6.37 kernel)

    You can see this via browser with this link.

    http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=summary

    Git access.

    http://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-davinci.git

     

    Arago (at this moment, it still uses 2.6.32 kernel)

    http-view

    http://arago-project.org/git/projects/linux-davinci.git?p=projects/linux-davinci.git;a=summary

    git-access

    http://arago-project.org/git/projects/linux-davinci.git

     

    Support for built-in dm365 voice codec appeared in the Khilman kernel since 2.6.35

    You can verify this.

    Goto http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=summary

    Select TAGS and then v2.6.34-davinci1

    Click on 'tree' (http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=tree;h=fa4a60b8ea7b73821f3bacc8cc8a663c2704b1ea;hb=33bd223cd8f649be74975f9abc52c84f7a2ee8ab

    )

    Go to 'drivers' catalog, then select 'mfd'.

    You can see some files, but 'davinci_voicecodec.c' does not exists.

    Go back to the home page and select next TAG v2.6.35-rc1

    Go to drivers/mfd via 'tree' and you can see that 'davinci_voicecodec.c' appears.

     

    Since DVSDK based on ARAGO kernel 2.6.32, it does not support the built-in dm365 voice codec.

    By the way, CQ93VC declared in ALSA 1.23, but the 2.6.32 kernel is ALSA 1.21.

     

    There are two ways to resolve the problem.

     

    The first, is to download the Khilman kernel (eg 2.6.36-davinci1). Configure it by selecting CQ93VC-codec instead of the AIC (running make menuconfig, selecting drivers, sound cards ..) and compile it in DVSDK4 (need to change Rules.make in DVSDK). And the system is started, the kernel initialization writes that used CQ93VC-codec and the sound system ALSA identified it as a sound card. But personally, I saw that this kernel is not quite compatible with DVSDK. I've had problems with the compilation of such things as CMEM, EDMA and other things needed for the demo applications included in the DVSDK.

     

    The second way, is to modify the kernel source ARAGO (2.6.32) that come with DVSDK4. It is necessary that it now supports CQ93VC. It is this version I chose. It seemed to me that this way is more compatible with the existing system in DVSDK.

     

    Let's begin our work!

  • Step 1: Preparation.

     

    Baseline data.

    The DM365EVM board (i have Rev.E) and DVSDK 4_00_00_22 (Oct 2010).

    Installs and configures the DVSDK4 as written in the instructions.

    Set the environment variable ${DVSDK}.

    Check it, by typing...

    host$ echo ${DVSDK}

    It should specify the catalog where the DVSDK is installed.

    Make sure that the string like 'export DVSDK=(path to DVSDK)' and path to CodeSourcery compiler is recorded in your '.bashrc' file in your home directory.

     

    Look at 'psp' catalog in ${DVSDK}. There is a source directory of the Linux kernel.

    It is called as 'linux-2.6.32-rc2-psp03.01.00.37'

    The contents of this catalog we will change.

    Therefore, make a backup of this catalog!

    Keep a copy in the same psp-catalog as 'ORIGINAL_linux-2.6.32-rc2-psp03.01.00.37', for example.

     

    Just in case, also made a copy of 'targetfs' because we are then in it also make a small change (You must be an root-user to make a copy of targetfs, because this catalog has 'root' as owner.)

     

     

    Goto 'linux-devkit' catalog (it appears after the startup 'setup.sh' script to run)

    host$ source environment-setup

    Make sure that the beginning of a prompt is [linux-devkit].

    Check 'EXEC_DIR=' entry (where to install output files) in 'Make.rules'.

    Better to change this entry to where the files are installed somewhere in known location in your home catalog. For example '/home/user/davinci/install'.

    Clear kernel.

    [linux-devkit]> make linux_clean

    Build kernel.

    [linux-devkit]> make linux

    Install kernel

    [linux-devkit]> make linux_install

    Copy 'uImage' from install catalog to 'tftpboot'. Change U-Boot environment for correct name of uImage. (You can rename image-file as 'uImage-aic' so in the future, you can quickly understand exactly what you want to use this kernel to work with AIC).

    First time, I recomended use 'tftpboot' and 'NFS' options for rapid tests.

    Reboot.

    See kernel log.

    ---

    ALSA device list:

    #0: DaVinci EVM (tlv320aic3x)

    ---

    Try examples (especially ./encode и ./decode which are located in /usr/share/ti/dvsdk-demos)

    We see that it works with an external AIC codec and audio is recorded and played back via external inputs/outputs (Line-In, Mic-In, Line-Out, Hp-Out). In general it should work.

     

    Go to the next step.

     

  • Step 2: Obtaining patches.

     

    We need to download 5 patches.

     

    Goto Khilman site http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=summary

    Select TAGS.

    Select v2.6.35-rc1

    Click 'tree'.

     

    Goto 'drivers/mfd'

    Click 'davinci_voicecodec.c'

    Click 'history' at top of page.

    Find record.

    2010-03-12 Miguel Aguilar MFD: DaVinci Voice Codec blob | commitdiff | diff to current

    Click 'commitdiff'. Click 'patch' at top of page.

    Save it as 'vc-1.patch'.

     

    Go back to root catalog, locate the file '/sound/soc/davinci/davinci-vcif.c'

    Click 'history'. Find record.

    2010-03-12 Miguel Aguilar ASoC: DaVinci: Voice Codec Interface blob | commitdiff | diff to current

    Click 'commitdiff'. Click 'patch' at top of page.

    Save it as 'vc-2.patch'.

     

    Next.

    '/sound/soc/codecs/cq93vc.c'.

    In a similar manner.

    2010-03-12 Miguel Aguilar ASoC: DaVinci: CQ93VC Voice Codec blob | commitdiff | diff to current

    Save patch as 'vc-3.patch'.

     

    From root catalog, go to 'arch/arm/mach-davinci/dm365.c'

    2010-02-04 Miguel Aguilar DaVinci: DM365: Voice codec support for the DM365 SoC blob | commitdiff | diff to current

    Save patch as 'vc-4.patch'

     

    'arch/arm/mach-davinci/board-dm365-evm.c'

    2010-03-12 Miguel Aguilar DaVinci: DM365: Voice Codec support for the DM365 EVM blob | commitdiff | diff to current

    Save patch as 'vc-5.patch'

     

    Copy all of these five files into '${DVSDK}/psp/linux-2.6.32-rc2-psp03.01.00.37'

     

    In the next steps we will need a GIT.

    Install 'git' on your host-computer.

     

    Go to the next step.

  • Step 3: Adding MFD-driver.

     

    [linux-devkit]> cd ${DVSDK}/psp/linux-2.6.32-rc2-psp03.01.00.37

    [linux-devkit]> git apply --check vc-1.patch

    error: patch failed: drivers/mfd/Kconfig:53

    error: drivers/mfd/Kconfig: patch does not apply

    error: patch failed: drivers/mfd/Makefile:12

    error: drivers/mfd/Makefile: patch does not apply

     

    [linux-devkit]> git apply -v --check vc-1.patch

    Will show the details.

     

    We will understand how to manually apply a first patch.

    Open the file 'vc-1.patch' and study it. This is a plain text file.

    It consists of four sections of the 'diff'. And then pointed out which files need to be modified.

    Plus sign shows that it is necessary to add, but minus sign is what you want to remove.

    It's simple.

     

    We make the change manually!

    Open the file 'drivers/mfd/Kconfig' in a text editor.

    Find the section "config MFD_DM355EVM_MSP"

    Before (!) of this section, using the technique of Ctrl-C (copy) and Ctrl-V (paste), copy some strings from patch to file.

     

    +config MFD_DAVINCI_VOICECODEC

    + tristate

    + select MFD_CORE

    +

     

    Remove the leading pluses (!!!) from each line.

    As a result, we must add the following text into 'drivers/mfd/Kconfig'.

     

    config MFD_ASIC3

    bool "Support for Compaq ASIC3"

    depends on GENERIC_HARDIRQS && GPIOLIB && ARM

    select MFD_CORE

    ---help---

    This driver supports the ASIC3 multifunction chip found on many

    PDAs (mainly iPAQ and HTC based ones)

     

    config MFD_DAVINCI_VOICECODEC

    tristate

    select MFD_CORE

     

    config MFD_DM355EVM_MSP

    bool "DaVinci DM355 EVM microcontroller"

     

     

    Save 'drivers/mfd/Kconfig' file.

     

    Now, from the file 'vc-1.patch', we need to erase the lines.

     

    diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig

    index 951fa9b..20e3229 100644

    --- a/drivers/mfd/Kconfig

    +++ b/drivers/mfd/Kconfig

    @@ -53,6 +53,10 @@ config MFD_SH_MOBILE_SDHI

    This driver supports the SDHI hardware block found in many

    SuperH Mobile SoCs.

    +config MFD_DAVINCI_VOICECODEC

    + tristate

    + select MFD_CORE

    +

    config MFD_DM355EVM_MSP

    bool "DaVinci DM355 EVM microcontroller"

    depends on I2C && MACH_DAVINCI_DM355_EVM

     

    That is to erase the entire first section of the 'diff' from the patch (from first 'diff' to the next, but keep the line with the second 'diff').

    After removal of the first section, save the file 'vc-1.patch'.

     

    So .. one section we have changed manually (I hope you do it carefully !!!!).

    We now verify the patch.

     

    [linux-devkit]> git apply --check vc-1.patch

    error: patch failed: drivers/mfd/Makefile:12

    error: drivers/mfd/Makefile: patch does not apply

     

    Better already!

     

    Again, open the file 'vc-1.patch' and see the following.

     

    obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o

    obj-$(CONFIG_HTC_I2CPLD) += htc-i2cpld.o

     

    +obj-$(CONFIG_MFD_DAVINCI_VOICECODEC) += davinci_voicecodec.o

    obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o

     

    obj-$(CONFIG_MFD_T7L66XB) += t7l66xb.o tmio_core.o

     

    Open the file 'drivers/mfd/Makefile' in a text editor.

    We are looking for in it the string "obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o".

    Before this line (see patch) insert

    "obj-$(CONFIG_MFD_DAVINCI_VOICECODEC) += davinci_voicecodec.o"

    (do not forget to remove the plus char)

     

    As a result, we must see...

     

    obj-$(CONFIG_HTC_PASIC3) += htc-pasic3.o

     

    obj-$(CONFIG_MFD_DAVINCI_VOICECODEC) += davinci_voicecodec.o

    obj-$(CONFIG_MFD_DM355EVM_MSP) += dm355evm_msp.o

     

    obj-$(CONFIG_MFD_T7L66XB) += t7l66xb.o

     

    Save 'drivers/mfd/Makefile'.

     

    Remove from the patch file, the second 'diff' section.

    Save 'vc-1.patch'.

     

    Check again.

    [linux-devkit]> git apply --check vc-1.patch

    Hooray! Silence! Means no errors. We apply this patch.

     

    [linux-devkit]> git apply -v vc-1.patch

    Checking patch drivers/mfd/davinci_voicecodec.c...

    Checking patch include/linux/mfd/davinci_voicecodec.h...

    Applied patch drivers/mfd/davinci_voicecodec.c cleanly.

    Applied patch include/linux/mfd/davinci_voicecodec.h cleanly.

     

    GOOD!

    Congratulations! Go to the next step.

  • Step 4: Adds support for the codec interface to ALSA.

     

    [linux-devkit]> git apply --check vc-2.patch

    Silence! Apply the patch.

    [linux-devkit]> git apply -v vc-2.patch

    Checking patch sound/soc/davinci/Kconfig...

    Checking patch sound/soc/davinci/Makefile...

    Checking patch sound/soc/davinci/davinci-vcif.c...

    Checking patch sound/soc/davinci/davinci-vcif.h...

    Applied patch sound/soc/davinci/Kconfig cleanly.

    Applied patch sound/soc/davinci/Makefile cleanly.

    Applied patch sound/soc/davinci/davinci-vcif.c cleanly.

    Applied patch sound/soc/davinci/davinci-vcif.h cleanly.

     

    GOOD!

    Congratulations! Go to the next step.

  • Step 5: Adds codec to ALSA.

     

    [linux-devkit]> git apply --check vc-3.patch

    error: patch failed: sound/soc/codecs/Kconfig:21

    error: sound/soc/codecs/Kconfig: patch does not apply

    error: patch failed: sound/soc/codecs/Makefile:8

    error: sound/soc/codecs/Makefile: patch does not apply

     

    Problems mean a change in file 'sound/soc/codecs/Kconfig' and 'sound/soc/codecs/Makefile'.

    Let's make the change manually!

    Open the file 'sound/soc/codecs/Kconfig' and open the file 'vc-3.patch' in another window.

    In the first file, find the line "select SND_SOC_AK4642 if I2C" and between it and the "select SND_SOC_CS4270 if I2C" insert the line marked by plus sign of a patch file ...

    Also find the line "# Cirrus Logic CS4270 Codec" and before it put the second batch of patch.

     

    As a result, the final Kconfig should now look like this ...

    ...

    select SND_SOC_AK4642 if I2C

    select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC

    select SND_SOC_CS4270 if I2C

    ...

    config SND_SOC_AK4642

    tristate

     

    config SND_SOC_CQ0093VC

    tristate

     

    # Cirrus Logic CS4270 Codec

    config SND_SOC_CS4270

    tristate

    ...

     

    Save the file 'sound/soc/codecs/Kconfig'.

    Delete the first section of the 'diff' from the patch file and save 'vc-3.patch' file.

     

    [linux-devkit]> git apply --check vc-3.patch

    error: patch failed: sound/soc/codecs/Makefile:8

    error: sound/soc/codecs/Makefile: patch does not apply

     

    Better already!

    Only a little bit!

     

    Open the 'our' patch 'vc-3.patch' in one window and 'sound/soc/codecs/Makefile' in another window.

    Find in the Makefile line 'snd-soc-ak4642-objs: = ak4642.o' and after it insert that stated plus sign in the patch.

    As a result, in the Makefile should be ...

     

    snd-soc-ak4642-objs := ak4642.o

    snd-soc-cq93vc-objs := cq93vc.o

    snd-soc-cs4270-objs := cs4270.o

     

    More ... Find and insert ...

     

    obj-$(CONFIG_SND_SOC_AK4642) += snd-soc-ak4642.o

    obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o

    obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.

     

    Save Makefile.

    Erase this section of the 'diff' from the patch and save 'vc-3.patch' file.

     

    Check.

    [linux-devkit]> git apply - check vc-3.patch

    Silence! That means the rest is applicable to the patch!

     

    Apply the patch.

    [linux-devkit]> git apply -v vc-3.patch

    Checking patch sound/soc/codecs/cq93vc.c...

    Checking patch sound/soc/codecs/cq93vc.h...

    Applied patch sound/soc/codecs/cq93vc.c cleanly.

    Applied patch sound/soc/codecs/cq93vc.h cleanly.

     

    Excellent! We applied all three patches.

    We go to the next step.

  • Step 6: Fix something in the Kconfig-files and check it through 'make menuconfig'.

     

    In the first step, we rebuild a new kernel. Please note that there was an message 'configuration saved to .config'.

    If unsure, rebuild the kernel again (type 'make linux' from DVSDK home but not from linux kernel catalog).

    If you're really not sure, rebuild the kernel again with the cleaning ('make linux_clean' then 'make linux' from DVSDK home).

    The previous configuration with the AIC-codec was written in the '.config' file (hidden file).

    Go to linux kernel catalog again.

    Copy '.config' as 'config_aic'.

     

    [linux-devkit]> make menuconfig

     

    Device Drivers --->

    Multifunction device drivers --->

     

    There's no matter what we need with respect to voice codec (((

     

    Device Drivers --->

    <*> Sound card support --->

    <*> Advanced Linux Sound Architecture --->

    <*> ALSA for SoC audio support --->

     

    And then there is no matter what you need.

     

    Correct the problem.
    Exit from configure the kernel.

    Open for editing 'drivers/mfd/Kconfig'.
    Find the section

     

    config MFD_DAVINCI_VOICECODEC

    tristate

    select MFD_CORE

     

    And type something in quotes after 'tristate'.

    For example.

     

    config MFD_DAVINCI_VOICECODEC

    tristate "MFD_DAVINCI_VOICECODEC"

    select MFD_CORE

     

    Save file.

     

    Open for editing 'sound/soc/davinci/Kconfig'

     

    Search...

     

    config SND_DAVINCI_SOC_VCIF

    tristate

     

    Replace with...

     

    config SND_DAVINCI_SOC_VCIF

    tristate "SND_DAVINCI_SOC_VCIF"

     

    Save file.

     

    Open 'sound/soc/codecs/Kconfig'

     

    Search...

     

    config SND_SOC_CQ0093VC

    tristate

     

    Replace with...

     

    config SND_SOC_CQ0093VC

    tristate "SND_SOC_CQ0093VC"

     

    Save file.

     

    Check it!

    [linux-devkit]> make menuconfig

     

    Device Drivers --->

    Multifunction device drivers --->

    < > Support for Silicon Motion SM501

    [ ] Support for Compaq ASIC3

    < > MFD_DAVINCI_VOICECODEC (NEW)

    [ ] HTC EGPIO support

     

    Device Drivers --->

    <*> Sound card support --->

    <*> Advanced Linux Sound Architecture --->

    <*> ALSA for SoC audio support --->

    --- ALSA for SoC audio support

    <*> SoC Audio for the TI DAVINCI chip

    < > SND_DAVINCI_SOC_VCIF (NEW)

    <*> SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM

    < > Build all ASoC CODEC drivers

    < > SND_SOC_CQ0093VC (NEW)

     

    Good!

    While nothing and never save. Go to the next step.

  • Step 7: Adds voice codec support to dm365.

     

    [linux-devkit]> git apply --check vc-4.patch

    error: patch failed: arch/arm/mach-davinci/include/mach/dm365.h:32

    error: arch/arm/mach-davinci/include/mach/dm365.h: patch does not apply

     

    Open 'arch/arm/mach-davinci/include/mach/dm365.h' and 'vc-4.patch'. Copy 'defines' and 'dm365_init_vc' function prototype to 'dm365.h' file and save it. Remove this 'diff' section (which refer to the dm365.h) from patch and save 'vc-4.patch'.

     

    [linux-devkit]> git apply --check vc-4.patch

    Silence is here!

    Apply patch.

     

    [linux-devkit]> git apply -v vc-4.patch

    Checking patch arch/arm/mach-davinci/dm365.c...

    Checking patch arch/arm/mach-davinci/include/mach/mux.h...

    Applied patch arch/arm/mach-davinci/dm365.c cleanly.

    Applied patch arch/arm/mach-davinci/include/mach/mux.h cleanly.

     

    Good! Go to next step.

  • Step 8: Adds voice codec support for DM365EVM board.

     

    [linux-devkit]> git apply -v --check vc-5.patch

    Checking patch arch/arm/mach-davinci/board-dm365-evm.c...

    Checking patch sound/soc/davinci/Kconfig...

    Checking patch sound/soc/davinci/davinci-evm.c...

     

    Good! Apply the patch.

     

    [linux-devkit]> git apply -v vc-5.patch

    Checking patch arch/arm/mach-davinci/board-dm365-evm.c...

    Checking patch sound/soc/davinci/Kconfig...

    Checking patch sound/soc/davinci/davinci-evm.c...

    Applied patch arch/arm/mach-davinci/board-dm365-evm.c cleanly.

    Applied patch sound/soc/davinci/Kconfig cleanly.

    Applied patch sound/soc/davinci/davinci-evm.c cleanly.

     

    There is one thing that I did not like.

     

    Open 'sound/soc/davinci/Kconfig'. Look here.

     

    config SND_DAVINCI_SOC_EVM

    tristate "SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM"

    depends on SND_DAVINCI_SOC

    depends on MACH_DAVINCI_EVM || MACH_DAVINCI_DM355_EVM || MACH_DAVINCI_DM365_EVM

    select SND_DAVINCI_SOC_I2S

    select SND_SOC_TLV320AIC3X

     

    If you choose the codec "in general", it automatically selects the AIC codec (I2S & AIC)

    I personally did not like it. I want to select OR aic-codec OR voice-codec. One of the two.

    Still, I think that there is hardly any need to work simultaneously with two sound devices. Usually only one is needed. Also will be less problems. We solve this simple.

    Cut these two lines from 'MACH_DAVINCI_DM365_EVM ' section and paste these to 'SND_DM365_AIC3X_CODEC' section.

    I noted that you need to cut by a minus sign. What you want to insert, I noticed a plus sign.

     

    config SND_DAVINCI_SOC_EVM

    tristate "SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM"

    depends on SND_DAVINCI_SOC

    depends on MACH_DAVINCI_EVM || MACH_DAVINCI_DM355_EVM || MACH_DAVINCI_DM365_EVM

    - select SND_DAVINCI_SOC_I2S

    - select SND_SOC_TLV320AIC3X

    help

    Say Y if you want to add support for SoC audio on TI

    DaVinci DM6446, DM355 or DM365 EVM platforms.

     

    choice

    prompt "DM365 codec select"

    depends on SND_DAVINCI_SOC_EVM

    depends on MACH_DAVINCI_DM365_EVM

    default SND_DM365_EXTERNAL_CODEC

     

    config SND_DM365_AIC3X_CODEC

    bool "Audio Codec - AIC3101"

    + select SND_DAVINCI_SOC_I2S

    + select SND_SOC_TLV320AIC3X

    help

    Say Y if you want to add support for AIC3101 audio codec

     

    config SND_DM365_VOICE_CODEC

    bool "Voice Codec - CQ93VC"

    select MFD_DAVINCI_VOICECODEC

    select SND_DAVINCI_SOC_VCIF

    select SND_SOC_CQ0093VC

    help

    Say Y if you want to add support for SoC On-chip voice codec

    endchoice

     

    Save Kconfig.

    Test it.

     

    [linux-devkit]> make menuconfig

     

    Select the Voice Codec via 'DM365 codec select'.

     

    Device Drivers --->

    <*> Sound card support --->

    <*> Advanced Linux Sound Architecture --->

    <*> ALSA for SoC audio support --->

    --- ALSA for SoC audio support

    <*> SoC Audio for the TI DAVINCI chip

    -*- SND_DAVINCI_SOC_VCIF

    <*> SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM

    DM365 codec select (Voice Codec - CQ93VC) --->

    < > Build all ASoC CODEC drivers

    -*- SND_SOC_CQ0093VC

     

    Make sure that automatically include options 'SND_DAVINCI_SOC_VCIF' and 'SND_SOC_CQ0093VC'.

     

    Device Drivers --->

    Multifunction device drivers --->

    < > Support for Silicon Motion SM501

    [ ] Support for Compaq ASIC3

    -*- MFD_DAVINCI_VOICECODEC

    [ ] HTC EGPIO support

     

    Also, you can see that 'MFD_DAVINCI_VOICECODEC' is enabled.

     

    Now, select AIC codec via 'DM365 codec select'.

     

    Device Drivers --->

    <*> Sound card support --->

    <*> Advanced Linux Sound Architecture --->

    <*> ALSA for SoC audio support --->

    --- ALSA for SoC audio support

    <*> SoC Audio for the TI DAVINCI chip

    < > SND_DAVINCI_SOC_VCIF (NEW)

    <*> SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM

    DM365 codec select (Audio Codec - AIC3101) --->

    < > Build all ASoC CODEC drivers

    < > SND_SOC_CQ0093VC (NEW)

     

    You will see that the options 'SND_DAVINCI_SOC_VCIF' and 'SND_SOC_CQ0093VC' are disabled in this section.

    And 'MFD_DAVINCI_VOICECODEC' is disabled in 'Device Drivers / Multifunction device drivers' section.

     

    Select AIC-codec, goto main menu and Save configuration as alternative filename as 'config_aic'.

     

    Select VOICE-codec, goto main menu and Save configuration as alternative filename as 'config_vc'.

     

    Remember, we are writing a description after 'tristate' keyword in Kconfig-files?

    Now that we have tested, these descriptions can be erased, that these items do not appear in the menu and not paying the confusion. But you can leave everything as is.

     

    Exit from configurator.

    Compare 'config_aic' and 'config_vc' files using special software (like 'Meld').

     

    In 'config_aic':

    # CONFIG_MFD_CORE is not set

    # CONFIG_MFD_DAVINCI_VOICECODEC is not set

    CONFIG_SND_DAVINCI_SOC_I2S=y

    # CONFIG_SND_DAVINCI_SOC_VCIF is not set

    CONFIG_SND_DM365_AIC3X_CODEC=y

    # CONFIG_SND_DM365_VOICE_CODEC is not set

    # CONFIG_SND_SOC_CQ0093VC is not set

    CONFIG_SND_SOC_TLV320AIC3X=y

     

    In 'config_vc':

    CONFIG_MFD_CORE=y

    CONFIG_MFD_DAVINCI_VOICECODEC=y

    CONFIG_SND_DAVINCI_SOC_VCIF=y

    # CONFIG_SND_DM365_AIC3X_CODEC is not set

    CONFIG_SND_DM365_VOICE_CODEC=y

    CONFIG_SND_SOC_CQ0093VC=y

     

  • Step 9: First build. Problem with 'no soundcard'.

     

    Goto 'arch/arm/configs'.

    Rename 'davinci_dm365_defconfig' to 'davinci_dm365_defconfig_ORIGINAL'.

    Return back to linux main catalog.

    Copy 'config_vc' as 'davinci_dm365_defconfig'.

    Move this file to 'arch/arm/configs'.

    File 'arch/arm/configs/davinci_dm365_defconfig' must match 'config_vc'. You can also make a symbolic link if you wish.

     

    Go to DVSDK home.

    [linux-devkit]> cd ${DVSDK}

    Build kernel without clean.

    [linux-devkit]> make linux

    Install

    [linux-devkit]> make linux_install

    Copy uImage to 'tftpboot'.

    Reboot board.

    Look at the kernel messages.

     

    Advanced Linux Sound Architecture Driver Version 1.0.21.

    asoc: CQ93VC <-> davinci-vcif mapping ok

    ALSA device list:

    No soundcards found.

     

    Oops!

    And where is our sound card?

     

    Let's fix this.

  • Step 10: 'No souncards found' FIX.

     

    Open 'sound/soc/codecs/cq93vc.c' in one window and 'tlv320aic3x.c' in other window.

    Find 'cq93vc_probe' and 'aic3x_probe' functions. Compare both.

    What do you see?

    Right!

    'aic3x_probe' has the 'snd_soc_init_card' call, but 'cq93vc_probe' has not.

    Copy this 'snd_soc_init_card' call from aic probe to cq93vc probe.

    I have put some debug messages.

    And yet something, something that I liked in the text of aic probe.

    As a result, I have the text of this function looks like this.

     

    static int cq93vc_probe(struct platform_device *pdev)

    {

    printk(KERN_INFO "**********MY MESSAGE********** cq93vc_probe\n");

    struct snd_soc_device *socdev = platform_get_drvdata(pdev);

    struct device *dev = &pdev->dev;

    struct snd_soc_codec *codec;

    int ret;

     

    socdev->card->codec = cq93vc_codec;

    codec = socdev->card->codec;

     

    /* Register pcms */

    ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);

    printk(KERN_INFO "**********MY MESSAGE********** ret = snd_soc_new_pcms = %i\n",ret);

    if (ret < 0) {

    printk(KERN_INFO "**********MY MESSAGE********** ERROR!! \n");

    dev_err(dev, "%s: failed to create pcms\n", pdev->name);

    // return ret;

    goto pcm_err;

    }

     

    /* Set controls */

    snd_soc_add_controls(codec, cq93vc_snd_controls,

    ARRAY_SIZE(cq93vc_snd_controls));

     

    /* Off, with power on */

    cq93vc_set_bias_level(codec, SND_SOC_BIAS_STANDBY);

     

    ret = snd_soc_init_card(socdev);

    printk(KERN_INFO "**********MY MESSAGE********** ret = snd_soc_init_card = %i\n",ret);

    if (ret < 0) {

    printk(KERN_ERR "cq93vc: failed to register card\n");

    goto card_err;

    }

     

    // return 0;

    return ret;

     

    card_err:

    snd_soc_free_pcms(socdev);

    snd_soc_dapm_free(socdev);

     

    pcm_err:

    kfree(codec->reg_cache);

    return ret;

    }

     

    Save 'cq93vc.c' file.

     

    Go to DVSDK home.

    [linux-devkit]> cd ${DVSDK}

    Build kernel without clean.

    [linux-devkit]> make linux

    Install

    [linux-devkit]> make linux_install

    Copy uImage to 'tftpboot'.

    Reboot board.

    Look at the kernel messages.

     

    Advanced Linux Sound Architecture Driver Version 1.0.21.

    **********MY MESSAGE********** cq93vc_probe

    asoc: CQ93VC <-> davinci-vcif mapping ok

    **********MY MESSAGE********** ret = snd_soc_new_pcms = 0

    **********MY MESSAGE********** ret = snd_soc_init_card = 0

    ALSA device list:

    #0: DaVinci DM365 EVM (CQ93VC)

     

    Good! The soundcard is detected.

  • Step 11: A bit of magic with targetfs.

     

    Once the kernel initialized, we can see the following message from targetfs.

     

    Unknown hardware: "CQ93VC" "" "" "" ""

    Hardware is initialized using a guess method

    /usr/share/alsa/init/default:53: control element not found

    /usr/share/alsa/init/default:53: control element not found

    /usr/sbin/alsactl: set_control:1256: failed to obtain info for control #1 (No such file or directory)

    ..

    /usr/sbin/alsactl: set_control:1256: failed to obtain info for control #82 (No such file or directory)

     

    If you're very careful, you might notice that there are no such warnings for #10 and #26.

     

    This will return a bit later, but for now let's see /dev and /proc.

     

    root@dm365-evm:~# ls -p /dev/snd

    controlC0 pcmC0D0c pcmC0D0p timer

     

    root@dm365-evm:~# mkdir /home/root/viewproc

    root@dm365-evm:~# cp -R /proc/asound/* /home/root/viewproc

     

    You can see the contents of /proc/asound through NSF going into the directory /home/root/viewproc.

    Because you can not look at the /proc directly through the NSF.

    Catalog 'EVM' there is a link to the catalog 'card0'.

    Examine the contents.

     

    Get more info about soundcard.

     

    root@dm365-evm:~# amixer -h

    root@dm365-evm:~# amixer scontrols

    Simple mixer control 'Mono DAC',0

    Simple mixer control 'PGA',0

    root@dm365-evm:~# amixer scontents

    Simple mixer control 'Mono DAC',0

    Capabilities: pvolume pvolume-joined penum

    Playback channels: Mono

    Limits: Playback 0 - 63

    Mono: Playback 54 [86%]

    Simple mixer control 'PGA',0

    Capabilities: cvolume cvolume-joined penum

    Capture channels: Mono

    Limits: Capture 0 - 3

    Mono: Capture 0 [0%]

     

    Open and view contents of '/etc/asound.state'.

    You see the 82 controls. This is too much for voice codec which has only 2.

    Have a look at the control with the numbers 10 and 26. That they are in our codec.

     

    Remove 'asound.state '

    root@dm365-evm:~# rm /etc/asound.state

     

    root@dm365-evm:~# alsactl -h

    root@dm365-evm:~# alsactl store EVM

    Open and view contents of '/etc/asound.state'.

    You can see only 2 controls.

    Reboot.

    When initializing a targetfs no more warnings about the controls.

     

    Try to play audio-file.

    root@dm365-evm:~# cd /usr/share/sounds/alsa

    root@dm365-evm:/usr/share/sounds/alsa# aplay -t wav Front_Center.wav

    Playing WAVE 'Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

    Division by zero in kernel.

    Backtrace:

    [<c00307d0>] (dump_backtrace+0x0/0x114) from [<c0317330>] (dump_stack+0x18/0x1c)

    Oops!

     

    Look here http://e2e.ti.com/support/embedded/f/354/p/56231/226155.aspx

  • Step 12: 'davinci-vcif.c' fix.

     

    Open 'sound/soc/davinci/davinci-vcif.c'.

    Find 'case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:'.

    After 'davinci_vcif_start(substream);'

    type 'break;'

     

    case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:

    davinci_vcif_start(substream);

    break;

     

    Find 'dma_params[2];'

    Swap lines as described in the forum post.

     

    struct davinci_vcif_dev {

    - struct davinci_vc *davinci_vc;

    struct davinci_pcm_dma_params dma_params[2];

    + struct davinci_vc *davinci_vc;

    };

     

    Now it looks like.

     

    struct davinci_vcif_dev {

    struct davinci_pcm_dma_params dma_params[2];

    struct davinci_vc *davinci_vc;

    };

     

    Save file. Rebuild kernel. Change uImage. Reboot. Test it.

     

    root@dm365-evm:~# aplay -t wav /usr/share/sounds/alsa/Front_Center.wav

    Finally! The sound was heard from the speaker. But, the sampling frequency is mismatch.

  • Step 13: Change volume for SPK1 and pga level for MIC1.

     

    Speaker volume is given by the numbers from 0 to 63 or a percentage.

     

    root@dm365-evm:~# amixer scontents

    Simple mixer control 'Mono DAC',0

    Capabilities: pvolume pvolume-joined penum

    Playback channels: Mono

    Limits: Playback 0 - 63

    Mono: Playback 54 [86%]

    Simple mixer control 'PGA',0

    Capabilities: cvolume cvolume-joined penum

    Capture channels: Mono

    Limits: Capture 0 - 3

    Mono: Capture 0 [0%]

     

    root@dm365-evm:~# amixer sset 'Mono DAC' 30

    Simple mixer control 'Mono DAC',0

    Capabilities: pvolume pvolume-joined penum

    Playback channels: Mono

    Limits: Playback 0 - 63

    Mono: Playback 30 [48%]

     

    root@dm365-evm:~# amixer sset 'Mono DAC' 90%

    Simple mixer control 'Mono DAC',0

    Capabilities: pvolume pvolume-joined penum

    Playback channels: Mono

    Limits: Playback 0 - 63

    Mono: Playback 57 [90%]

     

    Capture values is 0,1,2,3. But you can specify in percentage terms.

     

    root@dm365-evm:~# amixer sset 'PGA' 100%

    Simple mixer control 'PGA',0

    Capabilities: cvolume cvolume-joined penum

    Capture channels: Mono

    Limits: Capture 0 - 3

    Mono: Capture 3 [100%]

     

    If you want to store audio levels, then try this.

     

    root@dm365-evm:~# alsactl store EVM

     

    This command is store levels to configuration file, and after reboot alsa boot-script restore this levels.

     

    Try to record voice, now.

    root@dm365-evm:~# arecord -t wav -r 16000 test16kHz.wav

     

    Tilt your head as close as possible to the microphone and speak very loudly into it.

    After a few seconds, press the 'Ctrl-C'.

     

    Replay your record.

    root@dm365-evm:~# aplay -t wav -r 16000 test16kHz.wav

     

    It works!

     

    Okay. If you want switch between AIC and VOICE codecs, there are some hints.

    Overwrite 'davinci_dm365_defconfig' with 'config_aic' or 'config_vc' to build kernel.

    Or you can can use ready-made images 'uImage_aic' or 'uImage_vc' (simply, change U-Boot variable to boot right image).

    Also you can choose 'targetfs_aic' or 'targetfs_vc', or do something in to use the correct 'asound.state' file.

  • Step N: Future improvements.

     

    Goto Khilman site again.

    http://git.kernel.org/?p=linux/kernel/git/khilman/linux-davinci.git;a=summary

    Now choose the latest tag (Master). Use 'tree' link-button. Find all of the files that we have changed.

    There are 'davinci_voicecodec.c', 'davinci-vcif.c', 'cq93vc.c' and others.

    Using 'history' link-button, carefully read the history of each file. There may be significant improvement.

    Check it! Test it! Describe your results.

    Also, watch for Arago project

    http://arago-project.org/git/projects/linux-davinci.git?p=projects/linux-davinci.git;a=summary

    There may also be something very important.

     

    Step X: test ENCODE and DECODE

     

    root@dm365-evm:~# cd /usr/share/ti/dvsdk-demos

    root@dm365-evm:/usr/share/ti/dvsdk-demos# ./loadmodules.sh

    cmemk: disagrees about version of symbol module_layout

    irqk: disagrees about version of symbol module_layout

    FATAL: Error inserting cmemk (/lib/modules/2.6.32-rc2-davinci1/kernel/drivers/dsp/cmemk.ko): Invalid module format

     

    You need to rebuild modules EDMA,CMEM etc.

    [linux-devkit]> make cmem_clean && make cmem && make cmem_install

    [linux-devkit]> make irq_clean && make irq && make irq_install

    [linux-devkit]> make edma_clean && make edma && make edma_install

    [linux-devkit]> make dm365mm_clean && make dm365mm && make dm365mm_install

     

    Copy

    cmemk.ko, dm365mmap.ko, edmak.ko, irqk.ko

    to targetfs '/lib/modules/2.6.32-rc2-davinci1/kernel/drivers/dsp'.

    Replace old files with new.

    Reboot.

     

    You need to rebuild demos.

     

    [linux-devkit]>make components

    [linux-devkit]>make demos_clean

    [linux-devkit]>make demos

    [linux-devkit]>make demos_install

    Copy files from 'install' to 'targetfs'.

    Replace old files with new.

    root@dm365-evm:/usr/share/ti/dvsdk-demos# ./loadmodules.sh

    root@dm365-evm:/usr/share/ti/dvsdk-demos# ./encode -a test.aac

    Encode demo started.

    ARM Load: 6% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 12 kbps Time: 00:00:01 Demo: Encode Display: 720P 60Hz Video Codec: N/A Resolution: N/A Sound Codec: AACLC Enc
    oder Sampling Freq: 16 KHz samp rate

    root@dm365-evm:/usr/share/ti/dvsdk-demos# ./decode -a test.aac

    Decode demo started.
    ARM Load: 13% Video fps: 0 fps Video bit rate: 0 kbps Sound bit rate: 170 kbps Time: 00:00:01 Demo: Decode Display: 720P 60Hz Video Codec: N/A Resolution: N/A Sound Codec: AAC Sam
    pling Freq: 16 KHz samp rate

    Demos are work.

    GOOD LUCK!


     

  • By the way, I just tried one thing.

    GStreamer works with the internal microphone and speaker!

    Although not all GStreamer examples work, but some still work (see below).

     

    root@dm365-evm:/usr/share/ti/dvsdk-demos# cd /usr/share/ti/dvsdk-demos

    root@dm365-evm:/usr/share/ti/dvsdk-demos# ./loadmodules.sh


    Audiotest - 8kHz

     

    root@dm365-evm:/usr/share/ti/dvsdk-demos# gst-launch audiotestsrc num-buffers=1000 ! 'audio/x-raw-int, width=16, depth=16, rate=8000' ! alsasink

     

    Sound from the speaker seems as normal.

     

    Audiotest — 16kHz

     

    root@dm365-evm:/usr/share/ti/dvsdk-demos# gst-launch audiotestsrc num-buffers=1000 ! 'audio/x-raw-int, width=16, depth=16, rate=16000' ! alsasink

     

    sound is bad.

     

    Audio Loopback (record from mic with playback to speaker)

     

    gst-launch -v alsasrc ! 'audio/x-raw-int, width=16, depth=16, rate=8000, channels=1' ! alsasink sync=false

    gst-launch -v alsasrc ! 'audio/x-raw-int, width=16, depth=16, rate=16000, channels=1' ! alsasink sync=false

     

    These examples are working (although sound is echoing).

     

    Store audiotest as AAC-file (12 second)

     

    gst-launch -v audiotestsrc num-buffers=200 ! 'audio/x-raw-int, width=16, depth=16, rate=16000, channels=1' ! TIAudenc1 codecName=aaclcenc engineName=codecServer ! filesink location=test.aac

     

    Works fine.

     

    Note, 8kHz rate does not supported with AAC-encoder (16kHz minimum).

     

    Store my voice as AAC-file

     

    gst-launch -v alsasrc num-buffers=400 ! 'audio/x-raw-int, width=16, depth=16, rate=16000, channels=1' ! TIAudenc1 codecName=aaclcenc engineName=codecServer ! filesink location=myvoice.aac

     

    playback my aac-voice

     

    gst-launch -v filesrc location=myvoice.aac ! TIAuddec1 codecName=aacdec engineName=codecServer ! alsasink sync=false

     

    Sound is played, but the frequency is clearly not the same.

     

    Other examples are not working, mostly due to the caps-incompatibility between the pipes.

    (WARNING: erroneous pipeline: could not link filesrc0 to tiauddec10)

  • Thanks a lot for this great tutorial!

    I really appreciate the effort you put to share all this info.

     

    By the way, to fix the wrong sample rate in the encode/decode demos you should multiply it by 4.

    The sample rate is wrong when you use either of them, so if you record something with encode and listen to it with decode it would sound okay, but if you'll use another program to play a file that was recorded with encode, or if you'll use decode to play a file that was recorded with another program, the speed will be wrong.

    So to fix it:

    In audio.c:

    change

    sAttrs.sampleRate = Adec1_getSampleRate(hAd1); 

    to

    sAttrs.sampleRate = 4 * Adec1_getSampleRate(hAd1); 

  • Hi,senchuss

    When I run pipeline on dm365-evm:

    gst-launch -v alsasrc ! 'audio/x-raw-int, width=16, depth=16, rate=8000, channels=1' ! alsasink sync=false

     

    audio from the line-in,not from mic-in, how to fix it ?

     

    Thanks.

    Xu

  • Hi!

    I'll finish universal patch so people can quickly get VoiceCodec in DVSDK4.2.

    What I wrote here a few months ago, a little out of date.

    The fact that you need to change something in a few other files to properly set the frequency of VoiceCodec.

    Just the other day, I will publish the patch and instructions.

    I also plan to test GStreamer in the coming days.

    Stay tuned.

  • vico Tsui said:

    gst-launch -v alsasrc ! 'audio/x-raw-int, width=16, depth=16, rate=8000, channels=1' ! alsasink sync=false

    audio from the line-in,not from mic-in, how to fix it ?

    I do not quite understand why you're talking about a few inputs.

    If we are talking about the internal VoiceCodec, then there are no line-in, no mic-in. The VoiceCodec has only one input.

    My VoiceCodec works on 16kHz freq.

    I just tried your example.

    It works! I speak into the microphone and the sound heard from the speaker.

    gst-launch -v alsasrc ! 'audio/x-raw-int, width=16, depth=16, rate=16000, channels=1' ! alsasink sync=false
    Setting pipeline to PAUSED ...
    /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-buffer-time = 200000
    /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: actual-latency-time = 10000
    /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(in
    t)16, depth=(int)16, rate=(int)16000, channels=(int)1
    Pipeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstAudioSrcClock
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, wid
    th=(int)16, depth=(int)16, rate=(int)16000, channels=(int)1
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, wi
    dth=(int)16, depth=(int)16, rate=(int)16000, channels=(int)1
    /GstPipeline:pipeline0/GstAlsaSink:alsasink0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=
    (int)16, depth=(int)16, rate=(int)16000, channels=(int)1


  • Hello!

     

    Let me to introduce the patch that adds VoiceCodec into the DVSDK4.2. If you have DM365EVM, please test it. I never knew how to do patches, and doing it the first time in my life.

    I used the command 'diff' to create this patch.

     

    Here are instructions.

    1. Getting the patch

     

    Download the file by clicking here <7444.Add-VoiceCodec.patch.zip>

    Unpack the archive. You will see a file 'Add-VoiceCodec.patch'.

     

    2. Backup

     

    Linux sources are located in $DVSDK/psp/linux-2.6.32.17-psp03.01.01.39

     

    Make a backup copy of this catalog!

     

    For example, copy the contents of the catalog

    'linux-2.6.32.17-psp03.01.01.39'

    into

    'backup_linux-2.6.32.17-psp03.01.01.39'.

     

    This patch modifies the contents of some files only within the Linux sources catalog.

     

    If something goes wrong, simply delete 'linux-2.6.32.17-psp03.01.01.39', and then rename 'backup_linux-2.6.32.17-psp03.01.01.39' back to 'linux-2.6.32.17-psp03 .01.01.39 ', and you'll bring everything back as it was.

     

    WARNING! This patch assumes that you have a new installation of DVSDK4.2 and you did not made any changes to these files: 'dm365.c', 'dm365.h', 'mux.h' and 'board-dm365-evm.c'. Otherwise, this patch may or may not apply.

     

    Make a copy of the file '/etc/asound.state' from targetfs (be careful, from targetfs, and not from the host).

     

    3. Apply the patch

     

    Put the file 'Add-VoiceCodec.patch' in catalog 'linux-2.6.32.17-psp03.01.01.39'.

     

    Using the terminal go to that catalog and run:

     

    $ patch -p1 -i Add-VoiceCodec.patch

     

    In normal output should look as follows:

     

    patching file arch/arm/mach-davinci/board-dm365-evm.c

    patching file arch/arm/mach-davinci/dm365.c

    patching file arch/arm/mach-davinci/include/mach/dm365.h

    patching file arch/arm/mach-davinci/include/mach/mux.h

    patching file drivers/mfd/davinci_voicecodec.c

    patching file drivers/mfd/Kconfig

    patching file drivers/mfd/Makefile

    patching file include/linux/mfd/davinci_voicecodec.h

    patching file sound/soc/codecs/cq93vc.c

    patching file sound/soc/codecs/cq93vc.h

    patching file sound/soc/codecs/Kconfig

    patching file sound/soc/codecs/Makefile

    patching file sound/soc/davinci/davinci-evm.c

    patching file sound/soc/davinci/davinci-vcif.c

    patching file sound/soc/davinci/davinci-vcif.h

    patching file sound/soc/davinci/Kconfig

    patching file sound/soc/davinci/Makefile

     

    If the output looks different and there are errors, sorry. Restore the original catalog 'linux-2.6.32.17-psp03.01.01.39' (see above).

     

    4. Switching between the AIC and VoiceCodec using Linux menuconfig

     

    Device Drivers --->

    ...

    <*> Sound card support --->

    ...

    <*> Advanced Linux Sound Architecture --->

    ...

    <*> ALSA for SoC audio support --->

     

    Would be something like that.

    --- ALSA for SoC audio support

    <*> SoC Audio for the TI DAVINCI chip

    <*> SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM

    DM365 codec select (Audio Codec - AIC3101) --->

    < > Build all ASoC CODEC drivers

     

    In paragraph 'DM365 codec select' you can switch the codec.

     

    ( ) Audio Codec - AIC3101

    (X) Voice Codec — CQ93VC

     

    You will return to the previous point and see that there is a new opportunity to choose the type of VoiceCodec as 8kHz or 16kHz.

    Put a checkmark in the paragraph 'Show clocks at Linux startup'.

    The screen should look like this:

     

    --- ALSA for SoC audio support

    <*> SoC Audio for the TI DAVINCI chip

    <*> SoC Audio support for DaVinci DM6446, DM355 or DM365 EVM

    DM365 codec select (Voice Codec - CQ93VC) --->

    Voice Codec Sampling Frequency (Fs=16kHz) --->

    [*] Show clocks at Linux startup (Debug feature)

    < > Build all ASoC CODEC drivers

     

    5. Initial setup

    At the beginning of the Linux boot messages you see this:

     

    *** VOICECODEC CONFIGURATION is 16 kHz

    *** Board Clocks:

    * PERI_CLKCTL=0x243F027C

    * CLOCKOUT0EN is 0 = en

    * CLOCKOUT1EN is 0 = en

    * CLOCKOUT2EN is 1 = dis

    * DIV1 is 15 = 16

    * DIV2 is 4 = 5

    * DIV3 is 63 = 64

    * HDVICPCLKS is 1 = PLLC2SYSCLK2

    * DDRCLKS is 0 = PLLC1SYSCLK7

    * KEYSCLKS is 0 = RTCXI (MXI)

    * ARMCLKS is 1 = PLLC2SYSCLK2

    * PRTCCLKS is 0 = RTCXI (OSC)

    * CLKIN = 24000000 Hz

    * PLL1PreDiv is 7 = 8

    * PLL1Mul is 81 = 162

    * PLL1PostDiv is 0 = 1 -- en

    * PLL1 CLK = 486000000 Hz -- en

    * PLL1DIV1 is 0 = 1 -- en

    * PLL1DIV2 is 1 = 2 -- en

    * PLL1DIV3 is 1 = 2 -- en

    * PLL1DIV4 is 3 = 4 -- en

    * PLL1DIV5 is 1 = 2 -- en

    * PLL1DIV6 is 17 = 18 -- en

    * PLL1DIV7 is 0 = 1 -- en

    * PLL1DIV8 is 3 = 4 -- en

    * PLL1DIV9 is 1 = 2 -- en

    * PLL2PreDiv is 7 = 8

    * PLL2Mul is 99 = 198

    * PLL2PostDiv is 0 = 1 -- en

    * PLL2 CLK = 594000000 Hz -- en

    * PLL2DIV1 is 0 = 1 -- en

    * PLL2DIV2 is 1 = 2 -- en

    * PLL2DIV3 is 0 = 1 -- en

    * PLL2DIV4 is 28 = 29 -- en

    * PLL2DIV5 is 7 = 8 -- en

    * ARM CORE CLK = 297000000 Hz

    * HDVICP CLK = 297000000 Hz

    * DDR CLK supply for PHY = 486000000 Hz ; Real DDR clk = 243000000 Hz

    * VoiceCodec CLK = 4096551 Hz ; Sample Freq = 16002 Hz

     

    and this

     

    asoc: CQ93VC <-> davinci-vcif mapping ok

    ALSA device list:

    #0: DaVinci DM365 EVM (CQ93VC)

     

    Remove the old (AIC) configuration

    root@dm365-evm:~# rm /etc/asound.state

     

    Set the microphone sensitivity (from 0 to 3)

    root@dm365-evm:~# amixer sset 'PGA' 2

     

    Set the speaker volume (from 0 to 63 or from 0% to 100%)

    root@dm365-evm:~# amixer sset 'Mono DAC' 50%

     

    Save the new configuration

    root@dm365-evm:~# alsactl store EVM

     

    6. Hardware Improvements

     

    SPK1 Improvements

    Unfortunately, the DM365EVM has a bad speaker (SPK1). You'll hear a very quiet sound from it. I can recommend (for your own risk) you to unsolder and unmount this speaker, and you can mount and solder the 3.5mm headphone jack instead the speaker. See photo.

    My headphones have a resistance of 32 Ohms, and I made matching this resistance. Keep in mind that VoiceCodec has one channel, and you have to do a mono headset. Also, I recommend making a LP filter, for example, to cut off all frequencies above 3 kHz. You can carefully solder necessary parts to the back of the board. See photo.

    Much easier to hear the sound through headphones!

    As a result, I hear a loud sound in the headphones if I set 50% of the volume.

    (amixer sset 'Mono DAC' 50%)

     

     

    MIC1 Improvements

    Much worse is the case with the microphone! I see that the problem apparently is that the impedance of the microphone is not match with the impedance of VoiceCodec. As a result, the microphone has a very weak sensitivity. You will have bent to it, literally screaming right into it.

    Again, I can recommend to solder a normal and high quality electret microphone instead that there is. See photo.

    You must connect a microphone through the BUFFER! It is necessary to match the output and input impedances.

    As a result, I can record a loud sound using a value of 2 (range from 0 to 3) in the settings of the microphone.

    (amixer sset 'PGA' 2)

     

    7. Tests

    arecord, aplay

     

    Record WAV-file using a microphone (duration 10s)

    root@dm365-evm:~# arecord -t wav -f S16_LE -r 16000 -c 1 -d 10 test16kHz.wav

    Recording WAVE 'test16kHz.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono

     

    WAV-file playback

    root@dm365-evm:~# aplay test16kHz.wav

    Playing WAVE 'test16kHz.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono

     

    GStreamer

     

    Soundtest

    gst-launch -v audiotestsrc \

    ! 'audio/x-raw-int,width=16,depth =16,rate=16000,channels=1' \

    ! audioconvert \

    ! alsasink

     

    Loopback

    gst-launch -v alsasrc \

    ! 'audio/x-raw-int,width=16,depth=16,rate=16000,channels=1' \

    ! alsasink sync=false

     

    Record AAC (encoder need 2 channels)

    gst-launch -v alsasrc \

    ! 'audio/x-raw-int,width=16,depth=16,rate=16000,channels=2' \

    ! TIAudenc1 codecName=aaclcenc engineName=codecServer \

    ! filesink location=test.aac

     

    Playback AAC (input file must be 16kHz, 2channels)

    gst-launch -v filesrc location=test.aac \

    ! TIAuddec1 codecName=aacdec engineName=codecServer \

    ! alsasink sync=false

     

    Important note: AAC-encoder and decoder operates with a sampling rate of 16kHz and above. You can not use 8 kHz mode of VoiceCodec to encode/decode AAC.

     

     

    'encode' demo (dvsdk-demos)

     

    If you have just installed DVSDK, (you never rebuild it), then when you run 'encode-a test.aac', you can see 'failed to create audio device'.

    Try to rebuild dvsdk-demos! ('make demos_clean', 'make demos', 'make demos_install')

     

    ./encode -a test.aac -p 16000 -t 10

    The file has a duration of 5 seconds, and the sound is twice as fast (if you listen the file on the host).

     

    Need something to fix in the code.

     

    Open 'audio.c' from dvsdk-demos_xxx/dm365/encode.

    Look for this one block within the code.

    /* Use supplied params if any, otherwise use defaults */

    params = envp->params ? envp->params : &defaultParams;

    dynParams = envp->dynParams ? envp->dynParams : &defaultDynParams;

    params->sampleRate = dynParams->sampleRate = envp->sampleRate;

    params->bitRate = dynParams->bitRate = envp->soundBitRate;

     

    Just add those two lines after this code.

    params->channelMode = IAUDIO_1_0;

    dynParams->channelMode = IAUDIO_1_0;

     

    This is because the VoiceCodec is a mono-device.

    Rebuild encode demo.

    Try again.

    ./encode -a test.aac -p 16000 -t 10

    It works!!!

     

     

     

    Please test it ALL!

     

  • Help!

     

    Something strange is happening with VoiceCodec ((((

     

    In short, there are no problems if you capture sound only. But the strange artifact begins to appear after a while, if capture audio along with video together.

     

    Try this

    ./encode -a test.aac -r 16000 -t 3600

    All was good. No artifacts there for an hour recording!!! The same is true if you use 'arecord' or whatever when there is no video capture but only sound capture is.

     

    But if you try this

    ./encode -a test.aac -r 16000 -v test.264 -y 2 -t 600

    (In my case I use the PAL-cam through TVP5146 (composite), so I use the '-y 2' option.)

    Quite possibly the sound at the end of AAC-file will be slightly different than in the beginning.

    Please check it!

     

    The strange effect is not immediate. It can start after 2 minutes of recording time, sometimes a little later, like after 7 or 9 minutes of recording time. Usually, this effect is seen if the record at least 15 minutes. I think that if the record at least half an hour, this effect is exactly appear.

    And if this thing befallen, then when you run the program again, the effect is seen immediately. And it will not disappear until you reboot your board.

     

    What is the effect?

    For no apparent reason, SUDDENLY there appears a high-frequency noise.

    Here is WAV-files ... <0535.VoiceCodecEffect.zip>

    I cut out the beginning and the end for clarity. You will hear a few seconds of sound, and a few seconds later you hear that suddenly appeared artifact. This file was converted to WAV from the AAC. In fact, the problem is not with AAC-encoding.

    In the encode-demo file (audio.c), I inserted a piece of code that records audio to WAV. And if I record the sound directly into WAV (not using the AAC-codec), this effect appears in WAV-file.

    Then I tried not to use DMAI for sound capture. I put a piece of code (to the 'audio.c' func 'audioThrFxn') that initializes and uses the ALSA natively (using the ALSA functions 'snd_pcm_open', 'snd_pcm_start' and 'snd_pcm_readi'). And it did not help. Effect was again in WAV-file. The problem is not DMAI.

    The problem is not hardware like. Nothing strange there on the oscilloscope.

    I tried to see, with software WAV-viewer, how this artifact looks.

    And I found that each one sample from seventeenth is distorted.

     

     

    WHAT IS IT?

     

    • This effect occurs only with VoiceCodec and does not appear if we use the AIC.

    • This effect appears only when there is to be audio-capture along with video-capture.

     

    Something bad with DMA?

    Any ideas? What are the thoughts on this? What to do?
    I think that VoiceCodec useless if you can not get it to work properly with the video capture.

     

  • I got a clear picture of the artifact as shown!!!

     

    In my previous post I published a WAV-files.

    They were obtained by converting from AAC to WAV using ffmpeg.

    Unfortunately, it seems that as a result of this transformation, the effect is distorted.

     

    I suggest a more pure experiment!

     

    If you are in directory '$DVSDK/dvsdk-demos_4_02_00_01/dm365/encode/' are the original sources, you can do the following:

     

    Rename the file in this directory 'audio.c' in 'backup_audio' (without the 'c' extension).

     

    Take here these sources <2211.audio-to-wav.zip>

    Put in the catalog these three files:

    * MyWavLib.h

    * MyWavLib.c

    * audio_for_wav.c

     

    Just rebuild the demo ('make demos', 'make demos_install').

     

    If you then want to return everything as it was, just delete 'MyWavLib.c', 'MyWavLib.h', 'audio_for_wav.c' and rename 'backup_audio' to 'audio.c'.

     

    On the host computer, run the sound output

    host $ gst-launch -v audiotestsrc ! alsasink

     

    Connect your computer sound output to the input VoiceCodec with a cable. (we will not use the microphone.)

     

    To record only sound (5 seconds), the demo should be run like this.

     

    ./encode -a dummy.aac -p 16000 -t 5

     

    The parameter '-a dummy.aac' needed to run the audio stream. As a result, AAC-file is not created, and in the directory with the application will create a 'test.wav'.

     

    Open the 'test.wav' using WAV-editor (for example, 'audacity').

    Simply adjust the volume level of your sound card on your computer.

    To do this, run the audio capture on several occasions, and eventually until you get to a wav-file was a normal sound level.

     

    Finally, start the capture audio along with video capture for a long time (eg at least 15 minutes).

     

    ./encode -v test.264 -y 2 -a dummy.aac -p 16000 -t 900

     

    Effect should appear.

     

    Here WAV-file in which I left only the part where the effect appears 7536.VoiceCodecEffect_directWav.zip<>

     

    PLEASE HELP!

    It is very necessary to understand what was happening.

     

     

     

  • hi senchuss.

    your experience is very helpful for us.

    However, TI engineer or FAE do not respond to there questions yet. As we many people need this function,  they should feed ashame .

  • Hi!

    It seems to me that engineers are not the answer to this problem.
    Perhaps it's because software development for the DM365 farmed out to open source community.

    In fact, it is not clear, it's a hardware problem or software? If a software problem, it is unlikely that someone wants to mess about with this.
    I am now the most important thing to know that this is only I have this problem? Or others also have this effect?
    That is why I would like to make other people confirmed that they have the same problem.

    I just really needed a VoiceCodec, because I need to have a free McBSP port.
    I need to connect a non-audio chip to the McBSP port .
    And since the operation with VoiceCodec proved unsatisfactory, unfortunately I forced to connect both AIC31-codec and non-audio chip to the McBSP port.

    But if VoiceCodec would earn excellent, it is would very much easier task!
    Sampling frequency of 16kHz me completely satisfied.

    I am very upset that VoiceCodec normally does not work ((((

  • Hi,

    Latest PSP Release 03.21.00.04 has support for Voice Codec on DM365. You can download the source from master branch of git://arago-project.org/git/projects/linux-davinci.git.

    Regards, Sudhakar

  • Hi, Sudhakar.

    Thanks, I already saw this PSP.

    I am interested in the issue when VoiceCodec become a part of DVSDK?

     

    By the way, I could be wrong, but it seems to me that the file 'sound/soc/davinci/davinci-vcif.c' is still has a bug.

    Look here:

    static int davinci_vcif_trigger(struct snd_pcm_substream *substream, int cmd,

    struct snd_soc_dai *dai)

    {

      int ret = 0;

      switch (cmd) {

         case SNDRV_PCM_TRIGGER_START:

         case SNDRV_PCM_TRIGGER_RESUME:

         case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:

             davinci_vcif_start(substream);

         case SNDRV_PCM_TRIGGER_STOP:

         case SNDRV_PCM_TRIGGER_SUSPEND:

         case SNDRV_PCM_TRIGGER_PAUSE_PUSH:

             davinci_vcif_stop(substream);

             break;

         default:

             ret = -EINVAL;

      }

    return ret;

    }

     

    I think that lacks the operator 'break;'

    after 'davinci_vcif_start (substream);'

     

    In any case, the problem with the capture of audio + video for a long time I have not yet been solved.
    I expect that someone will try and say that he had no such problem.

  • Hi

    I have the same problem with the MIC: I really need to scream into it in order to hear something on the SPK.

    Although I set "amixer sset 'PGA' 3" and the volume at 100%, I have tried different microphones (electret P9925-ND from DigiKey, condenser 102-1721-ND or even Sisonic 3.6V mini 423-1084) but the results are more or less the same.

    I just would like to record audio conversations... How do I do that? Do I need amplification?

    Thanks!

  • hi :

    have you solved it ?

  • I apologize for the late reply.

     

    to Michael:

    Hi, Michael.

    The general problem is mismatch of impedances.

    Do not forget that the input resistance of VoiceCodec is 10k.

    But, what is the output impedance of your MIC?

    You need to do match of these values.

    It is possible that the output resistance of the microphone is to low.

    As I wrote earlier, I strongly recommend to place a buffer.

    Of course, do not forget to make a design for amplification, offset and filtering.

    See details and application notes for your mic.

    In short, you need to make your custom mini-board with few parts.

    You need to connect your mic to the input of this mini-board and connect outputs from the board to the inputs of VoiceCodec (use wires).

    More specifically, you must connect the output wires to the place where was old demounted microphone (M1). The photo that I published earlier this mini-board was not visible.

    Here is an example.

    I hope that you will succeed and the sound level is will good. Please, write a short message in this topic that you got it.

    When you get a good level of sound you can test shows whether you have "the effect of distorting the sound after 15 minutes of audio recording with a video" or not.

    Please write about it. You will be doing this great help to me. Because I am suffering.

    I could hear the sound recorded from VoiceCodec slightly better than from AIC (slightly less noise) for the Fs = 16kHz.

    And it would be great, if the effect of distortion is not apear.

     

    to YJ Liu:

    Hi, YJ Liu.

    Unfortunately now I have to use the AIC.

    Unfortunately I do not have time to win this problem, because I need to write much more code for other aud&vid capture tasks.

    This damned VoiceCodec was take a lot of time for me.

    I could not devote time to it.

    But I'm planning a couple of months to return to this issue.

    • I plan to try another board rev.F with TMS (Now I have DM365EVM rev.E with TMX DM365)

    • I plan to use newest PSP 03.21.00.04 (I want to note that this is not part of the DVSDK4)

    • I plan to use latest Linux kernel (AGAIN, this is not part of the DVSDK4)

    • Maybe something with CMEMK, EDMAK?

    • I plan to examine VoiceCodec registers (suddenly something happens to them during the recording)

    • I plan to use anything )))) … (If no help, can I pray?)

    When I bought DM365EVM board and downloads from the Internet DVSDK4, I thought that VoiceCodec will work.

    I was not lucky one? What am I doing wrong?

     

    to ALL:

    Hey guys!

    Do not be silent!

    I'm the only one stupid?

    Please, post your results (good or not).

    If you have all the good you do not be lazy and write so concisely. "All is well, I have my VoiceCodec writes more than half an hour of audio along with video and effect does not occur." It's not a hard for you? (Please specify your DM365 revision).

    You could help to stop my suffering.

     

    ALL IN ADVANCE THANK YOU! I hope for your help!

     

     

     

  • Thanks senchuss for that great message!

    I found (randomly) a great solution using a MEMS microphone, the SPM0404HE5H from Sisonic (available on DigiKey).

    Here is how I connected its pins:

    - OUT: directly to DaVinci MIC P

    - GND and VCC to their respective lines

    - GAIN (pin 2): to a 10uF capacity then to GND

     

    I left the DaVinci MIC N opened / unconnected and that's it! The sound quality could be better but I can clearly hear any conversation in the room (up to a few meters), exactly what I need!

    Michael

  • I see that this topic is very popular (judging by the number of views).
    I hope that given previously, the patch and recommendations, at least someone is so helpful.
    And probably already have people who VoiceCodec works with DVSDK4.02.
    I am very disappointed that no one still did not post any info here about my question about VoiceCodec 'noise'
    when vid+aud capture is been along one hour!
    Capture video + audio works well for at least a half hour and not seen the emergence of hiss as I wrote above?
    Well, at least somebody here write "YES! Personally, I have all excellent! Capture video + audio works fine and there is no hiss."

    Hi, Sudhakar.
    You wrote that VoiceCodec is now in PSP3.21
    Now I'm trying to tie PSP 3.21 to DVSDK 4.02 and it is so difficult to do!
    A little torment I was able to rebuild the modules 'cmem', 'irq', 'edma', 'dm365mmap' for the new kernel 2.6.37.
    But I do I'll never know ..ops.. how to build DMAI (from DVSDK4.02) against PSP 3.21 (kern 2.6.37)?
    See the topic "Davinci DM36x PSP 3.21" http://e2e.ti.com/support/embedded/f/354/p/123211/462917.aspx

    What should I do? Help me please!

  • Hi,

    I have forwarded your question to internal team which manages the DVSDK release. They should be answering this.

    Regards, Sudhakar

  • Thank you very much.

    I'll wait for any updates for DVSDK or DMAI.

  • Hi,

     I have exactly the same problem as Senchuss with the voice codec losing it's mind and producing glitches after recording audio+video for " a while" (it happens to me after about 5 minutes, sounds like Senchuss could get an hour out of it. Has anyone found a way to solve this? I've run the same sort of experiments as he did -capturing raw/vs encoded, and there's no doubt it's present in the raw audio.  Any help/insight would be appreciated, even if it's a "we don't see this problem".

    Thanks,

    Paul

  • Hi, Paul! Thank you for reply!
    I still use an external audio-codec :-(((  .. (aic31)
    Frankly, there is little hope to solve the VoiceCode problem. Nobody told me (you are only!) that there is a problem. Are ALL probably all good and no problems for ALL! (exept you and me).
    But .. nobody still was not reply that "all is good" in this topic.

    Thanks!

  • Hi Senchuss,

     Yeah, there can be really strange radio silence on the (or any) forum sometimes. I've had a few funny threads that go "Hey, found a problem, any advice?...silence...Hey, I think I know what is causing the problem...silence...Hey, here is the problem and the solution and some code...silence", but, I get it. We are all very (very) busy, and sometimes these issues are very specific to our setups, so I wouldn't take it too personally. Everyday I see any number of posts that I could respond to, but sanity preservation prevents it.

    In any case, I am having better luck now. I got to the point where I was able to see my audio glitching was happening in what seemed to be the actual A/D conversion in the voice coded. Went exploring in the UBL and found that I had overclocked it to 256*32kHz vs it's specified maximum rate of 256*16KHz. When I clocked it down to 256*16kHz, my glitching went away (at least on the record side) and hasn't resurfaced. I do still get it every now and then on playback, so digging into that.

    Thanks!

    Paul

  • O!

    News!

    http://e2e.ti.com/support/embedded/linux/f/354/p/177888/648450.aspx#648450

    I'll subscribe on this topic news.

    We are waiting for news!

    DM36x VoiceCodec supports in Linux wanted.

  • Dear senchuss,

    I had same problem like you.
    I might find the casue of noise. Reference following,

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/p/180162/706386.aspx#706386

    Regards,

    Hyunho

  • Hi senchuss:

     I have the same issue with you.And i tested that ,if the H264 run with EDMA,the sampling of audio capture would become a little faster then given.

     Unfortunately ,I am not a export on ALSA program. and now I am wondering wether audio cap can working without EDMA.

  • Hi, Hyunho Youn .

    My name is Sangyun Yun.

    Please send e-mail to me, if you can.

    My e-mail address is scion87@naver.com.

    I'll wait.

    Thank you.

  • Hi senchuss:

    Now I think I have the same problem with you. It's a DMA conflict between SPI2 and Encoder.

    See:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/220036.aspx

  • Hi,Senchuss:

    has introduced a RFIFO clear method, and it works for some frequency.:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/p/180162/706386.aspx#706386

    I test it, use 1KHz and 500 Hz wave,the data is correct. when the frequency is lower than 500, like 200 and 100, the data is incorrect.

    It's really strange.