On Mon, Dec 20, 2010 at 7:45 PM, CarstenBreuer <carstenbreuer...@textwork.de> wrote: > Hi Sean, > hi all, > > first of all thank you for the very detailed answer. > I appreciate that :-). > >>> 1. How do i get a list of the available channels in >>> MPD/Alsa notation (hw:x,x or plughw:x,x)? >> Device enumeration in ALSA is a non-trivial problem. To be honest, the >> one piece of software I know of that does this really well is >> PulseAudio. > > I tried PA tree years ago on a thin client without X and > it was not configurable without X. After two days i give up :-(.
PA has come a long time in "years". If "tree" is a typo for "three", then PA has basically become an entirely new program since then -- not because the protocol has changed that much, but because the implementation has. > >> We *could* add support for device enumeration from one source or >> another to mpd, but if you're using the ALSA backend, chances are high >> that you don't *want* to use a raw device. Unless you have hardware >> mixing, which is less and less common, you will want to use a virtual >> device such as dmix for software mixing. Otherwise, mpd's audio will >> "hog" your soundcard, preventing other apps from using it. > > Yes, that is excactly what i want. > I have an server with 3 MPD's running on 3 soundcards > that stream sound over SPDIF to CAT5 converter in other rooms. > No need for X. Even no keyboard or mouse on that server. > And of course no other application that uses the soundcard. > These soundcards are also never the default once. > >> understand how to parse all possible versions of the config files, >> etc. > > :-( > >>> 2. How can if configure that channel (SPDIF, volume)? >> >> Well, if you knew the ALSA device number in hw:x,y format, > > That's excactly the problem. How do i get them. > hw:1,1 means "First Soundcard, 1 output channel?" The only thing I can think of is to look at the source code for PA's udev device enumeration code. See how they generate those unique IDs like "alsa_output.pci_1102_4_sound_card_0", and try to port that discovery logic over to mpd. Pulse is LGPL2.1 and mpd is GPL2, so you should be able to legally incorporate PA code into mpd. If you had this kind of stable identifier in the ALSA backend for mpd, then mpd would have to use udev (or HAL, although that path is obsolete now I believe) to enumerate the devices and figure out which one you're referring to. But it could be done. IMHO this logic belongs in a reusable library, though, not in any particular program. This whole paragraph only applies under the assumption that you only want to use the ALSA backend for mpd; ignore this if you are considering PulseAudio. > >> itself is extremely finnicky and complex; it is not user-friendly, and >> it is almost impossible to *make* it user-friendly. I said _almost_ >> impossible, though: PulseAudio is currently the best tool we have for, >> in short, bringing order to the chaos that is ALSA. > > Is pulse is now configurable completely on the command line? > Does it stops playing if you switch over to the command line > like before? Between the configuration files in /etc/pulse/, and the `pactl' and `pacmd' programs, it is basically "completely configurable" on the CLI. It has a learning curve somewhere steeper than OSS, but shallower than ALSA. See http://pulseaudio.org/wiki/CLI for the commands that can be specified in /etc/pulse/default.pa or as input to `pacmd'. See the manpage for pactl for some ancillary commands. The PA wiki is fairly complete, so you may be able to find the rest of the info you need there. > >> for the pulse output; see http://mpd.wikia.com/wiki/PulseAudio for >> details. To designate a soundcard as default sink,... > > I don't want to do that, because i have 4 soundcards > in that system. Fair enough. > >> with some known flaws (but still gets the job done), is padevchooser. >> Use gnome-volume-control-applet or the CLI as your first choices, >> though. > > Yes i know, nice gui stuff but nothing for the command line :-). > > pactl list reports: > > Senke #0 > Status: SUSPENDED > Name: alsa_output.pci_1102_4_sound_card_0 > Beschreibung: SB Audigy > Treiber: module-alsa-card.c > Sample-Angabe: s16le 2ch 44100Hz > > So i have tried: > > audio_output { > type "pulse" > name "MPD PulseAudio Output 3" > server "localhost" > sink "alsa_output.pci_1102_4_sound_card_0" Ah! I bet in /etc/pulse/default.pa, you don't have enabled, "load-module module-native-protocol-tcp". This module is what makes PA listen over TCP. By default, PA tries to use shared memory, which is much more efficient if your PA client and server are on the same computer. By specifying a server of "localhost" in your audio_output element, you are telling the PA client library to try and go over TCP, because "localhost" is a DNS that resolves to a TCP/IP address. The PA client *should* be smart enough to auto-detect a running PA server's UNIX socket address, so omitting the server element from the audio_output definition should give you what you want. For an exhaustive definition of *exactly* what you are allowed to put in the `server' element, and the meaning of each, see http://pulseaudio.org/wiki/ServerStrings . > > This doesn't work at the moment. > MPD report "Cannot connect to PulseAudio server: Connection refused" Yep, because module-native-protocol-tcp isn't loaded, it can't connect on the PA port over TCP. But you only want to use TCP if mpd is running on a different computer than PulseAudio. > I will check first that i didn't mess up pulseaudio and > then will report back if i knew more. > > > > Thanks for now, > > > > Carsten > > ------------------------------------------------------------------------------ > Lotusphere 2011 > Register now for Lotusphere 2011 and learn how > to connect the dots, take your collaborative environment > to the next level, and enter the era of Social Business. > http://p.sf.net/sfu/lotusphere-d2d > _______________________________________________ > Musicpd-dev-team mailing list > Musicpd-dev-team@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team > ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Musicpd-dev-team mailing list Musicpd-dev-team@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/musicpd-dev-team