SoundSetup

From TAMI
Jump to: navigation, search

meeep

what is meeep ? it is a little eee near the coffee setup. Its official ip is 10.81.2.116 currently running arch linux

MPD & Pulseaudio & RELAXX

there is a front end for Music Player Daemon (MPD) running on meeep, it is connected to the mp3 directory on TAMI FTP.

add music via

 ftp://anonymous@mail.local/_mp3

url

 http://meeep/relax/#

notice FTP and MPD are only available locally, but pulseaudio is available from afar, i.e. PULSE_SERVER=meeep pavucontrol

add media

after you add media to ftp/_mp3 you need to refresh the relaxx DB - by pressing the config button on the top left (no pwd, user admin)

Meeep setup

This is tested to work after reboots. It now uses two systemd files: 1. mounting the ftp directory. This is done via a fstab entry and a systemd file. The systemd file is perhaps not required, but that means the mount needs to happen after network is available. I didn't test for that, if that works it would make it simpler a bit 2. mpd service. This starts pulseaudio too. After fighting to get a system wide pulseaudio that is run as root, and failing (I got it to work fine with native interface but mpd wouldn't successfully connect to it, even after adding pulse-access group. Gave up and used the auto-spawn method documented [

/lib/systemd/system/mpd.service

# cat mpd.service 
[Unit]
Description=Music Player Daemon
After=network.target sound.target mpd-mount-ftp.service dbus.socket
[Service]
User=mpd
Group=mpd
WorkingDirectory=/var/lib/mpd
Environment=XDG_HOME_DIR=/var/lib/mpd
ExecStart=/usr/bin/mpd --no-daemon
[Install]
WantedBy=multi-user.target

Explanation

dbus.socket is required for mpd to successfully launch pulseaudio, otherwise it is done too early and pulse fails (no further details..).

mpd-mount-ftp.service is required for /mnt/ftp

/lib/systemd/system/mpd-mount-ftp.service

[Unit]
Description=Music Player Daemon
After=network.target sound.target
[Service]
User=root
Group=root
WorkingDirectory=/
ExecStart=/usr/bin/curlftpfs -f anonymous@mail.lan /mnt/ftp -o allow_other
[Install]
WantedBy=multi-user.target

Explanation

curlftpfs needs to be run as the user accessing the mounted directory by default. To allow for running as root, which again I turned to after failing to run this as mpd, you need '-o allow_other'. This partially does away with benefits of using fuse (User Space) but oh well, working music beats wins.

fstab

curlftpfs#anonymous:@mail.lan /mnt/ftp fuse ro,uid=45,gid=45,user,noauto,allow_other 0 0

Explanation

This is not actually used, but is here as a reference only. uid/gid correspond to mpd, failed attempt to run as mpd.

Some pointers for systemd

After every file change you need to reload the daemon: systemd reload-daemon (see systemd docs on the homepage for why inotify was deemed a hard to implement correctly idea)

pulseaudio

meeep runs pulseaudio (including ESD compatbility) and accepts clients from inside the TAMI network 10.81.2.0/24

meeep is an eee pc on the south part of the eastern wall (TODO - automatically generated small thumbnail of map from inhouse-mapping-markup and a model of KG45/106)

Windows client usage

Windows setup is a little complex, but not that complex (10 minutes tops), see WindowsSoundSetup

Direct ssh

You can of course also just SSH into the machine and tell it to stream from somewhere else:

$ ssh tami@meeep
$ mplayer -playlist http://wfmu.org/wfmu.pls 

You can use tmux/screen to be able to drop the ssh connection without stopping the music.

Linux client usage

GUI only

install zeroconf module, enable it via paprefs. you can now switch any client (i.e. music player) during runtime to TAMI speakers!

command line

pax11publish -e -S meeep

Or manually tell pulse-clients on your local machine to use a pulse server in the network: export PULSE_SERVER=meeep mplayer -ao pulse ...

Or in one command, for bash:

PULSE_SERVER=meeep mplayer -playlist really_cool_radio_station.m3u

see pic > Zrxq2qJ.jpg

to run in background (so it doesnt stop if you logout)http://www.mplayerhq.hu/DOCS/HTML/en/faq.html#idp11063536

list of known streams - 
-106fm > http://212.29.254.129:7075 
-WFMU >

Pulse audio help

You can control the audio of any stream individually with pavucontrol (yum/apt-get/yaourt install pavucontrol/actual-name-of-package-TODO)

Pulse Audio trick - play output of meeep on your computer

ssh root@10.81.2.116 -C "parec --device alsa_output.pci-0000_00_1b.0.analog-stereo.monitor --format=s16le --rate=44100 --channels=2" | paplay --raw --channels=2 --rate=44100 --format=s16le

116 is now 117???

web interface

Ugly but usable web interface: http://meeep/cgi-bin/pulseaudio.html

Just two commands need to be run: (pulseaudio is running as server, so you cannot use pacmd)

  • pactl list short sink-inputs
1077    0       112     protocol-native.c       s16le 2ch 44100Hz
1167    0       225     protocol-native.c       s16le 2ch 44100Hz
1168    0       437     protocol-simple.c       s16le 2ch 44100Hz
  • pactl list sink-inputs
(just one example)
Sink Input #1168
        Driver: protocol-simple.c
        Owner Module: 16
        Client: 437
        Sink: 0
        Sample Specification: s16le 2ch 44100Hz
        Channel Map: front-left,front-right
        Format: pcm, format.sample_format = "\"s16le\""  format.rate = "44100"  format.channels = "2"
        Corked: no
        Mute: no
        Volume: 0: 100% 1: 100%
                0: 0.00 dB 1: 0.00 dB
                balance 0.00
        Buffer Latency: 340385 usec
        Sink Latency: 55359 usec
        Resample method: n/a
        Properties:
                application.name = "Simple client (TCP/IP client from 10.81.2.189:54524)"
                simple-protocol.peer = "TCP/IP client from 10.81.2.189:54524"
                module-stream-restore.id = "sink-input-by-application-name:Simple client (TCP/IP client from 10.81.2.189:54524)"
  • pactl set-sink-input-volume <sink-input-number> [0.0-1.0]

mopidy

an alternative to MPD/relaxx

  • supports streaming services (via a plugin) with auth (like soundcloud)

needs to picjk out a webclient - there are many

see also

Network

troubleshooting

what to do if meeep gui doesnt work? try wiggling the cable coming out of meeep, its a poor connection

what about this?

[tami@meeep ~]$ systemctl status pulseaudio.service

● pulseaudio.service - PulseAudio Sound Server

  Loaded: loaded (/usr/lib/systemd/system/pulseaudio.service; disabled)
  Active: failed (Result: exit-code) since Tue 2014-12-09 01:33:27 IST; 14s ago
 Process: 1745 ExecStart=/usr/bin/pulseaudio --system --disallow-module-loading=1 --disallow-exit=1 --disable-shm=1 --fail=1 --daemonize (code=exited, status=1/FAILURE)


i don't know.

how bout this?

[tami@meeep ~]$ mpc update

Updating DB (#1) ...

volume: n/a repeat: off random: off single: off consume: off

ERROR: Failed to decode Mozart/Mozart - The Very Best Of Mozart (2005) {FLAC} vtwin88cube/CD1/10.Piano Concerto No.20 Allegro Assai.flac


i still don't know