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.

A problem when use DMsoc voice codec on Dm365

Other Parts Discussed in Thread: TVP7002

I want to use the M1(mic) on evm as my sound input and SKP1(speaker) as my sound output on dm365, I have configed the kernel and the demo application to run the audio_playback run well. And modified the demo of decode could play the example sound file davincieffect.g711 well, but when I modified and run the encode application to use new sound device with the command ./encode -s test.g711, it could not encode the speech buffer, the message was as follows:

Error: Failed to encode speech buffer

when I modified to use the default sound device to run the encode application, it will run well.

Does anybody know why this happend?

  • zhenhong said:

    but when I modified and run the encode application to use new sound device

    I am not sure I fully understand your complete description of the problem, but you should not need to modify encode demo to use MIC as your audio input source for encoding; MIC input is the default in encode demo; in addition, encode demo offers the '-l' option if you prefer to use line-in instead of MIC input.  This is described in the encode.txt file accompanying the demo.

  • Hi Juan,

    I mean that I want to use the SoC voicecodec, not by ac3101, so I modified the encode demo as  follows:

        sAttrs.soundInput = envp->soundInput;
        sAttrs.soundStd = Sound_Std_ALSA;
        sAttrs.mode = Sound_Mode_INPUT;

    only added the middle line. That's say the speech data will get from Sound_Std_ALSA, But why the Senc1_process function run failed? It's should have nothing to with the hardware I think.

  • A little up in this message. Since I tried to use the voice codec on the DVEVM, by firstly recompiling anf flashing a new kernel incorporating the CQ93VC driver (voice codec).

    A question about it : the demo encode and decode are not meant to work with the internal codec right ?

    So an answer on the problem will be useful too.

    reda

  • user space applications such as encode and decode demos control audio and video thru Linux Standardized APIs; in the audio side, we provide OSS or ALSA drivers depending on the version of the DVSDK you are using; however, since ALSA has an OSS emulation layer, I believe the demos may still use OSS APIs.  But this is worth mentioning as future versions of the software (including demos) will likely shift entirely towards ALSA APIs.  

    That said, the hardware part underneath or driver should not matter so long as the proper device (/dev/xxx)  nodes and APIs are available to the user space applications.

  • Hello all,

    Same problem met when doing changes in code, and having new kernel with internal voice codec included.

    Same error message on the console at runtime.

    1-Is there a description somewhere of the parameters to pass to the speech encoder (in a pdf document preferably). I have not found this in the DMAI html documentation.

    2-There is also another point about the voice codec on the DVEVM 365 : the sound quality is awful it sounds like "a space invader voice" when I output the davinci_effect.g711 file in dvsdk release. I have changed the sampling frequency to 16kHz and quality has not changed a lot.  (And of course could not test the encode). Is that the ame for you, or did I need to set another parameter somewhere (hence my question about documentation)

    Thank you

  • >1-Is there a description somewhere of the parameters to pass to the speech encoder (in a pdf document preferably). I have not found this in the DMAI html documentation.

    I have found some indication in the XDAIS API interface.

    For 2- still no confirmation

  • Any infos about this sound quality point ?

    2-There is also another point about the voice codec on the DVEVM 365 : the sound quality is awful it sounds like "a space invader voice" when I output the davinci_effect.g711 file in dvsdk release. I have changed the sampling frequency to 16kHz and quality has not changed a lot.  (And of course could not test the encode).

  • Hi,

    For the voice playback issue, is the output coming out as a different sampling frequency output? I am wondering if the sampling clock is not correctly programmed.

     

    Can you please share the messages printed on the terminal during boot-up? I want to verify the different clock settings done for voice codec. Also, please mention the DVSDK and LSP versions that you are using for DM365.

    For the run-time change of sampling rate, i need to re-verify if the voice codec has IOCTL to change sampling frequency.

     

    Regards,

    Anshuman

  • Hello Anshuman,

    Anshuman Saxena said:

    Hi,

    For the voice playback issue, is the output coming out as a different sampling frequency output? I am wondering if the sampling clock is not correctly programmed.

     

    My sampling frequency was set into the speech.c file in the decode directory in the dvsdk_demos directory.

    At first trial I let the default sampling which was 8kHz by default, but in front of the bad quality i changed it the highest frequency possible in hardware for the internal voice codec, = 16 kHz.

    //Sample Code in speech.c  *speechThrFxn(Void *arg) function is :

        /* Create the sound device */
        //sAttrs.sampleRate = 8000;
        sAttrs.sampleRate = 16000;
        sAttrs.mode = Sound_Mode_OUTPUT;
        hSound = Sound_create(&sAttrs);

    //end of sample code

    But when playing the file it was not different. Always this "dark vador" speech. (file was davinci_effect.g711 - I doubt it is dark vador who speaks on it !).

    But maybe that the alsa driver for the internal codec is not dealing properly with the sampling frequency, or perhaps the decode example is not properly configuring this device (maybe other parameters are needed).

     

    Anshuman Saxena said:

    Can you please share the messages printed on the terminal during boot-up? I want to verify the different clock settings done for voice codec. Also, please mention the DVSDK and LSP versions that you are using for DM365.

    For the run-time change of sampling rate, i need to re-verify if the voice codec has IOCTL to change sampling frequency.

    my boot up kernel message section concerning ALSA device is as follows :

    -------------------------

    Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50 2006 UTC).
    ASoC version 0.13.1
    CQ0093 Voice Codec 0.1
    asoc: cq93vc <-> davinci-vcif mapping ok
    ALSA device list:
      #0: On-chip voice codec (cq93vc)
    ---------------------------

    As you see there is no information about the sampling frequency.

     

    on proc/version i get this info:

    LSP version is : 2.6.18_pro500 ; on montavista 4.2.0-16.0.3 (strange point, because my toolchain directory is in /opt/mv_pro_5.0 (and not 4.2)

    and my DVSDK version is : 2.10.1.18

     

    As another point about this problem, the encode demo is not working properly with the voice codec (but is roughly ok with the external codec).

    Hope this can help. And thank you for your answer anyway.

    reda

     

  • Hello Reda,

    Actually, i wanted to see the log of the complete bootup sequence. We print lot of messages about the overall clocking details when kernel boots up.

    also, i was interested in getting the value of the register PERI_CLKCTRL (address 0x1c40048). You can use the "readl" utility that comes with DVSDK filesystem to read that register from the user prompt of linux kernel on DM365.

    Ideally, the input clock to voice codec should be 2048KHz and sampling rate is calculated as 2048KHz/256 = 8KHz.

    The message printed in kernel bootup shows a clock value for voicerate and that divided by PERI_CLKCTRL[15:7] should be equal to 2048KHz.

    Based on the log of the kernel boot-up and the value of this register, i can confirm if the problem is due to sampling frequency (which most likely is the case). i am pretty sure that the IOCTL for changing sampling frequency for the voice codec is not implemented so we might not be able to see any difference from 8KHz to 16KHz.

     

    Regards,

    Anshuman

  • Hello Anshuman

    Anshuman Saxena said:

    Actually, i wanted to see the log of the complete bootup sequence. We print lot of messages about the overall clocking details when kernel boots up.

    Here it is

    ---------------------------------------------------------------------------------------------------------------------------------

    Linux version 2.6.18_pro500-davinci_evm-arm_v5t_le (easii@localhost.localdomain) (version gcc 4.2.0 (MontaVista 4.2.0-16.0.32.0801914 2008-08-30)) #1 PREEMPT Mon Jan 25 18:27:57 CET 2010
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    Machine: DaVinci DM365 EVM
    Memory policy: ECC disabled, Data cache writeback
    On node 0 totalpages: 19456
      DMA zone: 19456 pages, LIFO batch:3
    DaVinci DM0365 variant 0x8
    PLL0: fixedrate: 24000000, commonrate: 121500000, vpssrate: 243000000
    PLL0: vencrate_sd: 27000000, ddrrate: 243000000 mmcsdrate: 121500000
    PLL1: armrate: 297000000, voicerate: 90009000, vencrate_hd: 74250000
    CPU0: D VIVT write-back cache
    CPU0: I cache: 16384 bytes, associativity 4, 32 byte lines, 128 sets
    CPU0: D cache: 8192 bytes, associativity 4, 32 byte lines, 64 sets
    Built 1 zonelists.  Total pages: 19456
    Kernel command line: mem=76M console=ttyS0,115200n8 noinitrd rw ip=dhcp root=/dev/nfs nfsroot=192.2.5.23:/home/easii/workdir/filesys/,nolock
    PID hash table entries: 512 (order: 9, 2048 bytes)
    Clock event device timer0_0 configured with caps set: 07
    Console: colour dummy device 80x30
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory: 76MB = 76MB total
    Memory: 72576KB available (3505K code, 710K data, 200K init)
    Calibrating delay loop... 148.27 BogoMIPS (lpj=741376)
    Security Framework v1.0.0 initialized
    Capability LSM initialized
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    NET: Registered protocol family 16
    MUX: initialized SPI0_SCLK
    MUX: initialized SPI0_SDO)
    MUX: initialized SPI0_SDI
    MUX: initialized SPI0_SDENA0
    DaVinci: 104 gpio irqs
    MUX: initialized GPIO20
    MUX: initialized I2C_SCL
    DM365 IPIPE initialized in Single Shot mode
    Generic PHY: Registered new driver
    ch0 default output "COMPOSITE", mode "NTSC"
    <vpbe_encoder_setoutput>
    Setting output to Composite
    Start of vpbe_encoder_setmode..
    </vpbe_encoder_setmode>
    </vpbe_encoder_setoutput>
    VPBE Encoder initialized
    <vpbe_encoder_enumoutput>
    </vpbe_encoder_enumoutput>
    <vpbe_encoder_setoutput>
    Setting output to Composite
    Start of vpbe_encoder_setmode..
    </vpbe_encoder_setmode>
    </vpbe_encoder_setoutput>
    Start of vpbe_encoder_setmode..
    </vpbe_encoder_setmode>
    <vpbe_encoder_getoutput>
    </vpbe_encoder_getoutput>
    <vpbe_encoder_getmode>
    <vpbe_encoder_getmode/>
    VPBE Encoder Initialized
    LogicPD encoder initialized
    Avnetlcd encoder initialized
    dm365_afew_hw_init
    SCSI subsystem initialized
    usbcore: registered new driver usbfs
    usbcore: registered new driver hub
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 4096 (order: 2, 16384 bytes)
    TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    TCP: Hash tables configured (established 4096 bind 2048)
    TCP reno registered
    VFS: Disk quotas dquot_6.5.1
    Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    squashfs: version 3.1 (2006/08/19) Phillip Lougher
    JFFS2 version 2.2. (NAND) (C) 2001-2006 Red Hat, Inc.
    yaffs Jan 25 2010 18:31:16 Installing.
    SGI XFS with no debug enabled
    Initializing Cryptographic API
    io scheduler noop registered
    io scheduler anticipatory registered (default)
    <vpbe_encoder_getmode>
    <vpbe_encoder_getmode/>
    <vpbe_encoder_getmode>
    <vpbe_encoder_getmode/>
    <vpbe_encoder_getmode>
    <vpbe_encoder_getmode/>
    davincifb davincifb.0: dm_osd0_fb: 720x480x16@0,0 with framebuffer size 675KB
    davincifb davincifb.0: dm_vid0_fb: 0x0x16@0,0 with framebuffer size 1020KB
    <vpbe_encoder_getmode>
    <vpbe_encoder_getmode/>
    <vpbe_encoder_getmode>
    <vpbe_encoder_getmode/>
    davincifb davincifb.0: dm_osd1_fb: 720x480x4@0,0 with framebuffer size 675KB
    davincifb davincifb.0: dm_vid1_fb: 0x0x16@0,0 with framebuffer size 1020KB
    DAVINCI-WDT: DaVinci Watchdog Timer: heartbeat 60 sec
    facedetect major#: 253, minor# 0
    facedetect driver registered
    imp serializer initialized
    davinci_previewer initialized
    davinci_resizer initialized
    Serial: 8250/16550 driver $Revision: 1.90 $ 2 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO map 0x1c20000 mem 0xfbc20000 (irq = 40) is a 16550A
    serial8250.0: ttyS1 at MMIO map 0x1d06000 mem 0xfbd06000 (irq = 41) is a 16550A
    RAMDISK driver initialized: 1 RAM disks of 32768K size 1024 blocksize
    Davinci EMAC MII Bus: probed
    MAC address is 00:0e:99:02:cc:27
    TI DaVinci EMAC Linux version updated 4.0
    netconsole: not configured, aborting
    Linux video capture interface: v2.00
    vpfe_init

    starting ccdc_reset...<7>
    End of ccdc_reset...<5>vpfe_probe
    vpfe ccdc capture vpfe ccdc capture.1: vpif_register_decoder: decoder = MT9T001
    vpfe ccdc capture vpfe ccdc capture.1: vpif_register_decoder: decoder = MT9P031
    TVP514X : nummber of channels = 1
    vpfe ccdc capture vpfe ccdc capture.1: vpif_register_decoder: decoder = TVP514X
    <davinci_display_init>
    Trying to register davinci display video device.
    layer=c49ba600,layer->video_dev=c49ba760
    Trying to register davinci display video device.
    layer=c49ba400,layer->video_dev=c49ba560
    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded
    </davinci_init>
    vpfe ccdc capture vpfe ccdc capture.1: vpif_register_decoder: decoder = TVP7002
    af major#: 250, minor# 0
    AF Driver initialized
    aew major#: 249, minor# 0
    AEW Driver initialized
    i2c /dev entries driver
    nand_davinci nand_davinci.0: Using 4-bit hardware ECC
    NAND device: Manufacturer ID: 0x2c, Chip ID: 0xd3 (Micron NAND 1GiB 3,3V 8-bit)
    2 NAND chips detected
    Bad block table not found for chip 0
    Bad block table not found for chip 1
    Bad block table not found for chip 0
    Bad block table not found for chip 1
    Scanning device for bad blocks
    Bad block table written to 0x3ffe0000, version 0x01
    Bad block table written to 0x3ffc0000, version 0x01
    Scanning device for bad blocks
    Bad block table written to 0x7ffe0000, version 0x01
    Bad block table written to 0x7ffc0000, version 0x01
    Creating 5 MTD partitions on "nand_davinci.0":
    0x00000000-0x003c0000 : "bootloader"
    0x003c0000-0x00400000 : "params"
    0x00400000-0x00800000 : "kernel"
    0x00800000-0x20800000 : "filesystem1"
    0x20800000-0x80000000 : "filesystem2"
    nand_davinci nand_davinci.0: hardware revision: 2.3
    dm_spi.0: davinci SPI Controller driver at 0xc501e000 (irq = 42) use_dma=0
    Initializing USB Mass Storage driver...
    usbcore: registered new driver usb-storage
    USB Mass Storage support registered.
    usbcore: registered new driver usbhid
    drivers/usb/input/hid-core.c: v2.6:USB HID core driver
    musb_hdrc: version 6.0, cppi-dma, host, debug=0
    MUX: initialized GPIO33
    musb_hdrc musb_hdrc: No DMA interrupt line
    musb_hdrc: ConfigData=0x06 (UTMI-8, dyn FIFOs, SoftConn)
    musb_hdrc: MHDRC RTL version 1.500
    musb_hdrc: setup fifo_mode 2
    musb_hdrc: 8/9 max ep, 3392/4096 memory
    musb_hdrc: hw_ep 0shared, max 64
    musb_hdrc: hw_ep 1tx, max 512
    musb_hdrc: hw_ep 1rx, max 512
    musb_hdrc: hw_ep 2tx, max 512
    musb_hdrc: hw_ep 2rx, max 512
    musb_hdrc: hw_ep 3tx, max 512
    musb_hdrc: hw_ep 3rx, max 512
    musb_hdrc: hw_ep 4shared, max 256
    musb_hdrc: USB Host mode controller at c5074000 using DMA, IRQ 12
    musb_hdrc musb_hdrc: MUSB HDRC host driver
    musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
    usb usb1: configuration #1 chosen from 1 choice
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    mice: PS/2 mouse device common for all mice
    davinci-mmc davinci-mmc.0: Supporting 4-bit mode
    davinci-mmc davinci-mmc.0: Using DMA mode
    Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50 2006 UTC).
    ASoC version 0.13.1
    CQ0093 Voice Codec 0.1
    asoc: cq93vc <-> davinci-vcif mapping ok
    ALSA device list:
      #0: On-chip voice codec (cq93vc)
    IPv4 over IPv4 tunneling driver
    TCP bic registered
    NET: Registered protocol family 1
    NET: Registered protocol family 17
    drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
    Time: timer0_1 clocksource has been installed.
    Clock event device timer0_0 configured with caps set: 08
    Switched to high resolution mode on CPU 0
    Sending DHCP requests .., OK
    IP-Config: Got DHCP answer from 0.0.0.0, my address is 192.2.5.51
    IP-Config: Complete:
          device=eth0, addr=192.2.5.51, mask=255.255.255.0, gw=192.2.5.254,
         host=192.2.5.51, domain=easiifr, nis-domain=(none),
         bootserver=0.0.0.0, rootserver=192.2.5.23, rootpath=
    Looking up port of RPC 100003/2 on 192.2.5.23
    Looking up port of RPC 100005/1 on 192.2.5.23
    VFS: Mounted root (nfs filesystem).
    Freeing init memory: 200K

    ---------------------------------------------------------------------------------------------------------------------------------

    we can see that the voicerate is at 9009000, so....

     

    Anshuman Saxena said:

    also, i was interested in getting the value of the register PERI_CLKCTRL (address 0x1c40048). You can use the "readl" utility that comes with DVSDK filesystem to read that register from the user prompt of linux kernel on DM365.

    Ideally, the input clock to voice codec should be 2048KHz and sampling rate is calculated as 2048KHz/256 = 8KHz.

    The message printed in kernel bootup shows a clock value for voicerate and that divided by PERI_CLKCTRL[15:7] should be equal to 2048KHz.

    There is no readl in my filesystem on DVEVM365 with the version of DVSDK already mentioned. If you have a link to source and makefile for this app or an executable to send so that i can give you the answer quickly it could be good.

    Thanks for your help

    reda

     

  • Reda,

    For speech playback issue, I solved that problem - darth vador's voice - by setting below in speech.c.

     

    66     /* Create the sound device */

     67     //jay_modified

     68     sAttrs.soundStd = Sound_Std_ALSA;

     69

     70     sAttrs.sampleRate = 8000;

     71     sAttrs.mode = Sound_Mode_OUTPUT;

     72     hSound = Sound_create(&sAttrs);

     

    With these modified settings, we heard normal speech from internal spk.

    Could you check this again?

     

    Thanks and Best Regards,

    SI.

  • Thank you Sung

    I will try this on monday.

    By the way can you tell me precisely where I can find all the parameters and their possible value for the sAttrs ? Is that in DMAI doc ? or elsewhere ?

    Best Regards

     

  • Reda,

    I think you can find these parameters in DMAI doc and in Sound.h(dmai_1_xx_xx_xx/packages/ti/sdo/dmai/sound.h).

     

    Best Regards,

    SI.

  • Hello Sung,

    I tried your indicated modification of the decode application code, and the dark vador effect has disappeared, but in exchange i got a speech with an accelerated voice, (like when you speak in helium gas). Very strange indeed.

    I try to recontact anshuman for reading the last peripheral we were looking.

    cheers and thank you for your help.

    reda

  • hello anshuman, do you have any readl application so that i can verify the peri_clkctrl register. to close this problem ?

    I have no readl application in my filesystem.

    thank you in advance

  • File Attached.. Please rename it to "readl"

     

    Regards,

    Anshuman

  • Reda,

    I am attaching the writel utility also, in case you wanna play with the PERI_CLKCTRL register value.

    rename it to "writel"

     

    Regards,

    Anshuman

  • Hello Anshuman,

    Thank you for the little applications :

     

    When I type

    readl 0x1c40048 0 1 (offset zero , count 1), i get this :

    243F0FFC,

    bit 15:7 are 0000 1111 1 = 31

    voicerate frequency is = 99 000 000 = 99MHz divided by 31 = around 3.2MHz...

    which i guess is wrong (different from 2048kHz)

    Indeed I need to get 99000000/2048000= 48 => bit 15:7 = 0001 1000 0 => periclk =   243F187C

     

    I played with the writel application and this is OK !!! No more dark vador, nor 'accelerated voice'

    Thanks to all

    Reda

  • Hi Reda,

    Yes, that is surely wrong.

    BTW, your earlier voice enc rate was printed as 90009000 (which is not 99MHz).

    so you should set bits 15:7 for the PERI_CLKCTRL as 90009000/2048000 = 44 - 1 = 43 = 0x2B

    So your PERI_CLKCTRL should look like 0x243F17FC.

    Regards,

    Anshuman

  • Hello anshuman,

    Thank you for correcting me for the figures.

    By the way, do you know where in the files, in kernel i can change this setting for not having to use it with writel application ? Somewhere where it is set up at boot ?

    Thanks a lot for your (efficient) support. The next problem I 'll face will be to find where the encoding is wrong with the voice codec as noted by another user.

    best regards

    reda

     

     

  • Reda,

    The PERI_CLKCTRL register is programmed in the UBL itself. Actually, it should be fixed in newer releases of UBL but that would be part of DVSDK 3.xx package that TI is releasing now.

    For you to change it in the code, i would suggest to update the UBL itself or else add it in the board-dm365-evm.c file of the kernel source.

    BTW, did changing the register value fix your problem or not, for the sampling rate?

     

    Regards,

    Anshuman

  • It worked with 243F187C, so it must work with your proposed value which is not so far from it.

    I will try to change it in board-dm365-evm.c

    Cheers and thank you for all

    Reda

  • Hi Anshuman,

    I modified board-dm365-evm.c and also arch/asm/hardware.h to set a define for the PERI_CLK ctrl register.

    kernel recompiled and installed with your value, and it works perfectly.

    Thank you a lot.

    Reda

  • Hi,

     I am trying to use the M1(MIC) on DM365 EVM as my sound input.  I modified the demo application to read data from MIC (M1) and write it to a file by commenting the encode call and its working fine.

    Now when I used the original speech.c (From demo application) file and just modified the sound input standard I am getting following error:

     

    Error: Failed to encode speech buffer  (Demo application prints)

    SPHENC1_process() failed with error (-1 ext: 0xa) (Print kept in DMAI source code) 

     

    Can anyone tell me what is going wrong with the encoding?

     

    Regards,

    Krunal Patil

  • I am trying to use the M1(MIC) on DM365 EVM as my sound input.  I modified the demo application to read data from MIC (M1) and write it to a file by commenting the encode call and its working fine.

    Now when I used the original speech.c (From demo application) file and just modified the sound input standard I am getting following error:

     

    Error: Failed to encode speech buffer  (Demo application prints)

    SPHENC1_process() failed with error (-1 ext: 0xa) (Print kept in DMAI source code) 

    the same question????

  • speech.c

    #define OUTBUFSIZE 160

    #define INBUFSIZE OUTBUFSIZE*2

    the problem :#define INBUFSIZE OUTBUFSIZE*2

    change it like this :#define INBUFSIZE OUTBUFSIZE//*2

    make it,the problem slolved.

  • I have made a big mistake
    if you want to use the g711 encode of the demo,you should make sure that there are the proper device on you board,checked the printf of starting:
    Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50
    2006 UTC).
    ASoC version 0.13.1
    AIC3X Audio Codec 0.2
    asoc: aic3x <-> davinci-i2s mapping ok
    ALSA device list:
      #0: DaVinci DM365 EVM (aic3x)

    but,the printf of starting on my board is:
    Advanced Linux Sound Architecture Driver Version 1.0.12rc1 (Thu Jun 22 13:55:50 2006 UTC).///////////////////////////////////
    ASoC version 0.13.1
    CQ0093 Voice Codec 0.1
    asoc: cq93vc <-> davinci-vcif mapping ok
    ALSA device list:
      #0: On-chip voice codec (cq93vc)

    the first device is aic3x and the next device is Voice Codec(in the dm365);
    it is clear that the decode/encode of g711 could not be used on my board.

    and how to use the Voice Codec
    if the /dev/dsp can be find on the system,write a file like this
    #include <stdio.h>
    #include <stdlib.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <string.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <sys/ioctl.h>
    #include <linux/soundcard.h>

    #define VOICE_DEVICE_FILENAME "/dev/dsp"

    int main()
    {
     int dev_fd;
     int status;
     int setting;
     unsigned char buf[100];
     
     dev_fd=open(VOICE_DEVICE_FILENAME,O_RDWR);//open the device
     if(dev_fd<0){
      printf("optn of %s\n",VOICE_DEVICE_FILENAME);
      exit(1);
     }
     setting=100;
     status=ioctl(dev_fd,SNDCTL_DSP_SETFRAGMENT,&setting);//set the buffer size
     if(status<0){
      printf("set the buffer error!\n");
      exit(1);
     }
     while(1){
      status=read(dev_fd,buf,sizeof(buf));//read
      if(status<0)
       printf("Read Audio dat Error!\n");
      status=write(dev_fd,buf,sizeof(buf));//write
      if(status<0)
       printf("Write Audio dat Error!\n");
      //printf("%d\n",status);
     }
     close(dev_fd);
     return 0;
    }

    build and run it,the sound can be heard.

  • Hi, Anshuman

    Sorry for poor english.

    We meet a speech problem like this. Could you help to analysis it and give some advises?

    When we decode the 1.g711:  ./decode -s 1.g711, then Failed to set buffer size (0) , got (32) on plughw:0,0 (Success). happened in dmai. And after 8 times sample decode, the progress will stop with @11,670,003us: [+7 T:0x408c9490] ti.sdo.dmai - [Sound] Failed to write to plughw:0,0 (Unknown error 4294967291-->it's an input/output error when we use stderror).The dvsdk is 2_10_01_18 and linux kernel is 2.6.18, we use DM365 with aic3101. The whole log we attached. Any other information you need, feel free to ask me.

    @1,231,698us: [+0 T:0x408c9490] CE - Engine_open> Enter('decode', 0x0, 0x408c8d5c)
    @1,231,980us: [+0 T:0x408c9490] CE - Engine_open> return(2026088)
    @1,233,647us: [+0 T:0x4001f950] CE - Engine_open> Enter('decode', 0x0, 0xbed3eb1c)
    @1,235,249us: [+0 T:0x4001f950] CE - Engine_open> return(2324344)
    @1,288,110us: [+2 T:0x408c9490] ti.sdo.dmai - [Sound] Failed to set buffer size (0) , got (32) on plughw:0,0 (Success)
    @1,370,324us: [+0 T:0x408c9490] ti.sdo.ce.speech1.SPHDEC1 - SPHDEC1_create> Enter (engine=0x1eea68, name='g711dec', params=0x408c8dfc)