[alsa-devel] Problem with mplayer and OSS on at91sam9g20(kernel 2.6.30)

Hi,
We've been doing some tests here and we noticed a problem when using mplayer that we didn't have previously(on 2.6.27).
While playing audio through OSS emulation on 2.6.30 / at91sam9g20ek there seems to be issue with hardware parameters. The sound does not play and a bunch of error messages are comming on the console.
Here is the test case on angstrom:
-- mplayer output sample -------------------------
mplayer -quiet myfile.mp3
MPlayer 1.0rc1-4.1.2 (C) 2000-2006 MPlayer Team CPU: ARM Playing /media/sda/audio/01.mp3. [..] AUDIO: 44100 Hz, 2 ch, s16le, 192.0 kbit/13.61% (ratio: 24000->176400) Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3) [AO OSS]setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-(
-- kernel output sample -------------------------
Atmel_ssc_dai: Entering atmel_ssc_hw_params() natmel_ssc_hw_params: RCMR=00010420 RFMR=001f008f TCMR=4a010404 TFMR=001f008f atmel_ssc_dai: Starting clock atmel_ssc_dai,hw_params: SSC initialized Atmel_ssc_dai: Entering atmel_ssc_hw_params() atmel_ssc_hw_params: RCMR=00010420 RFMR=001f008f TCMR=4a010404 TFMR=001f008f atmel_ssc_dai,hw_params: SSC initialized Atmel_ssc_dai: Entering atmel_ssc_hw_params() atmel_ssc_hw_params: RCMR=00010420 RFMR=001f018f TCMR=4a010404 TFMR=001f018f atmel_ssc_dai,hw_params: SSC initialized asoc: machine hw_params failed asoc: machine hw_params failed asoc: machine hw_params failed asoc: machine hw_params failed asoc: machine hw_params failed asoc: machine hw_params failed asoc: machine hw_params failed [..] asoc: machine hw_params failed
MPlayer interrupted by signal 2 in module: ao2_init atmel_ssc_shutdown: transmit disabled SSC_SR=0x000004cc atmel_ssc_dau: Stopping clock soc-audio soc-audio: shutdown pop wq checking: Playback status: inactive waiting: yes pop wq D1 WM8731 Playback pop wq D3 WM8731 Playback
-- 2 error messages to note ------------------------- mplayer: "[AO OSS]setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-("
kernel: "asoc: machine hw_params failed"
=> please note also that it is working correctly using the alsa output: mplayer -ao alsa myfile.mp3
Here is the log while using the alsa output (it is working in this case):
root@at91sam:~$ mplayer -quiet -ao alsa /media/sda/audio/01.mp3 MPlayer 1.0rc1-4.1.2 (C) 2000-2006 MPlayer Team CPU: ARM
Playing /media/sda/audio/01.mp3. Audio file file format detected. Clip info: Title: Angel Artist: Massive Attack Album: Mezzanine Year: 1998 Comment: Ripped by Beto Track: 1 Genre: Rock ========================================================================== Forced audio codec: mad Opening audio decoder: [libmad] libmad mpeg audio decoder AUDIO: 44100 Hz, 2 ch, s16le, 192.0 kbit/13.61% (ratio: 24000->176400) Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3) ========================================================================== atmel_ssc_startup: SSC_SR=0x204 asoc: WM8731 <-> atmel-ssc0 info: asoc: rate mask 0x6fe asoc: min ch 1 max ch 2 asoc: min rate 8000 max rate 96000 Atmel_ssc_dai: Entering atmel_ssc_hw_params() atmel_ssc_hw_params: RCMR=00010420 RFMR=001f018f TCMR=19010404 TFMR=001f018f atmel_ssc_dai: Starting clock atmel_ssc_dai,hw_params: SSC initialized transmit enabled SSC_SR=0x000104cf AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample) Video: no video Starting playback... [..] atmel_ssc_shutdown: transmit disabled SSC_SR=0x000104c3 atmel_ssc_dau: Stopping clock soc-audio soc-audio: shutdown Exiting... (Quit)
pop wq checking: Playback status: inactive waiting: yes pop wq D1 WM8731 Playback pop wq D3 WM8731 Playback
egards, Sedji

On Thu, Sep 24, 2009 at 02:36:26PM +0200, Sedji Gaouaou wrote:
-- 2 error messages to note ------------------------- mplayer: "[AO OSS]setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-("
This is just going to be a knock on effect of the hw_params failing, I expect...
kernel: "asoc: machine hw_params failed"
...for which I'd suggest drilling down into the function to see which operation fails. Looking at the code I'd expect it's getting upset because it's being called with an invalid rate (OSS emulation calls hw_params with partially initialised parameters) but you're not seeing the log message that ought to be printed when that happens. Some trace showing what causes it to return an error ought to point out the culprit. The usual way to fix these is to ignore any errors in the function which isn't ideal but is needed with the way OSS emulation works.
I won't have access to my sam9g20 board until next week to look at this myself.

Mark Brown wrote:
I'd expect it's getting upset because it's being called with an invalid rate (OSS emulation calls hw_params with partially initialised parameters)
But even the uninitialized parameters conform to the constraints that were set by the driver, so they should never be invalid.
Sedji, try running mplayer with -v, this should give more log messages with the parameters that mplayer is trying to set.
Best regards, Clemens

On 25 Sep 2009, at 00:03, Clemens Ladisch clemens@ladisch.de wrote:
Mark Brown wrote:
I'd expect it's getting upset because it's being called with an invalid rate (OSS emulation calls hw_params with partially initialised parameters)
But even the uninitialized parameters conform to the constraints that were set by the driver, so they should never be invalid.
ASoC drivers, particularly ones doing manual clocking like this one, don't always express their full constraints to the application (in some cases it'd be far too hard).
Sedji, try running mplayer with -v, this should give more log messages with the parameters that mplayer is trying to set.
Best regards, Clemens

Hi,
Mark Brown wrote:
I'd expect it's getting upset because it's being called with an invalid rate (OSS emulation calls hw_params with partially initialised parameters)
But even the uninitialized parameters conform to the constraints
that
were set by the driver, so they should never be invalid.
ASoC drivers, particularly ones doing manual clocking like this one, don't always express their full constraints to the application (in some cases it'd be far too hard).
Sedji, try running mplayer with -v, this should give more log
messages
with the parameters that mplayer is trying to set.
Here is the mplayer -v output:
[..] ========================================================================== Forced audio codec: mad Opening audio decoder: [libmad] libmad mpeg audio decoder dec_audio: Allocating 4096 bytes for input buffer. dec_audio: Allocating 9216 + 65536 = 74752 bytes for output buffer. AUDIO: 44100 Hz, 2 ch, s16le, 96.0 kbit/6.80% (ratio: 12000->176400) Selected audio codec: [mad] afm: libmad (libMAD MPEG layer 1-2-3) ========================================================================== Building audio filter chain for 44100Hz/2ch/s16le -> 0Hz/0ch/??... [libaf] Adding filter dummy [dummy] Was reinitialized: 44100Hz/2ch/s16le [dummy] Was reinitialized: 44100Hz/2ch/s16le ao2: 44100 Hz 2 chans s16le audio_setup: using '/dev/dsp' dsp device audio_setup: using '/dev/mixer' mixer device audio_setup: using 'pcm' mixer device audio_setup: sample format: s16le (requested: s16le) audio_setup: using 2 channels (requested: 2) audio_setup: using 44100 Hz samplerate (requested: 44100) [AO OSS] audio_setup: driver doesn't support SNDCTL_DSP_GETOSPACE :-( audio_setup: 512 bytes/frag (config.h) AO: [oss] 44100Hz 2ch s16le (2 bytes per sample) AO: Description: OSS/ioctl audio output AO: Author: A'rpi Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le... [dummy] Was reinitialized: 44100Hz/2ch/s16le [dummy] Was reinitialized: 44100Hz/2ch/s16le Video: no video Freeing 0 unused video chunks. Starting playback... A: -1.5 (unknown) of 1506.0 (25:06.0) ??,?%
[.. no sound and many "asoc: machine hw_params failed" on the console ..]
MPlayer interrupted by signal 2 in module: play_audio Uninit audio filters... [libaf] Removing filter dummy Uninit audio: libmad
Thanks for your help,
Best regards, Sedji
participants (3)
-
Clemens Ladisch
-
Mark Brown
-
Sedji Gaouaou