Sound not working in all apps through pulse on arm

Bug #528524 reported by Paul Larson on 2010-02-26
36
This bug affects 5 people
Affects Status Importance Assigned to Milestone
linux-mvl-dove (Ubuntu)
Undecided
Unassigned
Lucid
Undecided
Unassigned
pulseaudio (Ubuntu)
High
Daniel T Chen
Lucid
High
Daniel T Chen
speex (Ubuntu)
High
Michael Casadevall
Lucid
High
Michael Casadevall

Bug Description

Binary package hint: pulseaudio

Following the instructions in bug #451635, I can get sound somewhat working in Lucid with X0 hardware. Speaker-test works at least. However, if I try to play an audio file with totem, for instance, I get no sound.

ProblemType: Bug
AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
Architecture: armel
Date: Fri Feb 26 10:03:14 2010
DistroRelease: Ubuntu 10.04
InstallationMedia: Ubuntu-Netbook 10.04 "Lucid Lynx" - Alpha armel+dove (20100224.1)
Package: pulseaudio 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu11
ProcEnviron:
 LANG=en_US.utf8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-201.10-hostname
SourcePackage: pulseaudio
Uname: Linux 2.6.32-201-dove armv7l

Related branches

Paul Larson (pwlars) wrote :
Changed in pulseaudio (Ubuntu):
importance: Undecided → High
Changed in pulseaudio (Ubuntu Lucid):
milestone: none → ubuntu-10.04-beta-1
Daniel T Chen (crimsun) wrote :

Wait, speaker-test works but Totem doesn't? That doesn't make sense to be a PA issue, then, because speaker-test is routed through PA. Can you verify using a wav file with both paplay and aplay, please?

Changed in pulseaudio (Ubuntu Lucid):
status: New → Incomplete
Paul Larson (pwlars) wrote :

Both paplay and aplay can play wav files successfully.

Changed in pulseaudio (Ubuntu Lucid):
status: Incomplete → New
Daniel T Chen (crimsun) wrote :

Not a PA bug, then.

affects: pulseaudio (Ubuntu Lucid) → totem (Ubuntu Lucid)
Paul Larson (pwlars) wrote :

I've been looking into this more, and I don't think it's related to totem. Using any sound player (totem, rhythmbox, even paplay), I can play certain audio files, but not others, and it doesn't seem to be restricted to just certain formats that will play either. The only consistent thing I can notice is that files that play have a sampling rate of 48000 Hz.

Example:
/usr/share/sounds/gnome/default/alerts/bark.ogg (48000 Hz) - plays
/usr/share/sounds/gnome/default/alerts/{drip,glass,sonar}.ogg (44100 Hz) - silence
/usr/share/sounds/alsa/*.wav (48000 Hz) - plays
/usr/share/sounds/speech-dispatcher/test.wav (16000 Hz) - silence
/usr/share/example-content/Ubuntu_Free_Culture_Showcase/InTheCircle.oga (44100 Hz) - silence
/usr/share/example-content/Aesop's_Fables,_Volume_1_(Fable_1)_-_The_Fox_and_The_Grapes.spx (??? 16000Hz?) - silence

Any ideas?

DebianSidUser (raza) wrote :

This is also effecting me.

DebianSidUser (raza) wrote :

affecting*

Oliver Grawert (ogra) wrote :

could it be that we are missing the hardware specific codecs to drive specific parts of the DSP for certain formats on this ARM board ?

At a glance, this sounds like a gstreamer issue. COuld you try playing some audio with rhythmbox and report back as to whether the sound plays?

 affects ubuntu/pulseaudio
 status incomplete

Luke, I've tried with rhythmbox, as well as other players and the result is the same. I can play both wav and ogg/oga files as long as they are 48000 Hz rate, however files with other sampling rates such as 44100 Hz don't seem to play - I just get silence.

If mplayer works on arm, try playing content via mplayer using the pulse output, like so: mplayer -ao pulse <filename> and let me know fi the same behavior is observed.

Unfortunately, mplayer seems to fail badly right now. Looking into that, but not usable to test this at the moment.

Hrm ok. My thinking is to try software that ony uses pulse to see if that works. If different files with different sample rates play fine through pulse, then its a gstreamer issue. If different sample rates do not work, then its either pulse or alsa at fault.

Could you possibly go through https://wiki.ubuntu.com/PulseAudio/Log to get a log output while you try to play audio?

Thanks.

Daniel T Chen (crimsun) on 2010-03-05
Changed in pulseaudio (Ubuntu Lucid):
status: New → Incomplete

sudo speaker-test -t wav -r 48000 worked fine to me.
speaker-test -t wav -r 44100 failed on "Sample rate doesn't match (48000) for /usr/share/sounds/alsa/Front_Left.wav"

I hear nothing when running: paplay /usr/share/sounds/alsa/Side_Left.wav
attached my pulse log.

Paul Larson (pwlars) on 2010-03-10
Changed in pulseaudio (Ubuntu Lucid):
status: Incomplete → Confirmed
tags: added: iso-testing
Steve Langasek (vorlon) wrote :

bug history shows this isn't totem-specific; closing the extraneous task.

Changed in totem (Ubuntu Lucid):
status: New → Invalid
Changed in pulseaudio (Ubuntu Lucid):
milestone: none → ubuntu-10.04-beta-2
importance: Undecided → High

Saeed,

speaker-test doesn't give me a sound here. There any switches to be tuned?

On Thu, Mar 11, 2010 at 1:14 AM, Saeed Bishara <email address hidden> wrote:
> sudo speaker-test -t wav -r 48000 worked fine to me.
> speaker-test -t wav -r 44100 failed on "Sample rate doesn't match (48000) for /usr/share/sounds/alsa/Front_Left.wav"
>
> I hear nothing when running: paplay /usr/share/sounds/alsa/Side_Left.wav
> attached my pulse log.
>
>
> ** Attachment added: "pulseverbose_saeed.log"
>   http://launchpadlibrarian.net/40706749/pulseverbose_saeed.log
>
> --
> Sound not working in all apps on dove
> https://bugs.launchpad.net/bugs/528524
> You received this bug notification because you are a member of Ubuntu
> Audio Team, which is subscribed to pulseaudio in ubuntu.
>
> Status in “linux-mvl-dove” package in Ubuntu: New
> Status in “pulseaudio” package in Ubuntu: Incomplete
> Status in “totem” package in Ubuntu: New
> Status in “linux-mvl-dove” source package in Lucid: New
> Status in “pulseaudio” source package in Lucid: Incomplete
> Status in “totem” source package in Lucid: New
>
> Bug description:
> Binary package hint: pulseaudio
>
> Following the instructions in bug #451635, I can get sound somewhat working in Lucid with X0 hardware.  Speaker-test works at least.  However, if I try to play an audio file with totem, for instance, I get no sound.
>
> ProblemType: Bug
> AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.21.
> Architecture: armel
> Date: Fri Feb 26 10:03:14 2010
> DistroRelease: Ubuntu 10.04
> InstallationMedia: Ubuntu-Netbook 10.04 "Lucid Lynx" - Alpha armel+dove (20100224.1)
> Package: pulseaudio 1:0.9.22~0.9.21+stable-queue-32-g8478-0ubuntu11
> ProcEnviron:
>  LANG=en_US.utf8
>  SHELL=/bin/bash
> ProcVersionSignature: Ubuntu 2.6.32-201.10-hostname
> SourcePackage: pulseaudio
> Uname: Linux 2.6.32-201-dove armv7l
>
>
>

OK, unmute HP made the sound now. One finding here: by killing pulseaudio I can now hear the music from Rhythmbox.

Eric Miao (eric.y.miao) wrote :

See the attached pulseverbose.log, looks like it's a permission issue. I've su'ed into root, and run pulseaudio as root, now I can hear the sound from Rythmbox.

Martin Pitt (pitti) on 2010-03-22
Changed in totem (Ubuntu Lucid):
milestone: ubuntu-10.04-beta-1 → none
Martin Pitt (pitti) wrote :

Eric, does aplay work for non-48000 Hz .wav files? I. e. is it a bug in PulseAudio's resampling on ARM, or a bug in ALSA?

Luke, I seem to remember that pulse always drives the hardware alsa device in the hardware-native frequency, and does the resampling itself. I'm sure it's possible to find out what those are? I. e. even if aplay doesn't work, it might still be a bug in PA, because it should take 44.1 kHz and still output 48 kHz?

Changed in pulseaudio (Ubuntu Lucid):
assignee: nobody → Luke Yelavich (themuso)
Eric Miao (eric.y.miao) wrote :

Martin, aplay works fine here with non-48000Hz .wav, at least for 8000Hz, 16000Hz and 48000Hz, not tried 44100Hz as I don't have any sample wav here.

Daniel T Chen (crimsun) wrote :

Paul can correct me if I misremember, but our conversation in #ubuntu-bugs a couple/few weeks ago briefly was:

1) PA's configured sampling rate of 44100 Hz (in /etc/pulse/daemon.conf via the default-sample-rate parameter) does not always match the input file's, resulting in inaudible audio, which seems to be corroborated by Paul's and Saeed's comments in 5 and 14, respectively;
2) ALSA[-lib]'s plughw is always audible regardless of the input file's.

To summarise: I think we can eliminate ALSA[-lib] as the culprit, since plughw appears to Do The Right Thing. The next thing to test is whether PA's default-sample-rate should be changed to 48000.

Paul Larson (pwlars) wrote :

I changed default-sample-rate to 48000, logged out/in, and retested. Everything still seemed the same though. 48kHz samples would play, anything else would not.

I also tried this:
speaker-test -t sine -r 48000 - plays
speaker-test -t sine -r 44100 - doesn't play

If I run the same two commands with sudo, they BOTH play just fine.

At this point we need straces.

On Mar 22, 2010 5:51 PM, "Paul Larson" <email address hidden> wrote:

I changed default-sample-rate to 48000, logged out/in, and retested.
Everything still seemed the same though. 48kHz samples would play,
anything else would not.

I also tried this:
speaker-test -t sine -r 48000 - plays
speaker-test -t sine -r 44100 - doesn't play

If I run the same two commands with sudo, they BOTH play just fine.

--
Sound not working in all apps on dove
https://bugs.launchpad.net/bugs/528524
You received this ...

Status in “linux-mvl-dove” package in Ubuntu: New
Status in “pulseaudio” package in Ubuntu: Confirme...

Bug description:
Binary package hint: pulseaudio

Following the instructions in bug #451635, I can g...

Paul Larson (pwlars) wrote :

Attached sudo-speaker-test-44100 strace

Paul Larson (pwlars) wrote :

Another observation: If I delete .pulse from my home directory, i can successfully run speaker test with both sampling rates and get sound out of it. After rebooting though, it goes back to the way it was (48000 works, 44100 does not)

Steve Langasek (vorlon) on 2010-03-26
Changed in pulseaudio (Ubuntu Lucid):
assignee: Luke Yelavich (themuso) → Daniel T Chen (crimsun)
Li Li (lli5) wrote :

Add another finding here in case it is not mentioned before.

============ findings and investigation ==============

You can enable audio on ubuntu lucid as follows:

1. Add USER ubuntu to audio group /* this seems has been fixed in the latest Lucid */
# sudo usermod –aG audio ubuntu

2. Change pulse audio resample method
sudo vi /etc/pulse/daemon.conf
Change
  resample-method = speex-float-1
to
  resample-method = trivial

3. Sudo reboot
Then you can choose audio output and get audio enabled.

==================== Conclusion =====================

Why we need to add ubuntu to audio group may be a bug of lucid (should have been fixed already).

The resample method can be set to any other values except speex-float-N and it is caused by libspeex library issue.

BTW, trival method cast least CPU and the quality is acceptable.

==================== speex fix =====================

The libspeex includes three resampling methods: fixed point, generic float point and SSE (intel specified float instruction set for X86).

Debian/rules will detect ARCH and configure "correct" resampling method.

Specially for X86, it will enable SSE. While for arm, it will enable fixed-point only by default and suppose your platform is armv4 which won’t support float-point.

By comment out this armv4 rule (see below), we can enable float-point resample method on ARM, without effecting existing fixed-point.

ifeq ($(DEB_HOST_ARCH_CPU),arm)
objdir = $(objdir_fixedpoint)
EXTRA_CONFIG_FLAGS = --enable-arm4-asm
endif

==>

ifeq ($(DEB_HOST_ARCH_CPU),arm)
#objdir = $(objdir_fixedpoint)
#EXTRA_CONFIG_FLAGS = --enable-arm4-asm
endif

Daniel T Chen (crimsun) wrote :

Li Li, it is unnecessary (and by and large incorrect; see bug 433654) to add one's user(s) to the audio group when PA is used.

So, the question becomes whether there is a speex task in addition or whether this issue is solely in the realm of compile-time for speex.

Certainly the 'trivial' resampler is not as good as the 'speex-fixed-1'. If you use 'speex-fixed-1' instead of 'speex-float-1', is this issue resolved?

affects: totem (Ubuntu Lucid) → speex (Ubuntu Lucid)
Changed in speex (Ubuntu Lucid):
status: Invalid → New
Daniel T Chen (crimsun) wrote :

Closing linux task unless it turns out that we need to tweak a kconfig setting.

Moving former totem task to speex. Additionally, someone knowledgeable with the Canonical support roadmap for ARM devices should see whether there are, in fact, any ARM boards that Lucid does/will support that don't handle floating point.

Changed in linux-mvl-dove (Ubuntu Lucid):
status: New → Invalid
Li Li (lli5) wrote :

'speex-fixed-1' works as well.

Daniel T Chen: As it currently stands, we're targeting ARMv7 for Ubuntu on ARM; all SoCs will support VFP.

Changed in speex (Ubuntu Lucid):
assignee: nobody → Michael Casadevall (mcasadevall)
status: New → Confirmed

I've taken Li Li's patch to speex and rolled a debdiff with it; I've uploaded it here: https://edge.launchpad.net/~mcasadevall/+archive/ppa; the PPA is devirtualized and thus usable on ARM boards.

It appears to fix the sampling issue for me (both speaker-test commands work), but I'd like someone else to confirm that as well.

Changed in speex (Ubuntu Lucid):
milestone: none → ubuntu-10.04-beta-2
Tobin Davis (gruemaster) wrote :

Ok, it would appear that the speex patch only enables floating point on armel. This doesn't resolve the issue of pulseaudio not playing sound at any rate other than 44800.

In order to play sound at other sample rates (i.e. 44100), one of three things need to happen:

1. delete ~/.pulse/* # Doesn't survive reboot/login, not sure which file is affected
2. add user to pulse group
3. disable pulseaudio with echo autospawn = no >> ~/.pulse/client.conf && killall pulseaudio

So, this is definitely a pulseaudio issue. Not sure why it is only on armel and not other platforms.

Tobin Davis (gruemaster) wrote :

Correction. This appears to be specific to dove. imx51 does not have this issue either.

Paul Larson (pwlars) wrote :

That's not true, imx51 *does* have this problem, as has long been noted in bug #534815. The difference is, that on imx51, 44100 Hz samples will play, but 48000Hz (and others) will not. Removing .pulse also works around the issue on imx51.

Daniel T Chen (crimsun) on 2010-04-02
summary: - Sound not working in all apps on dove
+ Sound not working in all apps through pulse on arm
Daniel T Chen (crimsun) wrote :

Please look at "sudo fuser -v /dev/snd/*" while the sudo speaker-test[..] instance is running.

Tobin Davis (gruemaster) wrote :

In testing this, I find no difference in the output of fuser when testing this. However, deleting ~/.pulse/* does allow playback. Adding sudo to the playback application has no effect, as the pulseaudio daemon is still owned by the user.

Daniel T Chen (crimsun) wrote :

i.e., Is pulse being bypassed altogether when sudo is used?

Anyhow, can we disable autospawn, then use PULSE_NO_SIMD=1 pulseaudio -vvvv ?

Tobin Davis (gruemaster) wrote :

"No change" means that pulse is not being bypassed, and sudo speaker-test is still running through pulseaudio with the user as the owner of the device open handle.

PULSE_NO_SIMD=1 does however make it work properly, where sudo speaker-test actually grabs the pcm device as root.

Steve Langasek (vorlon) on 2010-04-09
Changed in speex (Ubuntu Lucid):
milestone: ubuntu-10.04-beta-2 → ubuntu-10.04
Changed in pulseaudio (Ubuntu Lucid):
milestone: ubuntu-10.04-beta-2 → ubuntu-10.04
Tobin Davis (gruemaster) wrote :

Ok, new progress. In reviewing the comments on this bug report, I checked to see if Mike Casadevall's patch had been put into main. It has not. Replacing libspeex1 & libspeexdsp1 with rebuilt versions in his ppa (and no other changes) appears to fix this issue. Marking pulseaudio as invalid and will ping Mike to push his update into main.

Changed in pulseaudio (Ubuntu Lucid):
status: Confirmed → Invalid
Daniel T Chen (crimsun) on 2010-04-10
Changed in speex (Ubuntu Lucid):
status: Confirmed → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package speex - 1.2~rc1-1ubuntu1

---------------
speex (1.2~rc1-1ubuntu1) lucid; urgency=low

  * Drop ARMv4 configuration flags so ARM builds use floating point instead of
    doing integer math since all SoCs supported by Ubuntu support VFP. Thanks
    to Li Li for the fix. (LP: #528524)
 -- Michael Casadevall <email address hidden> Mon, 29 Mar 2010 15:13:22 -0400

Changed in speex (Ubuntu Lucid):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers