From: Jie Jiang <jjinfo@nudt.edu.cn>
To: broonie@opensource.wolfsonmicro.com
Cc: alsa-devel@alsa-project.org
Subject: Questions about alsa driver for i.Mx27 + wm8974: playback time shorter than the original record time
Date: Thu, 26 Aug 2010 20:05:38 +0800 [thread overview]
Message-ID: <1282824338.1106.44.camel@UT43> (raw)
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
next reply other threads:[~2010-08-26 12:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-26 12:05 Jie Jiang [this message]
2010-08-26 12:41 ` Questions about alsa driver for i.Mx27 + wm8974: playback time shorter than the original record time 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1282824338.1106.44.camel@UT43 \
--to=jjinfo@nudt.edu.cn \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.