Accessing TPS65950 codec from DSP for audio but still allow ARM access for power management

nautronixlogo.jpg

Hello,
I am a newbie that has asked a few questions recently, thanks to everyone who has replied. Unfortunately I have another question.

I am using the kernel from the Beagle website http://www.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git and
I have the kernel up and running, DSPLINK is installed and I can run the sample apps. I am not using the Codec engine, I only have 1 algorithm
to run on the DSP so I thought it was overkill for what I need.

I am looking at getting audio samples from the TPS65950 codec to memory that the DSP can access directly. I know that I could use ALSA calls under linux to get the data from the codec then use DSPLINK to send the data to the DSP but it seems a bit inefficient. I would rather the ARM did other things and not get involved in the transfer of audio data.

I was wondering if anyone could point me in the direction of some examples to access the codec at the driver level through the McBSP2 port, or even where this code is in the kernel tree ? It must be somewhere but I can’t find it. I am assuming (once I find it) that the ARM side can be modified to run on the DSP, hopefully it should just be a case of changing the McBSP register addresses to work in DSP address space.

I need access to the codec from the DSP side to handle audio data and from the ARM side to handle power management. So I’ll need some sort of mutex control through DSPLINK which I should manage.

I don’t know if there is a better way of doing this. Has anyone else had this problem ? I wondered whether I can set up a DMA channel from the codec to memory the DSP can access ?

Thanks
Paul McManus

Paul McManus
Senior Software Engineer
Tel: +44 (0) 1224 775700
Fax: +44 (0) 1224 775800
Email: Paul.McManus@nautronix.co.uk
Website: www.nautronix.com

316055f.jpg

nautronixfooter.jpg

This email is sent and received in accordance with the terms and conditions as defined on our website. To view click here
Nautronix is a public limited company registered in Scotland. Registered number: SC062293. Registered office: Nautronix House, Howe Moss Avenue, Kirkhill, Dyce, Aberdeen, AB21 0GP

Hi Paul,

I am looking at getting audio samples from the TPS65950 codec to memory that the DSP can access directly.

I'm working on exactly the same problem for a project. and I already
made some significant steps toward a solution.

I need access to the codec from the DSP side to handle audio data and from the ARM side to handle power management. So I'll need some sort of mutex control through DSPLINK which I should manage.
  

Direct access to the codec register interface from the DSP is not
possible. The TPS codec does a lot more than audio, and there is just
one I2C-bus that lets you talk to the chip. This bus is used from the
linux kernel. If you directly communicate with the I2C from the DSP you
will sooner or later get a collision with ARM I2C communication.

I've solved the problem by writing a kernel module that grants access to
the low-level I2C TPS functions to the linux user mode. A small ARM-code
acts like a bridge between DSPLINK and my kernel module and carries out
the communication.

I haven't yet found the time to stream audio, but I can blink and dim
the LED that is connected to the TPS. So the communication by itself
works and seems stable. If you want a copy of the code let me know.
Regarding output input/output: The important bits how to get the codec
initialized are in the linux kernel source as
./sound/soc/codecs/twl4030.c It looks straight forward to me.

Getting access to the McBSP from the DSP is much easier. Just compile a
kernel without sound and McBSP support and you're free to write to the
McBSP registers from the DSP. DMA control from the DSP is of course
possible as well.

I'm very interested in getting this running, but I don't find much time
for this at the moment. If you make any progress (e.g. setting up the
codec and output a test-tone or so) please let me know..

Cheers,
    Nils

nautronixlogo.jpg

Hello,
I am a newbie to linux . I am using the kernel from the Beagle website http://www.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git using version 2.6.33-rc1

I have the kernel up and running.

I can output a 1kHz sine wave using aplay. However I am having some problems with

I wanted to test whether the audio is correctly working on my board. So I ran

arecord -t wav -c 2 -r 44100 -f S16_LE -v k after a while I got

arecord: pcm_read:1347: read error: Input/output error.

I assumed a kernel config problem so I tried again with a prebuilt angstrom image and found that I could play & record.

Can anyone give me an idea of where I am going wrong. My .config includes

CONFIG_SOUND=y
CONFIG_SOUND_OSS_CORE=y
CONFIG_SND=y
CONFIG_SND_TIMER=y
CONFIG_SND_PCM=y
CONFIG_SND_HWDEP=y
CONFIG_SND_RAWMIDI=y
CONFIG_SND_SEQUENCER=m

CONFIG_SND_SEQ_DUMMY is not set

CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=y
CONFIG_SND_PCM_OSS=y
CONFIG_SND_PCM_OSS_PLUGINS=y
CONFIG_SND_SEQUENCER_OSS=y
CONFIG_SND_HRTIMER=m
CONFIG_SND_SEQ_HRTIMER_DEFAULT=y

CONFIG_SND_DYNAMIC_MINORS is not set

CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y

CONFIG_SND_VERBOSE_PRINTK is not set

CONFIG_SND_DEBUG is not set

CONFIG_SND_DRIVERS=y

CONFIG_SND_DUMMY is not set

CONFIG_SND_VIRMIDI is not set

CONFIG_SND_MTPAV is not set

CONFIG_SND_SERIAL_U16550 is not set

CONFIG_SND_MPU401 is not set

CONFIG_SND_ARM is not set

CONFIG_SND_SPI=y
CONFIG_SND_USB=y
CONFIG_SND_USB_AUDIO=y
CONFIG_SND_USB_CAIAQ=m
CONFIG_SND_USB_CAIAQ_INPUT=y
CONFIG_SND_SOC=y
CONFIG_SND_OMAP_SOC=y
CONFIG_SND_OMAP_SOC_MCBSP=y

CONFIG_SND_OMAP_SOC_OVERO is not set

CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE=y
CONFIG_SND_SOC_I2C_AND_SPI=y

CONFIG_SND_SOC_ALL_CODECS is not set

CONFIG_SND_SOC_TWL4030=y

CONFIG_SOUND_PRIME is not set

This are the same settings to the Angstrom .config that works. I don;t know why aplay works but arecord doesn’t , very strange.

Thanks
Paul McManus

Paul McManus
Senior Software Engineer
Tel: +44 (0) 1224 775700
Fax: +44 (0) 1224 775800
Email: Paul.McManus@nautronix.co.uk
Website: www.nautronix.com

316055f.jpg

nautronixfooter.jpg

This email is sent and received in accordance with the terms and conditions as defined on our website. To view click here
Nautronix is a public limited company registered in Scotland. Registered number: SC062293. Registered office: Nautronix House, Howe Moss Avenue, Kirkhill, Dyce, Aberdeen, AB21 0GP

Hi Nils,
         I am having a problem with recording samples on the board at the moment, I can play but not record. I will take this up again once I fix audio capture. I think I was being too optimistic asking questions before ~I can even get the hardware checked out.

I noticed that the ALSA driver uses DMA. I was wondering if it was easier to use the ALSA interface and redirect the audio input to send to the DSP via DSPLINK MSGs.

Thanks
Paul