2010-10-28 11:25:14     BF524, WM8990 Codec and recording via ALSA/arecord

Document created by Aaronwu Employee on Aug 23, 2013
Version 1Show Document
  • View in full screen mode

2010-10-28 11:25:14     BF524, WM8990 Codec and recording via ALSA/arecord

Reggy Perrin (UNITED STATES)

Message: 95366   

 

Hi folks,

 

We're working through developing the ALSA driver for the wm8990 codec, and I need some guidance on getting ALSA to properly record audio via arecord.  Much of this is ALSA related, but the alsa utilities on the blackfin are not responding to commands that normally work on the PC, so I'm thinking it's a blackfin issue.

 

Using .34 kernel, we have audio output working fine (via ALSA).

 

The microphone is connected to LIN2 (on the codec), and we have that mapped into the codec ADC.  We think we have all the registers mapped correctly, but will fully confirm that tomorrow.

 

First question: The codec BCLK signal is connected to PF2/PPID2/RSCLK0/ND_D2A of the processor.  As I understand it, that clock must be generated by the Blackfin (along with another signal) to the codec, and the codec will return the digital data via the I2S bus (I believe).  Can anybody confirm this is something related to alsa, or point me to something helping me to understand this?

 

Second question:  I'm trying to use the amixer command to set the capture setting for the microphone input.  However, I don't believe it is properly working (or our driver could be configured incorrectly).  See the following tests from a prompt:

 

 

 

root:/> arecord -l

**** List of CAPTURE Hardware Devices ****

card 0: bf5xxwm8990 [bf5xx_wm8990], device 0: WM8990_dai WM8990 ADC/DAC Primary-0 []

Subdevices: 1/1

Subdevice #0: subdevice #0

 

=========================================================================================

root:/> cat /proc/asound/pcm

00-00: WM8990_dai WM8990 ADC/DAC Primary-0 : : playback 1 : capture 1

 

=========================================================================================

 

root:/> cat /proc/asound/devices

0: [ 0] : control

1: : sequencer

16: [ 0- 0]: digital audio playback

24: [ 0- 0]: digital audio capture

33: : timer

 

=========================================================================================

 

root:/> amixer sset 'LIN12' cap

Simple mixer control 'LIN12',0

Capabilities: volume volume-joined

Playback channels: Mono

Capture channels: Mono

Limits: 0 - 31

Mono: 28 [90%] [823.50dB]

 

(notice how Capture isn't listed after trying to set that as a capture source)

 

=========================================================================================

root:/> arecord -t wav -d 5 -f s16 -r 48000 -D hw:0,0 test.wav

-Recording WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono

arecord: set_params:909: Channels count non available

 

(it seems like this channel count error might indicate why it isn't showing up in amixer)

 

=========================================================================================

 

root:/> arecord -d 5 -D plughw:0,0 -f S32_LE -c 2 test.wav

Recording WAVE 'test.wav' : Signed 32 bit Little Endian, Rate 8000 Hz, Stereo

 

(seems to work here, but audio file is just 44 bytes)

 

=========================================================================================

 

[ 2010.880000] wm8990_set_dai_pll: Modify PLL2 & 3 as the chip vendor's suggestion

[ 2010.884000] wm8990_set_dai_clkdiv: WM8990_BCLK_DIV change to 0x1ce

[ 2010.892000] sport_config_rx: forcing to 32 bit

[ 2010.896000] sport_config_tx: forcing to 32 bitarecord: pcm_read:1349: read error: Input/output error

 

 

=========================================================================================

 

root:/> arecord -L

PCM list:

cards 'cards.pcm'

default 'cards.pcm.default'

front 'cards.pcm.front'

rear 'cards.pcm.rear'

center_lfe 'cards.pcm.center_lfe'

side 'cards.pcm.side'

surround40 'cards.pcm.surround40'

surround41 'cards.pcm.surround41'

surround50 'cards.pcm.surround50'

surround51 'cards.pcm.surround51'

surround71 'cards.pcm.surround71'

iec958 'cards.pcm.iec958'

spdif iec958

hdmi 'cards.pcm.hdmi'

dmix 'cards.pcm.dmix'

dsnoop 'cards.pcm.dsnoop'

modem 'cards.pcm.modem'

phoneline 'cards.pcm.phoneline'

hw {

@args.0 CARD

@args.1 DEV

@args.2 SUBDEV

@args.CARD {

type string

default {

@func getenv

vars {

0 ALSA_PCM_CARD

1 ALSA_CARD

}

default {

@func refer

name 'defaults.pcm.card'

}

}

}

@args.DEV {

type integer

default {

@func igetenv

vars {

0 ALSA_PCM_DEVICE

}

default {

@func refer

name 'defaults.pcm.device'

}

}

}

@args.SUBDEV {

type integer

default {

@func refer

name 'defaults.pcm.subdevice'

}

}

type hw

card $CARD

device $DEV

subdevice $SUBDEV

hint {

show {

@func refer

name 'defaults.namehint.extended'

}

description 'Direct hardware device without any conversions'

}

}

plughw {

@args.0 CARD

@args.1 DEV

@args.2 SUBDEV

@args.CARD {

type string

default {

@func getenv

vars {

0 ALSA_PCM_CARD

1 ALSA_CARD

}

default {

@func refer

name 'defaults.pcm.card'

}

}

}

@args.DEV {

type integer

default {

@func igetenv

vars {

0 ALSA_PCM_DEVICE

}

default {

@func refer

name 'defaults.pcm.device'

}

}

}

@args.SUBDEV {

type integer

default {

@func refer

name 'defaults.pcm.subdevice'

}

}

type plug

slave.pcm {

type hw

card $CARD

device $DEV

subdevice $SUBDEV

}

hint {

show {

@func refer

name 'defaults.namehint.extended'

}

description 'Hardware device with all software conversions'

}

}

plug {

@args.0 SLAVE

@args.SLAVE {

type string

}

type plug

slave.pcm $SLAVE

}

shm {

@args.0 SOCKET

@args.1 PCM

@args.SOCKET {

type string

}

@args.PCM {

type string

}

type shm

server $SOCKET

pcm $PCM

}

tee {

@args.0 SLAVE

@args.1 FILE

@args.2 FORMAT

@args.SLAVE {

type string

}

@args.FILE {

type string

}

@args.FORMAT {

type string

default {

@func refer

name 'defaults.pcm.file_format'

}

}

type file

slave.pcm $SLAVE

file $FILE

format $FORMAT

truncate {

@func refer

name 'defaults.pcm.file_truncate'

}

}

file {

@args.0 FILE

@args.1 FORMAT

@args.FILE {

type string

}

@args.FORMAT {

type string

default {

@func refer

name 'defaults.pcm.file_format'

}

}

type file

slave.pcm null

file $FILE

format $FORMAT

truncate {

@func refer

name 'defaults.pcm.file_truncate'

}

}

null {

type null

hint {

show {

@func refer

name 'defaults.namehint.basic'

}

description 'Discard all samples (playback) or generate zero samples (capture)'

}

}

 

Thanks!

 

RP

QuoteReplyEditDelete

 

 

2010-10-28 13:56:29     Re: BF524, WM8990 Codec and recording via ALSA/arecord

Mike Frysinger (UNITED STATES)

Message: 95369   

 

we dont really support non-ADI codecs.  the best case would be to first poke Wolfson about it ...

Attachments

    Outcomes