Simple DLNA Renderer for Odroid C1+...or not?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I can give you the manual commands which will automatically mount your NAS each time DietPi boots.
It appears to me that you have already configured the NAS to automount, but let's check with this command -
Code:
sudo nano /etc/fstab
You should see this line -
Code:
//<IP-address-of-NAS>/<shared-directory-on-NAS>/   /mnt/dsmusic   cifs   user=<SMBuser>,pass=<SMBpassword>,cache=none,iocharset=utf8   0 0
If that line does not exist, create it, and save.
If that line already exists, you can modify it to add improvements - "iocharset=utf8" allows the use of special characters - useful for the German language!

/mnt/dsmusic
the directory structure is made up of several subdirectories (artist's folder for each album).
I think (?) that MPD will allow sub-directories within the main music directory, but we will soon see. If it fails, there's another method where you can create symlinks.

OK, now it's time to configure MPD. Open the MPD configuration file in nano -
Code:
sudo nano /etc/mpd.conf
The first thing to set is where to access the music -
Code:
music_directory   "/mnt/dsmusic"
Next, you will probably see this line -
Code:
bind_to_address “localhost”
This means that MPD will only allow client apps to connect from the same computer on which MPD is running ... and this is no good, we want to connect from phones/tablets. So change this line to -
Code:
bind_to_address “any”
Next, you established during DietPi setup that your USB audio interface is seen as "hw:1,0"
So under "audio_output {" you want -
Code:
device          "hw:1,0"
also
Code:
type		"alsa"
and to ensure that MPD never does its own software volume adustment - so that your output is bit-perfect:
Code:
mixer_type      "none"
Save the changes in nano.
Reboot.
Try to connect with an MPD client app ... for this you will need to know the IP address of your Odroid C1. If you have not done so already, it may be worth running the DietPi configuration again to set a manual IP address.
 
The infamous systemd may not be present on the NAS (yet) but I would recommend to take a safe defensive approach and consider using the mount option "nofail" in non-critical fstab entries already. Systemd has very unfortunate default options - e.g. failing boot when a no-nofail or no-noauto entry in fstab fails to mount - really annoying when upgrading from a tolerant non-systemd version to a newer version which has adopted systemd (hello debian...). The same for the default indefinite timeout on network interfaces startup when the network cable is disconnected or when the remote DHCP server does not run... but that is a different story.
 
At some point I was struggled last night. Now, things going faster, I’ve used the time for a clean install.

Side note: once again, I had to flash mSDHC with balena etcher on my wife’s windows machine. Failed on my mac, other pre-packaged distributions work. :confused:

So what, these are my results:

[+]
  • network directory set (fstab)
  • terminal acceess granted
  • edit mpd conf (nano works!)
  • alsa config
  • installed app „MaximumMPD“ on iPad & config
  • —> access to music directory, built up library
  • installed myMPD for testing purposes --> access to web gui but no connection to MPD

[-]...?
  • no sound/playback
  • only static samplerate (@384kHz) in amp display even if it‘s just connected (no playback) - RuneAudio does it dynamic starting at 44,1kHz
  • do I have to set the amp‘s maximum bit-/samplerate in alsa?
  • found „upscaling“ option in mpd.conf —> disabeling? (don‘t want it)
  • sometimes i get input/output erros (sdcard?)
  • any other settings in configs that I have overlooked?

BTW, I‘m getting fun doing all this on my „old days“ ...and with a little DOS in mind. But is it all worth it while RuneAudio does the things out of the box? As a perfectionist I would say „yes“. ;)
 
Config handling is clear so I think it's easier to show my configs for details:

My changes/adjustments

mpd.conf

Code:
music_directory [COLOR="red"]"/mnt/dsmusic"[/COLOR]
playlist_directory "/mnt/dietpi_userdata/Music"
db_file "/mnt/dietpi_userdata/.mpd_cache/db_file"
log_file "/var/log/mpd/mpd.log"
pid_file "/run/mpd/pid"
state_file "/mnt/dietpi_userdata/.mpd_cache/state"
sticker_file "/mnt/dietpi_userdata/.mpd_cache/sticker.sql"

#user "mpd" # Set via systemd unit to preserve supplementary group permissions i.e. "dietpi"$

bind_to_address "/run/mpd/socket"
bind_to_address [COLOR="red"]"any"[/COLOR]

log_level "default"
#gapless_mp3_playback "yes"
#save_absolute_paths_in_playlists "no"
metadata_to_use "artist,album,title,track,name,genre,date"
auto_update "yes"
#auto_update_depth "3"

#follow_outside_symlinks "yes"
#follow_inside_symlinks "yes"

zeroconf_enabled "yes"
zeroconf_name "DietPi MPD"

#password "password@read,add,control,admin"
#default_permissions "read,add,control,admin"

input {

plugin "curl"
#proxy "proxy.isp.com:8080"
#proxy_user "user"
#proxy_password "password"

}

connection_timeout "30"
max_connections "4"
#max_playlist_length "16384"
#max_command_list_size "2048"
#max_output_buffer_size "8192"

filesystem_charset "UTF-8"

# Audio Output / Processing

# Disabled to allow native DSD output
#replaygain "track"
#replaygain_preamp "8"
#volume_normalization "yes"

audio_buffer_size "2048"
#buffer_before_play "10%"

audio_output {

type "alsa"
name [COLOR="red"]"Audiolab m-one"[/COLOR]
device "hw:1,0"
format "44100:16:2"
mixer_type [COLOR="red"]"none"[/COLOR]
#mixer_control "PCM"
#mixer_index "0"

# Disable DSD DoP MPD 0.19
dop "no"

}

# Realtime audio conversion & upscaling
#audio_output_format "44100:16:2"
#samplerate_converter "soxr very high"

fstab

Code:
Please use "dietpi-drive_manager" to setup mounts
#----------------------------------------------------------------
# NETWORK
#----------------------------------------------------------------
[COLOR="Red"]//192.168.178.3/music /mnt/dsmusic cifs username=xxx,password=yyy,iocharset=utf8,uid=dietpi,gid=dietpi,file_mode=0770,dir_mode=0770,vers=3.1.1,_netdev,nofail,n$[/COLOR] <-- by drive manager/settings 

#----------------------------------------------------------------
# TMPFS
#----------------------------------------------------------------
tmpfs /tmp tmpfs size=1024M,noatime,lazytime,nodev,nosuid,mode=1777
tmpfs /var/log tmpfs size=50M,noatime,lazytime,nodev,nosuid,mode=1777

#----------------------------------------------------------------
# MISC: ecryptfs, vboxsf (VirtualBox shared folder), gluster, bind mounts
#----------------------------------------------------------------


#----------------------------------------------------------------
# SWAPFILE
#----------------------------------------------------------------
/var/swap none swap sw 0 0

#----------------------------------------------------------------
# PHYSICAL DRIVES
#----------------------------------------------------------------
UUID=d524574c-c83a-48c3-9211-b8eed72ec103 / ext4 noatime,lazytime,rw 0 1
UUID=C3D7-565C /boot vfat noatime,lazytime,rw 0 2

What else is to change?



===
Edit:
===

Aaaah...run
Code:
dietpi-services

Result:

...althoug autostart is set

Code:
┤ DietPi-Services ├──────────────────────────────┐
│ Please select an option or program:                                          │
│                                                                              │
│                         ●─ Single Service Options ─────────────●             │
│            avahi-daemon : active | Affinity 0-3                              │
│          [COLOR="Red"]  mpd          : failed | Affinity 0-3        [/COLOR]                      │
│            cron         : active | Affinity 0-3                              │
│            dropbear     : active | Affinity 0-3                              │


=====
Edit #2
=====

Could restart it manually
 
Last edited:
I had to flash mSDHC with balena etcher on my wife’s windows machine. Failed on my mac
sometimes i get input/output errors
Mmm, that's not good. I seem to recall that for Win32 Disk Imager give a 100% reliable image-write, it was first necessary to format the microSD card with FAT32. Maybe this is also true for balenaEtcher?
I have also read that image-writes can be faulty with certain USB adapters - maybe you could try a different adapter?
But I must say, I'm concerned about the filesystem integrity of your microSD card.

these are my results:
installed app "MaximumMPD" on iPad & config
--> access to music directory, built up library
That's great. Your client app can connect to the MPD server, and successfully read its database. Good start.

no sound/playback
That's bad, but not necessarily MPD's fault. DietPi's ALSA setup might be bad.
Some diagnosis is in order:
Do you have some mp3 files in your music library? Try to play an mp3 file with a command line player - madplay or mpg123
Code:
sudo madplay /mnt/dsmusic/<some-other-directory>/mymusicfile.mp3
If silence, run
Code:
sudo alsamixer
and check that the various bars, especially the "master" bar, does not have "MM" listed at the bottom - this means mute. You can un-mute by pressing "m".
 
Yes, wealas is correct.
Of course ALSA can mess with the audio output, too - resample, software volume adjustment,
but this can be disabled with the following configuration in /etc/asound.conf
Code:
pcm.!default {
    type hw
    card 0
}

ctl.!default {
    type hw          
    card 0
}
 
Last edited:
Regarding the failure of MPD to auto-start, it may be that there are two different startup methods conflicting with each other.
So I suggest you reverse my earlier auto-start method, by doing this -
Code:
sudo systemctl disable mpd
then autostart mpd from dietpi-services.
 
Briefly in between...

mSD is quite new, all past flash operations were successful. Only the DietPi-image failed. Took the same adapter on macOS and Windows, preparations in same order: deleted old volume(s), create a new one (FAT32) --> balena etcher --> flashing and verification successful.

In the meantime, I'll do my homework... ;)
 
Mmm, without having read it, my m-one is so to say a M-DAC with a power amp (firmware is up to date, v.1.32, straight from Audiolab-support).

In the past I've tried several "music distributions": Daphile (on an older AMD Zacate), RuneAudio and Volumio. They all ran out of the box, connected via USB.

BTW, Odroid C1+ is connected to an USB 3.0 (900mA) of my NAS because basic power consumption is only 500mA and only RJ45 and the m-one are plugged in. All other constellations before worked fine. No "lags", smooth library scrolling, fast updating and playback scrolling, etc.

Right now I'm struggling with a MPD/mpg123 error. MPD is active but mpg123 reports error messages (something like "socket"..."access"...). Also I can't remove and re-install MPD (failure reports@Debian-Server)...

I'm a little frustrated, it's weekend...and my wife seems to get ill. I think, I have to set priorities for the moment. ;)

Thank you so far!
 
Last edited:
But one last sign of life today. ;)

...call me "Mr.-Clean-Install".

Okay, I'm able to reproduce the situation:

  • clean install & config
  • install mpg123
  • comand playback test.mp3 (success by first try)
  • noisy sound, dietpi freezes, have to pull the plug
  • after reboot mpd autostart failed, no restart in present session --> reboot
  • mpd service online
  • connect with MPD-app (iOS)
  • could press play within the first tracks in library
  • it takes a long time...then a flac file comes to the same noisy life
  • reboot...

Due to the fact Archphile (not for C1+) based on Archlinux (C1+-ready image available), I'll try the same procedure with this.

Now, I quit for today
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.