add draft ALSA input plugin

I've created an elementary input plugin that plays sound from the
soundcard, so you can use MPD to listen to anything connected to the
line-in jack, or to Video4Linux FM radio cards that send audio through
the soundcard.  There has been a small number of posts here in the
past requesting line-in input, so here is a first, simplistic stab at
it.

The patch adds a new sheme, alsa://, which causes mpd to play data
read directly from a souncdard.  It defaults to hw:0,0, but you can
pass any ALSA device name in the URI.  So, using mpc for example:

 mpc add alsa://
 mpc play

will play from device hw:0,0.

To use a diffferent device:

 mpc add alsa://hw:1,0
This commit is contained in:
Steven O'Brien
2013-12-15 16:52:21 +00:00
committed by Max Kellermann
parent e30fa7d15e
commit 35f85ddd86
6 changed files with 254 additions and 0 deletions

View File

@@ -54,6 +54,9 @@ static const char *remoteUrlPrefixes[] = {
#endif
#ifdef ENABLE_DESPOTIFY
"spt://",
#endif
#ifdef HAVE_ALSA
"alsa://",
#endif
NULL
};