[Cbe-oss-dev] Problems with ALSA / PulseAudio on PS3

Masakazu Mokuno mokuno at sm.sony.co.jp
Thu Aug 28 15:20:31 EST 2008


Hi,

On Thu, 28 Aug 2008 12:14:23 +1000
Kevin Gilbert <kevin952 at tpg.com.au> wrote:

> Over the past couple of days, the problem has been investigated by the good 
> folk at PulseAudio (see https://tango.0pointer.de/pipermail/pulseaudio-
> discuss/2008-August/002249.html for the gory details). The bottom line with 
> that investigation is the following:
> 
> "Umpf. there seems to be something very broken here in the audio driver or 
> alsa-libs. We only support interleaved channels. This assert above is always 
> true for interleaved channels. We ask the ALSA driver for interleaved 
> channels. But apparently it gave us some more complex channel arrangement. 
> Please report to the ALSA people."

PS3 sound driver supports only SNDRV_PCM_INFO_NONINTERLEAVED format as
well as many ALSA driver like AC97 support only
SNDRV_PCM_INFO_INTERLEAVED.  Non-interleaved format is just not usual,
but it is not broken. It's defined in ALSA.  With a brief looking, other
mainlined drivers -- gus, emu10k, es1968, rme9652 and aica -- seem to
support only non-interleaved samples. 

ALSA native programs like aplay can handle both formats. You'd see that
by (assuming you're using F9):
# yum remove -y pulseaudio*
# aplay something.wav

Anyway, before PulseAudio would support non-interleaved formats natively,
we should work around by the permutation of the audio samples somewhere. 
Please try the following patch in the mean time:

--- /etc/pulse/default.pa~      2008-03-28 08:45:37.000000000 +0900
+++ /etc/pulse/default.pa       2008-08-28 13:21:06.000000000 +0900
@@ -29,7 +29,7 @@
 ### Load audio drivers statically (it's probably better to not load
 ### these drivers manually, but instead use module-hal-detect --
 ### see below -- for doing this automatically)
-#load-module module-alsa-sink
+load-module module-alsa-sink device=plughw:0,0
 #load-module module-alsa-source device=hw:1,0
 #load-module module-oss device="/dev/dsp" sink_name=output source_name=input
 #load-module module-oss-mmap device="/dev/dsp" sink_name=output source_name=input

> Before I report this to the ALSA crowd, is there anything in the PS3 kernel 
> that could affect the ALSA implementation? 

PS3 sound chip's hardware is not suitable for the interleaved samples due
to its FIFO and DMAC design. I have no plan to support interleave
permutation in the kernel driver level.  I think the best way is that
the user space renderer takes care of the various interleave formats as
well as sample endianness and bit width.

> IE, would I be wasting their time 
> by reporting this problem to them?

I think ALSA people can find better way to work around than mine.

regards
-- 
Masakazu Mokuno




More information about the cbe-oss-dev mailing list