alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Questions about alsa driver for i.Mx27 + wm8974: playback time shorter than the original record time
@ 2010-08-26 12:05 Jie Jiang
  2010-08-26 12:41 ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Jie Jiang @ 2010-08-26 12:05 UTC (permalink / raw)
  To: broonie; +Cc: alsa-devel

Hi,

I have been working on developing alsa driver for wm8974 codec on i.mx27
platform. The wm8974 codec is connected to i.mx27 via SSI1 port. And the
OS kernel is linux-2.6.19.2.By now, the driver modules can be
successfully built and installed/loaded into kernel. 

I tested the driver playback function with a wav file (8KHz, 16-bit,
mono) recorded by Audacity on my laptop.The playback of this wave file
on my laptop lasts about 51 seconds. But when I play it (via aplay) on
the mx27 platform, the playback time lasts about 34 seconds, and the
playback speed is quite faster than the normal speed and the speaker
output sounds like being compressed.

In my driver, wm8974 works in I2S master mode and mx27 ssi1 is
configured as I2S slave. 

The configuration of wm9874 audio interface register is 0x10, which set
wm8974 as I2S master, word length is 16bits, normal bclk and frame clock
polarity.

The configuration of mx27 ssi1 transmission channel is as follows(using
ssi api from kernel 2.6.19.2):

ssi_tx_shift_direction(ssi, 0);	// MSB first shift   
ssi_tx_clock_polarity(ssi, 0);	// clock on RISING edge   
ssi_tx_frame_sync_active(ssi, 1);// frame sync LOW active   
ssi_tx_early_frame_sync(ssi, 1);//init frame sync one bit before data
ssi_tx_frame_sync_length(ssi, 0);  //one word length frame
ssi_tx_bit0(ssi, 1); // shifting w.r.t. bit 0 of TXSR   
ssi_tx_word_length(ssi, 0x7);  //16bit WL 
ssi_tx_frame_rate(ssi, 2); // DC[4:0] non-zero
ssi_tx_clock_direction(ssi, 0); // external bit clock    
ssi_tx_frame_direction(ssi, 0); // external frame sync   
ssi_tx_clock_divide_by_two(ssi, 0);
ssi_tx_clock_prescaler(ssi, 0);
ssi_tx_fifo_empty_watermark(ssi, 0, TX_WATERMARK);//TX_WATERMARK=4
ssi_tx_fifo_enable(ssi, 0, 1); // tx fifo0 enable   
ssi_transmit_enable(ssi, 1); // transmit section enable   
ssi_interrupt_enable(ssi, ssi_tx_dma_interrupt_enable); // enable tx dma
ssi_interrupt_enable(ssi, ssi_tx_fifo_0_empty);
ssi_interrupt_enable(ssi, ssi_tx_fifo_1_empty);
ssi_i2s_mode(ssi, 2); //i2s slave

Here I'm not very sure about the setting of frame rate and frame sync
length.  Is the above setting right?  But even I set frame rate to 1, it
does not make any difference. 

What's the possible reason causing the incorrect faster playback speed?
Any suggestion is appreciated.

Regards,
Jie Jiang

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-08-31 16:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-26 12:05 Questions about alsa driver for i.Mx27 + wm8974: playback time shorter than the original record time Jie Jiang
2010-08-26 12:41 ` Mark Brown
2010-08-26 14:13   ` Randolph Chung
2010-08-31 16:21   ` Jie Jiang
2010-08-31 16:21     ` Randolph Chung
2010-08-31 16:57       ` Jie Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).