pianod2 Troubleshooting
Does audio work at all?
Without pianod involved at all, can you get audio from the command line?
- Use
aplay
,mpg123
,mpg321
,ffmpeg
, oravplay
to play an audio file from the command line. - Unless you’re on a Mac, it’s likely one of these is already
there. But if required, use
apt-get
,port
or other package manager to install one of these, then test with it. - Make sure you hear the audio and that plays correctly.
- Seems to play but no output? Check volumes with volume keys,
amixer
or other utilities. - Can’t open audio device? Do you have the right drivers installed? Are permissions right? Is the user a member of the ‘audio’ group on Linux?
Get that stuff working first before worrying about pianod.
Build a test version of pianod
Compile with pianod’s tone generator included and debugging enabled. The tone generator is excellent for diagnostics, because there are no encoding, decoding, network, filesystem, metadata or other things to go wrong. Test it from the command line:
./configure --with-tonegenerator --enable-debug
make
./src/pianod
Test pianod with the tonegenerator
With that running in one window, use another to connect with
nc
or telnet
:
$ telnet localhost 4445
Trying ::1…
Connected to localhost.
Escape character is ‘^]’.
200 Success
100 pianod2 152. Welcome!
011 SelectedSource: 1 manager Pianod
141 Volume: 0
012 SelectedPlaylist: mix manager Pianod mix
011 SelectedSource: 1 manager Pianod
007 Stopped
006 Idle
148 Room: pianod
Authenticate, enable the tone generator, and play tones with it:
USER ADMIN admin
032 admin signed in
023 PlaylistRatingChanged
200 Success
136 Privileges: admin service influence tuner
TONEGENERATOR ACTIVATE
200 Success
032 admin added a source
024 Available sources have changed: ready for Source 2 (tonegenerator/admin)
SOURCE SELECT ID 2
200 Success
011 SelectedSource: 2 tonegenerator admin
PLAY EVERYTHING
032 admin selected the playlist: tonegenerator admin bibliotheque
012 SelectedPlaylist: everything tonegenerator admin bibliotheque
009 Random Play
032 admin enabled random play
200 Success
004 Track playback complete
111 ID: 3ssthirdquarter
112 Album: Big Ben
113 Artist: Westminster Chimes
114 Title: Quarter-till Westminster chimes
115 Playlist: Soothing Sounds of Moog-like Clocks
123 Source: tonegenerator
124 Name: admin
116 Rating: unrated 0.0
120 PlaylistRating: unrated
127 Actions: rate request seed albumseed artistseed
001 Playing: 00:00/00:11/-00:11
You should hear the tone output, periodically switching to new tracks. If not:
- On a Raspberry Pi, try forcing the audio output to the desired
device with
raspi-config
. It’s under Advance Options, Audio. - Check the
pianod
window (or the appropriate log files if launched by init.d, systemd, or launchd) for audio errors. - Check the
pianod
volume:VOLUME
- If you’re running pianod as root, try forcing it to stay root:
pianod -n root
. This is fine for testing, but do not leave it this way. Leaving processes running as root unnecessarily violates Defense in depth principles, and puts your system and data at higher risk of violation. - Raspbian users can launch pianod at boot and choose to run it
as
pi
(the default user) usingpianod -n pi
.
Testing Sources
Once you’ve resolved audio problems using the tone generator, you can start testing other sources.
First, stop the tonegenerator:
SOURCE DELETE ID 2
024 Available sources have changed: removal complete for Source 2 (tonegenerator/admin)
200 Success
032 admin removed a source
Testing Filesystem Source
To test the filesystem source, do this, substituting a path to your own media files:
FILESYSTEM ADD /Users/perette/Music WAIT
032 admin added a source
034 Status: 3 songs, 2 albums, 2 artists for Source 4 (filesystem/admin)
024 Available sources have changed: ready for Source 4 (filesystem/admin)
200 Success
SOURCE SELECT ID 4
200 Success
011 SelectedSource: 4 filesystem admin
PLAY EVERYTHING
032 admin selected the playlist: filesystem admin bibliotheque
012 SelectedPlaylist: everything filesystem admin bibliotheque
009 Random Play
032 admin enabled random play
032 admin resumed playback
005 Intertrack
200 Success
111 ID: 4ss810584306
113 Artist: Red Brick Productions
114 Title: Cookies
119 Genre: Words
125 Year: 2015
126 Duration: 0:03
123 Source: filesystem
124 Name: admin
If you hit enter/return, pianod should report the playpoint, counting down as the track plays.
If it’s not working, review output in both windows. Some things to check:
- Did you type the path right?
- Is the filesystem mounted?
- If using a network filesystem, is the network behaving?
- Are the files where you expect them?
- Do the files and paths to them have the right permissions?
- Are the files in a supported encoding?
Testing Pandora
To test Pandora, do this:
PANDORA USER youremail@somewhere.com pandora-password WAIT
032 admin added a source
034 Status: Reauthenticating with server... for Source 3 (pandora/admin)
034 Status: Server authentication ok for Source 3 (pandora/admin)
024 Available sources have changed: ready for Source 3 (pandora/admin)
200 Success
SOURCE SELECT ID 3
200 Success
011 SelectedSource: 3 pandora admin
PLAY EVERYTHING
032 admin selected the playlist: pandora admin bibliotheque
012 SelectedPlaylist: everything pandora admin bibliotheque
009 Random Play
032 admin enabled random play
032 admin resumed playback
005 Intertrack
200 Success
111 ID: 2sea5a7dc614
112 Album: Groove On Up
113 Artist: Melvin Sparks
114 Title: Groove On Up
115 Playlist: Skuld
126 Duration: 4:28
123 Source: pandora
124 Name: admin
116 Rating: good 4.0
120 PlaylistRating: unrated
If you hit enter/return, pianod should report the playpoint, counting down as the track plays.
If it’s not working, review output in both windows. Some things to check:
- Did you type your credentials right?
- Is the network up and running? Can you surf sites okay? Can you reach pandora.com?
- Are the files in a supported encoding? If not, recompile ffmpeg/libav with the necessary prerequisites.
Install and troubleshoot installation
You’re on your own now. If you’re trying to run-at-boot, it’s probably a good idea to continue using the debug build and the tone generator, at least initially: no race conditions with the network being up, filesystems being mounted, etc. Once you’ve got troubles resolved, you can reinstall excluding the tone generator and with debugging disabled.