2011-05-25 19:46:19 bf5xx-i2s, bf5xx-i2s-pcm, bf5xx-sport and OSS: Point me in the right direction, please
Reggy Perrin (UNITED STATES)
Message: 100841
Hi folks,
I'd appreciate a pointer in the right direction, because I'm stumped as to where to look next.
Here's the situation:
BF524 based system using a Wolfson WM8990 codec connected via a SPORT (using i2s driver)
We're using a 3rd party library for an audio function we need, and that library is OSS based
In preparation, we compiled in vrec/vplay (both OSS applications), and use them to validate the hardware/drivers to our system
If I record something with: vrec -w -t 4 -s 48000 -b 32 /tmp/test.wav, it sounds fine when played back with vplay
However, when I use this audio library we acquired, it can't record/play the audio correctly (and we don't have the source code or support to diagnose)
I've tracked down one issue with this library related to the i2s communication. In bf5xx-i2s.c, I had to change:
#define BF5XX_I2S_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
SNDRV_PCM_RATE_16000 | SNDRV_PCM_RATE_22050 | \
SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 | \
SNDRV_PCM_RATE_96000)
to:
#define BF5XX_I2S_RATES (SNDRV_PCM_RATE_48000)
Once I did this, the library started playing audio correctly. However, recording is still very choppy.
Thinking that it was still a rate mismatch somehow, I chose to fix even more of the variables. Currently, I have:
sound/soc/codec/wm8990.c:
#define WM8990_RATES (SNDRV_PCM_RATE_48000)
#define WM8990_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
sound/soc/blackfin/bf5xx-i2s.c:
#define BF5XX_I2S_RATES (SNDRV_PCM_RATE_48000)
#define BF5XX_I2S_FORMATS (SNDRV_PCM_FMTBIT_S32_LE)
sound/soc/blackfin/bf5xx-i2s-pcm.c:
.formats = SNDRV_PCM_FMTBIT_S32_LE,
Now when I record, I can actually confirm that it appears to be at the right frequency rate.
When I drop the rate down to 8KHz, I start to get SPORT TUVF errors, and the valid playback stopped.
To summarize:
vrec/vplay work fine with the driver
Custom OSS library can't record properly
What can I do to understand how the custom library is different, and how it is setting up the system differently? Any pointers as to where to start?
TIA
RP
QuoteReplyEditDelete
2011-06-10 04:46:07 Re: bf5xx-i2s, bf5xx-i2s-pcm, bf5xx-sport and OSS: Point me in the right direction, please
Scott Jiang (CHINA)
Message: 101177
Hi Reggy,
Your oss library is't compatible with ALSA. vrec/vplay can work fine with OSS emulation layer of ALSA.
Scott