MPD and USB sound card

Re: MPD and USB sound card

Postby fvdw » Tue Feb 13, 2018 11:01 pm

attached some archives. I assume you are experienced linux user so I limit the instructions ;) and I assume you know how to use mpd and mpc

(1) mpd-root-adapt-13feb18.tar
This needs to be unpacked in the root of the system partition
For exmaple put it in the shared folder fvdw, connect with putty and give commands
Code: Select all
mv /direct-usb/fvdw/mpd-root-adapt-13feb18.tar /mpd-root-adapt-13feb18.tar
tar -xvf /mpd-root-adapt-13feb18.tar


(2) addon-alsa-mpd-mpc-13feb18.tar
This one needs to be unpack in the fvdw-addons directory (do not untar via samba server)
Put the tar archive in this fvdw/addons folders (fvdw is is a shared folder aleady defined if correct, addons is a subfolder of this shared folder)
Unpack by connecting via putty and give command
Code: Select all
cd /direct-usb/fvdw/addons

file removed need to add mpd.conf


tar -xvf addon-alsa-mpd-mpc-13feb18.tar


Furthermore you need to create a shared folder with name "mpd" using the web interface
In that shared folder create a folder with name "playlists"

You also must created a share with name "muziek" as I added a config file for mpd using that one as folder containing all music.
Of course you can cahnge that by adapting the config file, the config mpd.conf file is in /usr/local/etc (=/direct/usb/fvdw/addons/etc)

currently this is the content of mpd.conf
Code: Select all
bind_to_address "127.0.0.1"

audio_output {
  type "alsa"
  name "USB audio card"
  device "hw:0"
  mixer_control "Speaker" 
}

#neighbors {
#    plugin "smbclient"
#}

input {
    plugin "curl"
    proxy "proxy.local"
}

filter {
    plugin "volume"
    name "software volume"
}
database {
    path "/direct-usb/mpd/database"
}
music_directory "/direct-usb/muziek/"
playlist_directory "/direct-usb/mpd/playlists"
pid_file "/direct-usb/mpd/pid"
log_file "/direct-usb/mpd/mpd.log"



This version of mpd has support for wav, mp3 and flac (and some more) and also has support to be accessed by upnp client. The package includes alsa and mpc (mpd command line client) and all required extra libs
...more
see list below what is supported

Code: Select all
root@fvdwsl-5big2:/share/1000/fvdw/mpd-0.19.21 # mpd --version
Music Player Daemon 0.19.21

Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright (C) 2008-2014 Max Kellermann <max@duempel.org>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Database plugins:
 simple proxy upnp

Storage plugins:
 local smbclient

Neighbor plugins:
 smbclient upnp

Decoders plugins:
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [pcm]

Output plugins:
 null fifo alsa oss httpd recorder

Encoder plugins:
 null vorbis lame wave flac

Archive plugins:
 [bz2] bz2

Input plugins:
 file alsa archive curl smbclient

Playlist plugins:
 extm3u m3u pls xspf asx rss cue embcue

Protocols:
 file:// http:// https:// smb:// alsa://


please test and share your experiences and comments :mrgreen:


---Jocko edit feb 25th---
Removed the package: mpd-root-adapt-13feb18.tar as it overwrites some changes provided by the rollup patch_05 and later for version 17.0.
This rollup patch_05 includes the required updates on the firmware file system
You do not have the required permissions to view the files attached to this post.
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: MPD and USB sound card

Postby lexam » Wed Feb 14, 2018 11:39 am

I'm still testing, but it works according to the instructions, it's recognized by the python client I intend to use it with and plays music fine. One thing that I'd like to ask you is if it would be possible to include support for ffmpeg decoder, as I can't seem to have it play radio stations and/or google TTS.

Thanks again for all your support and hard work!
lexam
 
Posts: 16
Joined: Mon Feb 05, 2018 12:26 pm

Re: MPD and USB sound card

Postby fvdw » Wed Feb 14, 2018 4:58 pm

Yes this could be done. The firmware has already the related libs on board but this version of mpd needs a more recent version than those installed. I need to check if upgrading them will affect other applications. So you need to have some patience ;)
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: MPD and USB sound card

Postby fvdw » Mon Feb 19, 2018 8:32 pm

I compiled the latest version of ffmpeg, but it is too big for the firmware image due to the many decoders, encoders, muxers, demuxers.\
Which one do you miss in the current alsa/mpd pacakage to enable radio streams or google TTS ?
If I know that I can disable all the others we won't need to make size acceptable.
For instance trancoding of audio or video is not an option on a nwsp2 (cpu not powerfull enough and ram not suffcient)
So in principle all encoders could be disabled

I doubt if mpd need them all, based on the current firmware and alsa setup this is mpd configuration (+) is supported (-) not
Code: Select all
########### MPD CONFIGURATION ############

Archive support:
        (+bzip2) (-ISO9660) (-ZIP)
Autodiscovery support:
        (+Avahi) (-Bonjour)
Client support:
        (+IPv6) (+TCP) (+UNIX Domain Sockets)
Storage support:
        (-NFS) (+SMB)
File format support:
        (-AAC) (-AdPlug) (+DSD) (-C64 SID) (-FFMPEG) (+FLAC) (-FluidSynth) (-GME)
        (+libsndfile) (-MikMod) (-MODPLUG) (-MAD) (+MPG123) (-Musepack)
        (-Opus) (-OggTremor) (+OggVorbis) (+WAVE) (-WavPack) (-WildMidi)
Other features:
        (-libsamplerate) (-libsoxr) (+libmpdclient) (+inotify) (+SQLite)
Metadata support:
        (+ID3)
Playback support:
        (+ALSA) (+FIFO) (+File Recorder) (+HTTP Daemon) (-JACK)
        (-libao) (+OSS) (-OpenAL) (-OS X) (-Pipeline)
        (-PulseAudio) (-ROAR) (-SHOUTcast) (-Solaris) (-WinMM)
Streaming encoder support:
        (+FLAC) (+LAME) (-Shine) (+Ogg Vorbis) (-Opus) (-TwoLAME) (+WAVE)
Streaming support:
        (-CDIO_PARANOIA) (+CURL) (+SMBCLIENT) (-Soundcloud)
        (-MMS)
Event loop:
        epoll


which of the not yet supported decoders (file format) would you need ?
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: MPD and USB sound card

Postby fvdw » Thu Feb 22, 2018 9:01 pm

I managed to make a version with a new version of ffmpeg installed as addon along the one in the firmware and let mpd use that one :mrgreen:

Code: Select all
/share/1000/fvdw/addons-alsa/bin$ ./mpd --version
Music Player Daemon 0.19.21

Copyright (C) 2003-2007 Warren Dukes <warren.dukes@gmail.com>
Copyright (C) 2008-2014 Max Kellermann <max@duempel.org>
This is free software; see the source for copying conditions.  There is NO
warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Database plugins:
 simple proxy upnp

Storage plugins:
 local smbclient

Neighbor plugins:
 smbclient upnp

Decoders plugins:
 [mpg123] mp3
 [vorbis] ogg oga
 [oggflac] ogg oga
 [flac] flac
 [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2
 [audiofile] wav au aiff aif
 [dsdiff] dff
 [dsf] dsf
 [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve
 [pcm]

Output plugins:
 null fifo alsa oss httpd recorder

Encoder plugins:
 null vorbis lame wave flac

Archive plugins:
 [bz2] bz2

Input plugins:
 file alsa archive curl ffmpeg smbclient

Playlist plugins:
 extm3u m3u pls xspf asx rss cue embcue

Protocols:
 file:// http:// https:// gopher:// rtp:// rtsp:// rtmp:// rtmpt:// rtmps:// smb:// alsa://
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: MPD and USB sound card

Postby lexam » Fri Feb 23, 2018 7:12 am

Hi,

sorry I did not respond to your previous question, I was quite busy with work. This is great, I'll test it out as soon as you make it available for me to download.

Thanks again
lexam
 
Posts: 16
Joined: Mon Feb 05, 2018 12:26 pm

Re: MPD and USB sound card

Postby Jocko » Fri Feb 23, 2018 9:28 am

Hi lexam,

lexam wrote:I'll test it out as soon as you make it available for me to download.
fvdw waits information from you about the required codecs to post the new files
fvdw wrote:which of the not yet supported decoders (file format) would you need ?
There is a size issue with the last version
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: MPD and USB sound card

Postby fvdw » Fri Feb 23, 2018 9:46 am

Yes I was waiting on information from lexam, :tapfoot :disapprove ;) but because he took his time I tried to make a package that contains a new ffmpeg version (the most recent one!!) as addon along the existing on in the firmware and forcing mpd to use that. Pretty cool isn't it :vhcool
Seems I succeeded in doing that, learned again some tricks along the line
PS mpd has a huge dependency list, see below, so its not so easy to set the compiler up. But you can see it now uses the ffmpeg libs (libavxx) in /usr/local/lib and also the ffmpeg binaries do this. :ugeek:
Code: Select all
root@fvdwsl-base:/ # ldd /usr/local/bin/mpd
        libsmbclient.so.0 => /usr/lib/libsmbclient.so.0 (0xb6dca000)
        libexpat.so.1 => /usr/local/lib/libexpat.so.1 (0xb6da2000)
        libupnp.so.6 => /usr/local/lib/libupnp.so.6 (0xb6d7c000)
        libthreadutil.so.6 => /usr/local/lib/libthreadutil.so.6 (0xb6d6f000)
        libixml.so.2 => /usr/local/lib/libixml.so.2 (0xb6d5f000)
        libmpdclient.so.2 => /usr/local/lib/libmpdclient.so.2 (0xb6d44000)
        libFLAC.so.8 => /opt/lib/libFLAC.so.8 (0xb6cfa000)
        libavahi-common.so.3 => /usr/lib/libavahi-common.so.3 (0xb6ce7000)
        libavahi-client.so.3 => /usr/lib/libavahi-client.so.3 (0xb6cd1000)
        libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0xb6c8f000)
        libsqlite3.so.0 => /usr/lib/libsqlite3.so.0 (0xb6bfc000)
        libvorbisfile.so.3 => /opt/lib/libvorbisfile.so.3 (0xb6bec000)
        libvorbis.so.0 => /opt/lib/libvorbis.so.0 (0xb6bb8000)
        libm.so.6 => /lib/libm.so.6 (0xb6b10000)
        libogg.so.0 => /opt/lib/libogg.so.0 (0xb6b04000)
        libsndfile.so.1 => /usr/local/lib/libsndfile.so.1 (0xb6a9b000)
        libaudiofile.so.1 => /usr/local/lib/libaudiofile.so.1 (0xb6a6d000)
        libmpg123.so.0 => /usr/local/lib/libmpg123.so.0 (0xb6a1c000)
        libavformat.so.57 => /usr/local/lib/libavformat.so.57 (0xb681c000)
        libavcodec.so.57 => /usr/local/lib/libavcodec.so.57 (0xb554e000)
        libavutil.so.55 => /usr/local/lib/libavutil.so.55 (0xb54bf000)
        libcurl.so.4 => /usr/lib/libcurl.so.4 (0xb546c000)
        libasound.so.2 => /usr/local/lib/libasound.so.2 (0xb538b000)
        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0xb5372000)
        libid3tag.so.0 => /usr/lib/libid3tag.so.0 (0xb535b000)
        libz.so.1 => /lib/libz.so.1 (0xb5341000)
        libmp3lame.so.0 => /usr/local/lib/libmp3lame.so.0 (0xb529f000)
        libvorbisenc.so.2 => /opt/lib/libvorbisenc.so.2 (0xb51a4000)
        libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb519b000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb5092000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb506a000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb504a000)
        libc.so.6 => /lib/libc.so.6 (0xb4f0d000)
        /lib/ld-linux.so.3 (0xb6fc7000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0xb4ed5000)
        libresolv.so.2 => /lib/libresolv.so.2 (0xb4eb8000)
        libnsl.so.1 => /lib/libnsl.so.1 (0xb4e9c000)
        libdl.so.2 => /lib/libdl.so.2 (0xb4e91000)
        libldap-2.3.so.0 => /usr/lib/libldap-2.3.so.0 (0xb4e55000)
        liblber-2.3.so.0 => /usr/lib/liblber-2.3.so.0 (0xb4e41000)
        libssp.so.0 => /usr/lib/libssp.so.0 (0xb4e37000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb4d6c000)
        libswresample.so.2 => /usr/local/lib/libswresample.so.2 (0xb4d4f000)
        liblzma.so.5 => /usr/lib/liblzma.so.5 (0xb4d27000)
        libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0xb4ccb000)
        libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0xb4b61000)
        librt.so.1 => /lib/librt.so.1 (0xb4b52000)
        libsasl2.so.2 => /usr/lib/libsasl2.so.2 (0xb4b34000)
root@fvdwsl-base:/ #


It works...
Code: Select all
root@fvdwsl-base:/ # mpd --stdout --verbose --no-daemon
config_file: loading file /usr/local/etc/mpd.conf
path: SetFSCharset: fs charset is: UTF-8
vorbis: Xiph.Org libVorbis 1.2.3
sndfile: libsndfile-1.0.25
db: reading DB
curl: version 7.29.0
curl: with OpenSSL/1.0.1m
avahi: Initializing interface
avahi: Failed to create client: Daemon not running
avahi: Shutting down interface
client: [0] opened from 127.0.0.1:33346
client: [0] process command list
client: process command "load "fvdw1""
client: command returned 0
client: [0] process command list returned 0
client: [0] closed
client: [1] opened from 127.0.0.1:33348
client: [1] process command "play"
playlist: play 0:"Roger Whittaker - I Don't Believe In If Anymore.flac"
client: [1] command returned 0
playlist: queue song 1:"03 Another Brick in the Wall, Pt. 2.mp3"
client: [1] process command list
client: process command "status"
decoder_thread: probing plugin flac
decoder: audio_format=44100:16:2, seekable=true
client: command returned 0
client: process command "currentsong"
client: command returned 0
client: [1] process command list returned 0
client: [1] closed
alsa_output: opened hw:0 type=HW
alsa_output: format=S16_LE (Signed 16 bit Little Endian)
alsa_output: buffer: size=90..262144 time=2040..5944309
alsa_output: period: size=45..131072 time=1020..2972155
alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
alsa_output: buffer_size=22050 period_size=5513
output: opened plugin=alsa name="USB audio card" audio_format=44100:16:2
client: [2] opened from 127.0.0.1:33350
client: [2] process command "next"
playlist: play 1:"03 Another Brick in the Wall, Pt. 2.mp3"
player: played "Roger Whittaker - I Don't Believe In If Anymore.flac"
client: [2] command returned 0
playlist: queue song 2:"lieve pa1.wav"
decoder_thread: probing plugin mpg123
decoder: audio_format=44100:16:2, seekable=true
client: [2] process command list
client: process command "status"
client: command returned 0
client: process command "currentsong"
client: command returned 0
client: [2] process command list returned 0
client: [2] closed


attached the new pacakage. Th zip file contains a tar archive that must be unpacked in the fvdw/addons folder
NOTE: This package will only work if you have installed the mpd-root-adapt-13feb18.tar archive posted earlier on the right way
You do not have the required permissions to view the files attached to this post.
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Previous

Return to Lacie Network Space vs2 and max version

Who is online

Users browsing this forum: Google [Bot] and 5 guests