Playing mp3 via pulseaudio


I am having problems playing mp3s via pulseaudio on my 22.03.5 system.

With alsa everything works fine I can play both wav and mp3 files using either mpd, mpg123 or madaudio.

However with pulseaudio trying to play an mp3 with mpd results in distorted noise and I do not have another mp3-player that supports pulseaudio.

I can play wav-files with pulseaudio's paplay just fine but it seems that somewhere the mp3 files are not properly decoded.

My questions:

  • Is there another mp3-player that supports pulseaudio that I could try apart from mpd?
  • Is anybody else able to play back mp3s with mpd and pulseaudio on a big-endian system?

many thanks!

Have you tried enabling pulseaudio's TCP server support, and using the resulting sink from a remote pa client to play back audio (decoded from MP3)? Have you looked at the CPU utilization during playback? Maybe pa's advanced resampling et al. imposes too high a load on your hardware? That can cause choppy playback, in my experience.

Good idea, I will try the remote client later as I haven't any more time now but I just looked at the cpu-utilization and there isn't any load at all.

And the problem is not that the output is "choppy" but rather it is complete noise.

My theory is that it is a byte-ordering problem as I can get the exact same effect when I force the wrong format on a wav-file:

> pacat --fornat=s16le test.wav     # plays fine
> pacat --fornat=s16be test.wav     # plays garbled like my mp3

So it seems to me that either mpd or pulseaudio gets little-endian data but uses it as big-endian (the native byte order on my system).

1 Like

I have now configured pulseaudio as a network-server and my PC's mpd to play back via this pulseaudio instance.

Result: Works without problem, I can play back mp3s from my PC via mpd over the pulseaudio running on the router.

Copying the same mp3 file over to the router and playing it via the mpd installed on the router results in noise.

So I can send audio-output from remote to be played back on the router without problem and I can play back local wav-files but I cannot play back local mp3 files (with pulseaudio that is - alsa works fine).

My bet would be a byte-ordering problem with pulseaudio...