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.

Help with ALSA conversion for audio playback application on DM365



Team,

 

I need some help with below request for a customer that is trying to convert their audio playback application from OSS to ALSA. Please see below details. Can you please assist?

Thanks,

Harini

 

We are converting the Audio Playback application from

OSS to ALSA. In the process I have run into a problem getting the audio

device to actually play the data. The application opens the

"plughw:0,0" alsa device. It uses the snd_pcm_writei function to send

the decoded audio frames to the device. Using printk statements and

looking at the code I have determined that the data is written to the

internal 8K buffer. I see each write add data to the buffer, however, I

can't see any mechanism to take the data out of the buffer and transfer

it to the audio device. I am hoping that someone at TI can give me

information about how data is copied out of the internal buffer. I have

provided the setup code for the audio driver at both kernel level and

the application level along with the details provided from the /proc

file system.

 

Kernel Setup

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

static int __init evm_init(void)

{

int ret = 0;

int res_size;

struct snd_soc_device *evm_snd_devdata;

struct resource *evm_snd_resources;

struct evm_snd_platform_data *evm_snd_data;

evm_snd_devdata = &dm365_atlas_snd_devdata;

evm_snd_resources = dm365_evm_snd_resources;

res_size = ARRAY_SIZE(dm365_evm_snd_resources);

evm_snd_data = &dm365_evm_snd_data;

evm_codec_clock = DM365_EVM_CODEC_CLOCK;

evm_snd_device = platform_device_alloc("soc-audio", -1);

if (!evm_snd_device)

return -ENOMEM;

platform_set_drvdata(evm_snd_device, evm_snd_devdata);

evm_snd_devdata->dev = &evm_snd_device->dev;

evm_snd_device->dev.platform_data = evm_snd_data;

ret = platform_device_add_resources(evm_snd_device,

evm_snd_resources,

res_size);

if (ret) {

platform_device_put(evm_snd_device);

return ret;

}

ret = platform_device_add(evm_snd_device);

if (ret)

platform_device_put(evm_snd_device);

return ret;

}

/*

--------------------------------------------------------------------*/

evm_snd_devdata = &dm365_atlas_snd_devdata;

static struct snd_soc_device dm365_atlas_snd_devdata = {

.machine = &dm365_snd_soc_machine_atlas,

// see below

.platform = &davinci_soc_platform,

// see below

.codec_dev = &soc_codec_dev_cs4251,

// see below

.codec_data = &dm365_evm_aic3x_setup,

// see below

};

static struct snd_soc_machine dm365_snd_soc_machine_atlas = {

.name = "DaVinci DM365 ATLAS",

.dai_link = &davinci_atlas_dai,

// see below

.num_links = 1,

};

static struct snd_soc_dai_link davinci_atlas_dai = {

.name = "CS4251",

.stream_name = "CS4251_AIC",

.cpu_dai = davinci_i2s_dai,

// see below

.codec_dai = &cs4251_dai,

// see below

.init = atlas_cs4251_init,

// davinci_evm.c (function)

.ops = &evm_ops,

// see below

};

struct snd_soc_cpu_dai davinci_i2s_dai[] = {

{

.name = "davinci-i2s",

.id = 0,

.type = SND_SOC_DAI_I2S,

.probe = davinci_i2s_probe,

// davinci-i2s.c (function)

.remove = davinci_i2s_remove,

// davinci-i2s.c (function)

.playback = {

.channels_min = 1,

.channels_max = 2,

.rates = DAVINCI_I2S_RATES,

.formats = SNDRV_PCM_FMTBIT_S32_LE,},

.capture = {

.channels_min = 1,

.channels_max = 2,

.rates = DAVINCI_I2S_RATES,

.formats = SNDRV_PCM_FMTBIT_S32_LE,},

.ops = {

.startup = davinci_i2s_startup,

// davinci-i2s.c (function)

.trigger = davinci_i2s_trigger,

// davinci-i2s-mcbsp.c (function)

.hw_params = davinci_i2s_hw_params,},

// davinci-i2s-mcbsp.c (function)

.dai_ops = {

.set_fmt = davinci_i2s_set_dai_fmt,

// davnici-i2s-mcbsp.c (function)

},

},

};

struct snd_soc_codec_dai cs4251_dai = {

.name = "CS4251",

.playback = {

.stream_name = "Playback",

.channels_min = 2,

.channels_max = 2,

.rates = CS4251_RATES,

.formats = CS4251_FORMATS,},

.capture = {

.stream_name = "Capture",

.channels_min = 2,

.channels_max = 2,

.rates = CS4251_RATES,

.formats = CS4251_FORMATS,},

.dai_ops = {

.digital_mute = NULL,

.set_sysclk = cs4251_set_dai_sysclk,

// cs4251.c (function)

.set_fmt = NULL,

}

};

static struct snd_soc_ops evm_ops = {

.hw_params = evm_hw_params,

// davinci-evm.c (function)

};

struct snd_soc_platform davinci_soc_platform = {

.name = "davinci-audio",

.pcm_ops = &davinci_pcm_ops,

// see below

.pcm_new = davinci_pcm_new,

// davinci-pcm.c (function)

.pcm_free = davinci_pcm_free,

// davinci-pcm.c (function)

};

struct snd_pcm_ops davinci_pcm_ops = {

.open = davinci_pcm_open,

// davinci-pcm.c (function)

.close = davinci_pcm_close,

// davinci-pcm.c (function)

.ioctl = snd_pcm_lib_ioctl,

// pcm_lib.c (function)

.hw_params = davinci_pcm_hw_params,

// davinci-pcm.c (function)

.hw_free = davinci_pcm_hw_free,

// davinci-pcm.c (function)

.prepare = davinci_pcm_prepare,

// davinci-pcm.c (function)

.trigger = davinci_pcm_trigger,

// davinci-pcm.c (function)

.pointer = davinci_pcm_pointer,

// davinci-pcm.c (function)

.mmap = davinci_pcm_mmap,

// davinci-pcm.c (function)

};

struct snd_soc_codec_device soc_codec_dev_cs4251 = {

.probe = cs4251_probe,

// cs4251.c (function)

.remove = cs4251_remove,

// cs4251.c (function)

};

static struct aic3x_setup_data dm365_evm_aic3x_setup = {

.i2c_address = 0x18,

};

 

/*

--------------------------------------------------------------------*/

evm_snd_resources = dm365_evm_snd_resources;

res_size = ARRAY_SIZE(dm365_evm_snd_resources);

static struct resource dm365_evm_snd_resources[] = {

{

.start = DM365_MCBSP_BASE,

.end = DM365_MCBSP_BASE + SZ_8K - 1,

.flags = IORESOURCE_MEM,

},

};

 

/*

--------------------------------------------------------------------*/

evm_snd_data = &dm365_evm_snd_data;

static struct evm_snd_platform_data dm365_evm_snd_data = {

.clk_name = "McBSPCLK",

.tx_dma_ch = DM365_DMA_MCBSP_TX,

.rx_dma_ch = DM365_DMA_MCBSP_RX,

.tx_dma_offset = DAVINCI_MCBSP_DXR_REG,

.rx_dma_offset = DAVINCI_MCBSP_DRR_REG,

.codec_fmt = SND_SOC_DAIFMT_CBM_CFM | SND_SOC_DAIFMT_IB_IF,

.eventq_no = EVENTQ_3,

};

 

/*

--------------------------------------------------------------------*/

evm_codec_clock = DM365_EVM_CODEC_CLOCK;

 

/*

--------------------------------------------------------------------*/

evm_snd_device = platform_device_alloc("soc-audio", -1);

 

/*

--------------------------------------------------------------------*/

platform_set_drvdata (evm_snd_device, evm_snd_devdata);

evm_snd_devdata->dev = &evm_snd_device->dev;

evm_snd_device->dev.platform_data = evm_snd_data;

 

/*

--------------------------------------------------------------------*/

ret = platform_device_add_resources (evm_snd_device, evm_snd_resources,

res_size);

 

/*

--------------------------------------------------------------------*/

ret = platform_device_add (evm_snd_device);

 

Application Setup

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

Note that the error checking has been removed from the code below to

simplify the details, but in the actual code, each API call is followed

by a check of the return call and appropriate handling if it indicates a

failure. When the code runs, none of the functions called below fails.

typedef struct

{

snd_pcm_t *pAudioDeviceID;

snd_pcm_hw_params_t *pHardwareParams;

snd_pcm_sw_params_t *pSoftwareParams;

uint32_t nChannelCount;

uint32_t nSampleRate;

} AudioOutputParams_t;

AudioOutputParams_t pOutputParams_ = {0};

snd_pcm_open (&(pOutputParams_->pAudioDeviceID), AUDIO_DEVICE,

SND_PCM_STREAM_PLAYBACK, SND_PCM_ASYNC);

snd_pcm_hw_params_malloc (&(pOutputParams_->pHardwareParams));

snd_pcm_sw_params_malloc (&(pOutputParams_->pSoftwareParams));

snd_pcm_sw_params_malloc (&(pOutputParams_->pSoftwareParams));

snd_pcm_hw_params_any (pOutputParams_->pAudioDeviceID,

pOutputParams_->pHardwareParams);

snd_pcm_hw_params_set_access (pOutputParams_->pAudioDeviceID,

pOutputParams_->pHardwareParams,

SND_PCM_ACCESS_RW_INTERLEAVED);

snd_pcm_hw_params_set_format (pOutputParams_->pAudioDeviceID,

pOutputParams_->pHardwareParams,

SND_PCM_FORMAT_S16_LE);

snd_pcm_hw_params_set_channels (pOutputParams_->pAudioDeviceID,

 

pOutputParams_->pHardwareParams,

 

pOutputParams_->nChannelCount);

snd_pcm_hw_params_set_rate_near (pOutputParams_->pAudioDeviceID,

 

pOutputParams_->pHardwareParams,

&pOutputParams_->nSampleRate,

&nDatavalue);

snd_pcm_hw_params_set_period_size_near (pOutputParams_->pAudioDeviceID,

 

pOutputParams_->pHardwareParams,

&nPeriodSize,

&nDatavalue);

snd_pcm_hw_params (pOutputParams_->pAudioDeviceID,

pOutputParams_->pHardwareParams);

snd_pcm_sw_params_current (pOutputParams_->pAudioDeviceID,

pOutputParams_->pSoftwareParams);

snd_pcm_sw_params_get_xfer_align (pOutputParams_->pSoftwareParams,

&tTransferAlig);

snd_pcm_sw_params_set_start_threshold (pOutputParams_->pAudioDeviceID,

 

pOutputParams_->pSoftwareParams, 0U);

snd_pcm_sw_params (pOutputParams_->pAudioDeviceID,

pOutputParams_->pSoftwareParams);

 

Details from the /proc file system:

# cat /proc/asound/cards

0 [ATLAS ]: cs4251 - DaVinci DM365 ATLAS

DaVinci DM365 ATLAS (cs4251)

# cat /proc/asound/devices

2: : timer

3: [ 0- 0]: digital audio playback

4: [ 0- 0]: digital audio capture

5: [ 0] : control

# cat /proc/asound/card0/id

ATLAS

# cat /proc/asound/card0/pcm0p/info

card: 0

device: 0

subdevice: 0

stream: PLAYBACK

id: CS4251_AIC CS4251-I2S-0

name: CS4251-0

subname: subdevice #0

class: 0

subclass: 0

subdevices_count: 1

subdevices_avail: 1

# cat /proc/asound/card0/pcm0p/sub0/hw_params

closed

# cat /proc/asound/card0/pcm0p/sub0/info

card: 0

device: 0

subdevice: 0

stream: PLAYBACK

id: CS4251_AIC CS4251-I2S-0

name: CS4251-0

subname: subdevice #0

class: 0

subclass: 0

subdevices_count: 1

subdevices_avail: 1

# cat /proc/asound/card0/pcm0p/sub0/status

closed

# cat /proc/asound/card0/pcm0p/sub0/sw_params

closed

--

  • Hi,

    Can you ask them to run a simple speaker-test or use aplay for the audio playback (both part of alsa-utils package)... this would help in finding out whether the issue is with the application or the driver.

     

    The data transfer to and from the buffer is done using edma (davinci_pcm_ops) in davinci-pcm.c

     

    Regards,

    Vaibhav

  • The hardware setup is a proprietary board and for some reason the alsa-utils package was never built, therefore, I can't run aplay to isolate the problem.  Unfortunately, the experts with the build package are on vacation, as was I, thus the delay in responding.  This project is not my only responsibility and I often get pulled off to work on higher priority tasks.  I am still interested in any information that the forum can provide.

  • Hi,

     

    If your app does not return any error, the problem could be as simple as the output being muted. You'll have to check the codec driver for the default behavior.

    In case there is some other issue please post the appropriate error log.

     

    Regards,

    Vaibhav

  • I was working on another project so that now I have time to look at this problem again I can answer your questions and post some of my own.

    The output function calls the snd_pcm_writei function and analyzes the returned value.  The internal ring buffer is (8k - 32) frames  in length and each writei function sends 1K frames of data.  The return code for the first seven calls to writei is 1024 as I would expect, the eighth call returns 992 which is 32 bytes less than 8K. Every call after that returns -11 which is the EAGAIN errno.

    As stated in the original post, poking through the code and adding appropriate printk statements I can see that the internal ring buffer is filled, thus the EAGAIN response code.  Further analysis shows that the code sets up a DMA transfer and expects the DMA engine to pull data out of the buffer.  The problem is that the DMA engine either isn't aware that there is data in the buffer to be transmitted, the engine isn't enabled, or the DMA engine doesn't know where to send the data.

    What I need to know, is how is the DMA destination setup?  I don't see anything in the initialization code that would indicate what to do with the data after it is placed in the internal buffer.  Is this a configuration option in the alsa_conf file?  Is there something that needs to be turned on in the kernel config?

     

  • In the original post you had mentioned that the data was being written to the buffer so i was suspecting it might be a DMA issue.

    The DMA related info is added as the resource for the platform device dm365_asp_device in /arch/arm/mach-davinci/dm365.c. The function dm365_init_asp() registers the platform device and the corresponding platform driver is present in /sound/soc/davinci/davinci-i2s.c.

    The ALSA layer takes care of the driver binding and calling the appropriate functions for data transfer. The data transfer to and from the buffer is done using edma (davinci_pcm_ops) in davinci-pcm.c as i had mentioned in my earlier post.

    You should also verify that the resources, EDMA event mapping and the clks are setup properly.

     

    Regards,

    Vaibhav

  • Hello,

    Please reply with which version of the DVSDK and PSP you are using. We have reference code on how to hook up the codecs to the alsa driver, but I need to know which versions you are using before I can help.

    Regards, Niclas

  • Hi,

    The DVSDK version is UDWORKS  2.10.1.18. The MontaVista PRO 5.0 distribution is used for the tool suite,  file system, and kernel version  2.6.18+.  Any reference code would be helpful for alsa - thanks.

    Looking at the I2S interface on the dm365 pins of our custom board, the clocking was not working. Changing the file sound/soc/davinci/davinci-i2s-mcbsp.c  in the routine davinci_i2s_set_dai_fmt(), registers DAVINCI_MCBSP_PCR_REG (added PCR_FSXM | PCR_CLKXM) and DAVINCI_MCBSP_SRGR_REG (cleared SRGR_CLKSM and set SRGR_FSBM, SRGR_CLKGDV(3)) allowed the I2S pins to change state.

    A transport stream is encoded on our custom board. Using vlc to playback, the audio sounds correct.

    Using this transport stream file, the audio stream is captured and written to a file after the AAC decoder function. A wav header is then added to the file and this is used to play in aplay. However the sound output is corrupted. I am attaching two files: the source that is played from aplay and a recording from our speaker on the custom board of aplay output so you can hear dm365 output differences. Playing the wav file on a PC using VLC, the sound is not corrupted. The audio in the file is at a higher pitch than the source.

    One file is attached to this post (audio48khz-system.wav. This file is the recording of the playback output from our board. and the second will follow in the next post which is the source file played through the custom board.

    I would like to focus at this time on two main issues:

    1) aplay application to correctly play sound file.

    2) Implementing ALSA calls in our application to correctly play audio from a transport stream.

  • audio48Khz.wav - source file captured from transport stream and wav header added.

  • Hello,

    In DVSDK 2.10 (Montavista based) there are two files which implements the same functions but one using OSS and one using ALSA. You could use these as a reference:

    dvsdk_2_10_01_18/dmai_1_21_00_10/packages/ti/sdo/dmai/linux/Sound_alsa.c and Sound_oss.c.

    There is also an application decoding audio, but you'll have to add your own .cfg file for dm365:

    dvsdk_2_10_01_18/dmai_1_21_00_10/packages/ti/sdo/dmai/apps/audio_decode1

    Niclas

  • Generating a triangle wav swept in frequency that sampled at 48Khz (rate of I2S interface) works correctly, while the generated triangle wav swept in frequency sampled at 22.05 KHz exhibits the noise heard from the audio generated on our board.

    It appears that the rate control in the driver is not configurable.

    # ./aplay -r 48000 triangle221.wav -v
    Playing WAVE 'triangle221.wav' : Signed 32 bit Little Endian, Rate 22050 Hz, Stereo
    Plug PCM: Hardware PCM card 0 'DaVinci DM365 ATLAS' device 0 subdevice 0
    Its setup is:
      stream       : PLAYBACK
      access       : RW_INTERLEAVED
      format       : S32_LE
      subformat    : STD
      channels     : 2
      rate         : 22050
      exact rate   : 22050 (22050/1)
      msbits       : 32
      buffer_size  : 16384
      period_size  : 1024
      period_time  : 46439
      tick_time    : 10000
      tstamp_mode  : NONE
      period_step  : 1
      sleep_min    : 0
      avail_min    : 1024
      xfer_align   : 1024
      start_threshold  : 16384
      stop_threshold   : 16384
      silence_threshold: 0
      silence_size : 0
      boundary     : 1073741824

    No header - only raw data. Specifying the rate is not changing what is played.

    # ./aplay -v -r 48000 postman-nh.raw
    Playing raw data 'postman-nh.raw' : Unsigned 8 bit, Rate 48000 Hz, Mono
    Plug PCM: Route conversion PCM (sformat=U8)
      Transformation table:
        0 <- 0
        1 <- 0
    Its setup is:
      stream       : PLAYBACK
      access       : RW_INTERLEAVED
      format       : U8
      subformat    : STD
      channels     : 1
      rate         : 48000
      exact rate   : 48000 (48000/1)
      msbits       : 8
      buffer_size  : 16384
      period_size  : 1024
      period_time  : 21333
      tick_time    : 10000
      tstamp_mode  : NONE
      period_step  : 1
      sleep_min    : 0
      avail_min    : 1024
      xfer_align   : 1024
      start_threshold  : 16384
      stop_threshold   : 16384
      silence_threshold: 0
      silence_size : 0
      boundary     : 1073741824
    Slave: Linear conversion PCM (S32_LE)
    Its setup is:
      stream       : PLAYBACK
      access       : MMAP_INTERLEAVED
      format       : U8
      subformat    : STD
      channels     : 2
      rate         : 48000
      exact rate   : 48000 (48000/1)
      msbits       : 8
      buffer_size  : 16384
      period_size  : 1024
      period_time  : 21333
      tick_time    : 10000
      tstamp_mode  : NONE
      period_step  : 1
      sleep_min    : 0
      avail_min    : 1024
      xfer_align   : 1024
      start_threshold  : 16384
      stop_threshold   : 16384
      silence_threshold: 0
      silence_size : 0
      boundary     : 1073741824
    Slave: Hardware PCM card 0 'DaVinci DM365 ATLAS' device 0 subdevice 0
    Its setup is:
      stream       : PLAYBACK
      access       : MMAP_INTERLEAVED
      format       : S32_LE
      subformat    : STD
      channels     : 2
      rate         : 48000
      exact rate   : 48000 (48000/1)
      msbits       : 32
      buffer_size  : 16384
      period_size  : 1024
      period_time  : 21333
      tick_time    : 10000
      tstamp_mode  : NONE
      period_step  : 1
      sleep_min    : 0
      avail_min    : 1024
      xfer_align   : 1024
      start_threshold  : 16384
      stop_threshold   : 16384
      silence_threshold: 0
      silence_size : 0
      boundary     : 1073741824

     

    Using CoolEdit, the pcm samples are played correctly.

  • Update:

    Using a scope to look at the McBSP I2S data output, the data was delayed 1-bit. In sound/soc/davinci/davinci-i2s-mcbsp.c davinci_i2s_hw_params(), removed DAVINCI_MCBSP_XCR_XDATDLY(1) when setting register DAVINCI_MCBSP_XCR_REG.

    aplay is correctly playing captured audio.

    Next step is to integrate the ALSA driver into our application. I'll use the ALSA DVSDK reference provided in an earlier post as a starting point.

    Thanks,

    -Curtis

  • Using  dvsdk_2_10_01_18/dmai_1_21_00_10/packages/ti/sdo/dmai/linux/Sound_alsa.c as a reference, I implemented the ALSA calls into our application. The playback of the audio is all noise. Any suggestions for correct playback?

     

    Occasionally when running a segmentation fault occurs, I have provided the stack trace from the core:

     

     gdb tsApp core.tsApp.619
    GNU gdb 6.6.50.20070301 (MontaVista 6.6.50-1.0.0.0702771 2007-03-10)
    Copyright (C) 2007 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB.  Type "show warranty" for details.
    This GDB was configured as "armv5tl-montavista-linux-gnueabi"...
    (no debugging symbols found)
    Using host libthread_db library "/lib/libthread_db.so.1".

    warning: exec file is newer than core file.
    Reading symbols from /lib/libpthread.so.0...Reading symbols from /usr/lib/debug/lib/libpthread-2.5.90.so.debug...done.
    done.
    Loaded symbols for /lib/libpthread.so.0
    Reading symbols from /usr/lib/libxml2.so.2...Reading symbols from /usr/lib/debug/usr/lib/libxml2.so.2.6.26.debug...done.
    done.
    Loaded symbols for /usr/lib/libxml2.so.2
    Reading symbols from /usr/lib/libasound.so.2...Reading symbols from /usr/lib/debug/usr/lib/libasound.so.2.0.0.debug...done.
    done.
    Loaded symbols for /usr/lib/libasound.so.2
    Reading symbols from /usr/lib/libstdc++.so.6...Reading symbols from /usr/lib/debug/usr/lib/libstdc++.so.6.0.9.debug...done.
    done.
    Loaded symbols for /usr/lib/libstdc++.so.6
    Reading symbols from /lib/libm.so.6...Reading symbols from /usr/lib/debug/lib/libm-2.5.90.so.debug...done.
    done.
    Loaded symbols for /lib/libm.so.6
    Reading symbols from /lib/libgcc_s.so.1...Reading symbols from /usr/lib/debug/lib/libgcc_s.so.1.debug...done.
    done.
    Loaded symbols for /lib/libgcc_s.so.1
    Reading symbols from /lib/libc.so.6...Reading symbols from /usr/lib/debug/lib/libc-2.5.90.so.debug...done.
    done.
    Loaded symbols for /lib/libc.so.6
    Reading symbols from /lib/ld-linux.so.3...Reading symbols from /usr/lib/debug/lib/ld-2.5.90.so.debug...Error while reading shared library symbols:
    Dwarf Error: Can't read DWARF data from '/usr/lib/debug/lib/ld-2.5.90.so.debug'
    Reading symbols from /lib/libdl.so.2...Reading symbols from /usr/lib/debug/lib/libdl-2.5.90.so.debug...Error while reading shared library symbols:
    Dwarf Error: Can't read DWARF data from '/usr/lib/debug/lib/libdl-2.5.90.so.debug'
    Reading symbols from /usr/lib/libz.so.1...Reading symbols from /usr/lib/debug/usr/lib/libz.so.1.2.3.debug...done.
    done.
    Loaded symbols for /usr/lib/libz.so.1
    Core was generated by `tsApp /tmp/sd_decoder_config.xml'.
    Program terminated with signal 11, Segmentation fault.
    #0  snd_pcm_linear_convert (dst_areas=<value optimized out>, dst_offset=1156025640,
        src_areas=<value optimized out>, src_offset=4096, channels=3002000, frames=4096, convidx=1075536928)
        at ../../../src/pcm/plugin_ops.h:325
    325     ../../../src/pcm/plugin_ops.h: No such file or directory.
            in ../../../src/pcm/plugin_ops.h
    (gdb) bt
    #0  snd_pcm_linear_convert (dst_areas=<value optimized out>, dst_offset=1156025640,
        src_areas=<value optimized out>, src_offset=4096, channels=3002000, frames=4096, convidx=1075536928)
        at ../../../src/pcm/plugin_ops.h:325
    #1  0x401b8d54 in snd_pcm_linear_write_areas (pcm=0x401b8d54, areas=0x44e78d28, offset=0, size=4096,
        slave_areas=0x401b8788, slave_offset=64, slave_sizep=0x44e78cb4) at ../../../src/pcm/pcm_linear.c:365
    #2  0x401b6420 in snd_pcm_plugin_write_areas (pcm=0x2dcf08, areas=0x2dcf08, offset=0, size=4096)
        at ../../../src/pcm/pcm_plugin.c:273
    #3  0x401a9fc8 in snd_pcm_write_areas (pcm=0x2dcf08, areas=0x44e78d28, offset=0, size=4096,
        func=0x401b6390 <snd_pcm_plugin_write_areas>) at ../../../src/pcm/pcm.c:6451
    #4  0x401b5ad8 in snd_pcm_plugin_writei (pcm=0x2dcf08, buffer=<value optimized out>, size=4096)
        at ../../../src/pcm/pcm_plugin.c:352
    #5  0x401a3d8c in snd_pcm_writei (pcm=0x1000, buffer=0x40, size=1202794496) at ../../../src/pcm/pcm_local.h:401
    #6  0x0002c86c in ?? ()

  •  

    TI Team - Can you help with above for Curtis? They are in critical time crunch mode to release their product. Thanks!!

  • I have the audio path working.

    The noise was due to an incorrect count provided in snd_pcm_writei(). More data was read than was valid in the buffer.

    I have not seen a crash over many playback tests - so hopefully all is solid.

     

  •  

    TI Team - In further talking with Curtis, there is one more issue below we need your help with.

    It has been noticed that when playing back audio the channels are swapped - sometimes.  The swapped channels occur from a system  startup or at runtime – but not always.

    Curtis found http://processors.wiki.ti.com/index.php?title=McBSP_Channel_Swapping  and will read through to see if it provides a solution.

     Is there any other information that could be helpful?