I am using an Orange Pi Zero 2W with an Orange Pi Expansion Board, with a speaker connected to the Expansion board 3,5 mm audio output.
The current OS on the Orange Pi is Orange Pi Debian Bookworm Server v 1.0.2
It is connected to the LAN via the ethernet connection.
I am now trying to use it as a MPD media player in Home Assistant, following this example:
Raspberry Pi Zero W as a media_player for Home Assistant
The idea is to use this setup as a media player with Voice Assistant.
So I installed alsa-utils
and mpd
, and than I could successfully play local wav files through the speaker with aplay
.
In Home Assistant I did add the MPD integration, which successfully connected to the Orange Pi, and I can play wav files from the HA Media Player.
However, the problem is that when I play some mp3 sound from Home Assistant via the MPD media Player I only hear a loud static noise.
This is both with playing a mp3 directly from the media player interface, and with playing some spoken text via Piper TTS.
And I also cannot play mp3 files locally via aplay
.
The duration of the sound seems to correspond to the original file, so it looks like the mp3 is transferred to the Orange Pi, but not correctly decoded?
Then I tried many different settings for MPD, added all by apt install
MPD recommended and suggested packages, and added extra packages, like ffmpeg
, mplayer
, but unfortunately it still doesn’t work.
I can now play mp3 files locally with mplayer
, but it still does not work with aplay
and MPD.
So this must be some misconfiguration in MPD?
This is the current MPD configuration in etc/mpd.conf:
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/playlists"
db_file "/var/lib/mpd/tag_cache"
#log_file "/var/log/mpd/mpd.log"
#pid_file "/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
bind_to_address "localhost"
# Permissions #################################################################
#password "password@read,add,control,admin"
default_permissions "read,add,control,admin"
# Input #######################################################################
input {
plugin "curl"
# proxy "proxy.isp.com:8080"
# proxy_user "user"
# proxy_password "password"
}
# Decoder #####################################################################
decoder {
plugin "hybrid_dsd"
enabled "no"
# gapless "no"
}
decoder {
plugin "wildmidi"
enabled "no"
#config_file "/etc/timidity/timidity.cfg"
}
decoder {
plugin "mad"
enabled "yes"
}
# Audio Output ################################################################
audio_output {
type "alsa"
name "OPZ2W ALSA Device"
device "hw:0,0" # optional
mixer_type "hardware" # optional
mixer_device "default" # optional
mixer_control "PCM" # optional
## mixer_index "0" # optional
}
I tried lots of different combinations of the above MPD settings, unfortunately to no avail.
This is what I got in the local MPD logs:
> Feb 12 13:56:42 opz2w-1 mpd[1205]: exception: CURL failed: The requested URL returned error: 404
> Feb 12 13:56:42 opz2w-1 mpd[1205]: exception: CURL failed: The requested URL returned error: 404
> Feb 12 13:56:42 opz2w-1 mpd[1205]: exception: CURL failed: The requested URL returned error: 404
> Feb 12 13:56:46 opz2w-1 mpd[1205]: player: played "http://192.168.124.50:8123/api/tts_proxy/rBBlJaIF1jf6R7Q31t_sPw.mp3"
And this are some examples of what I got in the Home Assistant logs:
Logger: homeassistant.components.tts
Source: components/tts/__init__.py:1099
integration: Text-to-speech (TTS) (documentation, issues)
First occurred: 08:43:39 (21 occurrences)
Last logged: 12:11:05
Error on load tts: cover.png was not recognized!
Error on load tts: cover.jpg was not recognized!
Error on load tts: cover.webp was not recognized!
Logger: homeassistant.components.media_player
Source: helpers/entity_platform.py:1039
integration: Media player (documentation, issues)
First occurred: 14:31:21 (10 occurrences)
Last logged: 14:54:33
Updating mpd media_player took longer than the scheduled update interval 0:00:10
Logger: homeassistant.components.mpd
Source: components/mpd/media_player.py:156
integration: Music Player Daemon (MPD) (documentation, issues)
First occurred: 14:31:46 (4 occurrences)
Last logged: 14:54:38
Error connecting to '192.168.124.215': Connection attempt timed out
Error connecting to '192.168.124.215': [Errno 113] Connect call failed ('192.168.124.215', 6600)
Logger: homeassistant.helpers.entity
Source: helpers/entity.py:1288
First occurred: 14:31:21 (6 occurrences)
Last logged: 15:13:21
Update of media_player.music_player_daemon is taking over 10 seconds
Logger: homeassistant.components.http.ban
Source: components/http/ban.py:136
integration: HTTP (documentation, issues)
First occurred: 15:06:37 (6 occurrences)
Last logged: 15:13:42
Login attempt or request with invalid authentication from 192.168.124.215 (192.168.124.215). Requested URL: '/media/local/cover.png'. (Music Player Daemon 0.23.12)
Login attempt or request with invalid authentication from 192.168.124.215 (192.168.124.215). Requested URL: '/media/local/cover.jpg'. (Music Player Daemon 0.23.12)
Login attempt or request with invalid authentication from 192.168.124.215 (192.168.124.215). Requested URL: '/media/local/cover.webp'. (Music Player Daemon 0.23.12)
Those errors seem to be related to this issue. However, that seems to be about media art that cannot be downloaded, and that should not stop the mp3 from playing I would say?
Has anybody experience with this setup?