Latest mpd addon requires unsupported alsa buffering


#1

Hello,

I recently switched to CoreELEC on my Odroid C2., thank you to the developers and the community! Unfortunately the latest update to the 9.0.2 addon repository introduced a problem for me.

The latest mpd (repo 9.0.2, addon 9.0.107, mpd 0.21.4) enforces ALSA output buffering.
It used to work with the following output configuration:

audio_output {
type				"alsa"
name			"PCM5102 DAC"
device			"hw:0,0"
format			"44100:16:2"	# Required for Odroid!
mixer_type		"software"
auto_channels		"no"		# Required for Odroid!
auto_format 		"no"		# Required for Odroid!
buffer_time 		"0"		# Required for Odroid!
}

With the latest version mpd exits with an error because of the zero buffer time.
With small values I hear strange noise.
With the default value of 500000 the command ‘mpc play’ gives the error: Error opening ALSA device “hw:0,0”; snd_pcm_hw_params_set_buffer_time_near() failed: Invalid argument

Playing a wav-file with ‘aplay -D hw:0,0 -t wav test.wav’ works perfectly.

Is there a way to downgrade mpd to the previous version?
Or is there another solution?

Thank you for your help,
Pim.


#2

Hi,
Same issue with latest mpd. I downgraded to 0.20.21 version. Hapilly was in ~/.kodi/addons/packages - service.multimedia.mpd-9.0.106.zip. Try update from zip.

dewastor


#3

Thanks dewastor!

The old zip was still there indeed.
Unfortunately I read your message too late and made my own zip…
At least now I know how to build CoreELEC myself :slight_smile:

Tonight I fixed the problem by recompiling the previous version of MPD, following instructions from https://libreelec.wiki/compile

On my linux laptop:

sudo apt install gcc make git unzip wget xz-utils
git clone https://github.com/CoreELEC/CoreELEC
cd CoreELEC/
# Need to build libcrypt first manually because (I think) mpd is missing a dependency
# Need to add CCACHE_DISABLE=1 to prevent another error message (found this workaround in https://github.com/ocaml/opam/issues/3395 )
PROJECT=Amlogic DEVICE=S905 ARCH=arm CCACHE_DISABLE=1 scripts/build libgcrypt
PROJECT=Amlogic DEVICE=S905 ARCH=arm CCACHE_DISABLE=1 scripts/create_addon mpd

Be patient, it takes a while…
Now revert to the previous mpd version by replacing some lines in packages/addons/service/mpd/package.mk:


PKG_VERSION=“0.20.21”
PKG_SHA256=“8322764dc265c20f05c8c8fdfdd578b0722e74626bef56fcd8eebfb01acc58dc”
PKG_REV=“106”

cp -P $PKG_BUILD/.$TARGET_NAME/src/mpd $ADDON_BUILD/$PKG_ADDON_ID/bin

Rebuild mpd:

PROJECT=Amlogic DEVICE=S905 ARCH=arm CCACHE_DISABLE=1 scripts/create_addon mpd

You then have a zip file that you can transfer to the C2:
build.CoreELEC-S905.arm-9.0-devel/addons/mpd/service.multimedia.mpd-9.0.106.zip

Uninstall the mpd version 0.21.4 and install the previous from the zip-file.


#4

Ok. More complicated but effective. Once I made self compiled addon in Libreelec that I need for music and know it’s quit problematic.
Uncheck automatic updates of mpd addon to prevent from future problems :slight_smile: