Problems with pulseaudio / asla on PS3
Hi,
I'm trying to get an jukebox application going on a Sony PlayStation3 using Qt-Embedded, Phonon and PulseAudio. The application is working well on my KDE- based laptop where it appears that the application is using Phonon -> ALSA -> PulseAudio. But there is no sound from the application when run on the PS3.
I initially reported this problem to the PulseAudio mailing list. The first post on this topic is at https://tango.0pointer.de/pipermail/pulseaudio-
discuss/2008-August/002249.html . In pacticular, see these posts:
1) https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-
September/002346.html where I detail the results of a final test using the latest development version of PulseAudio; and
2) https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-
September/002347.html where a PulseAudio developer diagnoses the problem as being within ALSA.
For convenience, the following is from the latter post:
"So, what happens here is this: your device can only do non-interleaved audio and is hence configured for it (as we can see from that "slave setup" listing above). Because your hardware lacks a hardware volume control ALSA puts "softvol" on top of the hw device: the "Soft Volume PCM" you can see in the first part. That device is initialized for interleaved audio as you can see. Which is what PA supports and PA asked for.
Now, if softval takes non-interleaved from below and gives interleaved to the layer above than it would need to rearrange those samples -- which it however doesn't actually. PA hence checks with those asserts if the audio data is properly arranged -- which it is not as we can see.
This is a bug in ALSA's softvol module. Please report this on alsa-devel. softvol falsely claims to be able to rearrange non-interleaved audio to interleaved."
Not sure what other information I should post here so I'll wait for any feedback.
Thanks in advance,
Kevin
At Fri, 5 Sep 2008 08:42:08 +1000,
Quoted 34 lines · Kevin Gilbert
Hi,
I'm trying to get an jukebox application going on a Sony PlayStation3 using Qt-Embedded, Phonon and PulseAudio. The application is working well on my KDE- based laptop where it appears that the application is using Phonon -> ALSA -> PulseAudio. But there is no sound from the application when run on the PS3.
I initially reported this problem to the PulseAudio mailing list. The first post on this topic is at https://tango.0pointer.de/pipermail/pulseaudio-
discuss/2008-August/002249.html . In pacticular, see these posts:1) https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-
September/002346.html where I detail the results of a final test using the latest development version of PulseAudio; and2) https://tango.0pointer.de/pipermail/pulseaudio-discuss/2008-
September/002347.html where a PulseAudio developer diagnoses the problem as being within ALSA.For convenience, the following is from the latter post:
"So, what happens here is this: your device can only do non-interleaved audio and is hence configured for it (as we can see from that "slave setup" listing above). Because your hardware lacks a hardware volume control ALSA puts "softvol" on top of the hw device: the "Soft Volume PCM" you can see in the first part. That device is initialized for interleaved audio as you can see. Which is what PA supports and PA asked for.
Now, if softval takes non-interleaved from below and gives interleaved to the layer above than it would need to rearrange those samples -- which it however doesn't actually. PA hence checks with those asserts if the audio data is properly arranged -- which it is not as we can see.
Quoted 6 lines
This is a bug in ALSA's softvol module. Please report this on alsa-devel. softvol falsely claims to be able to rearrange non-interleaved audio to interleaved."
Not sure what other information I should post here so I'll wait for any feedback.
Well, it's no bug in softvol, at least. The softvol doesn't do any format or layout conversions. The layout conversion is done via plug plugin applied onto the softvol.
Takashi
Hi Takashi,
On Fri, 5 Sep 2008, Takashi Iwai opined:
Quoted 3 lines
Well, it's no bug in softvol, at least. The softvol doesn't do any format or layout conversions. The layout conversion is done via plug plugin applied onto the softvol.
OK (not that I fully understand what you have said) but where does that leave me? Is there something that I should try? Some ALSA or kernel configuration option that might be in error?
Kevin
Quoted 11 lines · Kevin Gilbert
Hi Takashi,
On Fri, 5 Sep 2008, Takashi Iwai opined:
Quoted 3 lines
Well, it's no bug in softvol, at least. The softvol doesn't do any format or layout conversions. The layout conversion is done via plug plugin applied onto the softvol.
OK (not that I fully understand what you have said) but where does that leave me? Is there something that I should try? Some ALSA or kernel configuration option that might be in error?
Takashi, as Kevin wrote originally, the problem is not that softvol doesn't do any format/layout conversions, but that it claims it does. PA asks softvol for INTERLEAVED samples, softvol agrees to that -- and actually hands us only NONINTERLEAVED samples because it doesn't reformat the from the underlying layer.
So, it *is* a bug in softvol. However, you are right that it doesn't do any conversions.
Lennart
Signature · 3 lines
Lennart Poettering Red Hat, Inc. lennart [at] poettering [dot] net ICQ# 11060553 http://0pointer.net/lennart/ GnuPG 0x1A015CC4
At Mon, 8 Sep 2008 22:21:36 +0200,
Quoted 15 lines · Lennart Poettering
Quoted 11 lines · Kevin Gilbert
Hi Takashi,
On Fri, 5 Sep 2008, Takashi Iwai opined:
Quoted 3 lines
Well, it's no bug in softvol, at least. The softvol doesn't do any format or layout conversions. The layout conversion is done via plug plugin applied onto the softvol.
OK (not that I fully understand what you have said) but where does that leave me? Is there something that I should try? Some ALSA or kernel configuration option that might be in error?
Quoted 8 lines
Takashi, as Kevin wrote originally, the problem is not that softvol doesn't do any format/layout conversions, but that it claims it does. PA asks softvol for INTERLEAVED samples, softvol agrees to that -- and actually hands us only NONINTERLEAVED samples because it doesn't reformat the from the underlying layer.
So, it *is* a bug in softvol. However, you are right that it doesn't do any conversions.
Does it happen only with softvol? For example, try to put any other conversion, such as, linear plugin instead of softvol. Could you check whether it works?
Basically softvol does nothing special, just like other normal plugins. So I don't think this is specific to softvol.
Takashi
Quoted 26 lines · Takashi Iwai
At Mon, 8 Sep 2008 22:21:36 +0200,
Quoted 15 lines · Lennart Poettering
Quoted 11 lines · Kevin Gilbert
Hi Takashi,
On Fri, 5 Sep 2008, Takashi Iwai opined:
Quoted 3 lines
Well, it's no bug in softvol, at least. The softvol doesn't do any format or layout conversions. The layout conversion is done via plug plugin applied onto the softvol.
OK (not that I fully understand what you have said) but where does that leave me? Is there something that I should try? Some ALSA or kernel configuration option that might be in error?
Quoted 8 lines
Takashi, as Kevin wrote originally, the problem is not that softvol doesn't do any format/layout conversions, but that it claims it does. PA asks softvol for INTERLEAVED samples, softvol agrees to that -- and actually hands us only NONINTERLEAVED samples because it doesn't reformat the from the underlying layer.
So, it *is* a bug in softvol. However, you are right that it doesn't do any conversions.
Quoted 6 lines
Does it happen only with softvol? For example, try to put any other conversion, such as, linear plugin instead of softvol. Could you check whether it works?
Basically softvol does nothing special, just like other normal plugins. So I don't think this is specific to softvol.
Also, output from snd_pcm_dump() after initialization (before samples r/w) might help us to determine the problem. I'll try to reproduce this behavior with the snd-dummy module.
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
Quoted 18 lines · Jaroslav Kysela
Quoted 16 lines · Takashi Iwai
At Mon, 8 Sep 2008 22:21:36 +0200,
Quoted 9 lines · Lennart Poettering
Takashi, as Kevin wrote originally, the problem is not that softvol doesn't do any format/layout conversions, but that it claims it does. PA asks softvol for INTERLEAVED samples, softvol agrees to that -- and actually hands us only NONINTERLEAVED samples because it doesn't reformat the from the underlying layer.
So, it *is* a bug in softvol. However, you are right that it doesn't do any conversions.
Does it happen only with softvol? For example, try to put any other conversion, such as, linear plugin instead of softvol. Could you check whether it works?
Quoted 6 lines
Quoted 2 lines
Basically softvol does nothing special, just like other normal plugins. So I don't think this is specific to softvol.
Also, output from
snd_pcm_dump()after initialization (before samples r/w) might help us to determine the problem. I'll try to reproduce this behavior with the snd-dummy module.
I found the culprit. Lennart was right. The softvol plugin does in-place sample recalculation, thus it cannot change the access type as a side effect (which is true for linear plugins).
The fix is available here:
http://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=a13707da6bb0161db855a146c3e4d1d849e4108b
Also, for debugging purposes, I added snd_pcm_channel_area_t dump to aplay:
http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=6bd621177dea5afd74261621c72ff98ca4fc118a
Jaroslav
-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.
At Tue, 9 Sep 2008 13:17:06 +0200 (CEST),
Quoted 24 lines · Jaroslav Kysela
Quoted 21 lines · Jaroslav Kysela
Quoted 18 lines · Takashi Iwai
At Mon, 8 Sep 2008 22:21:36 +0200,
Quoted 9 lines · Lennart Poettering
Takashi, as Kevin wrote originally, the problem is not that softvol doesn't do any format/layout conversions, but that it claims it does. PA asks softvol for INTERLEAVED samples, softvol agrees to that -- and actually hands us only NONINTERLEAVED samples because it doesn't reformat the from the underlying layer.
So, it *is* a bug in softvol. However, you are right that it doesn't do any conversions.
Does it happen only with softvol? For example, try to put any other conversion, such as, linear plugin instead of softvol. Could you check whether it works?
Basically softvol does nothing special, just like other normal plugins. So I don't think this is specific to softvol.
Quoted 7 lines
Quoted 3 lines
Also, output from
snd_pcm_dump()after initialization (before samples r/w) might help us to determine the problem. I'll try to reproduce this behavior with the snd-dummy module.I found the culprit. Lennart was right. The softvol plugin does in-place sample recalculation, thus it cannot change the access type as a side effect (which is true for linear plugins).
Ah, right, that's around mmap shadowing.
Quoted 8 lines
The fix is available here:
http://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=a13707da6bb0161db855a146c3e4d1d849e4108b
Also, for debugging purposes, I added
snd_pcm_channel_area_tdump to aplay:http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=6bd621177dea5afd74261621c72ff98ca4fc118a
Thanks!
Takashi