openhab / openhab1-addons

Add-ons for openHAB 1.x
Eclipse Public License 2.0
3.43k stars 1.71k forks source link

Enhance audio output implementation #1377

Closed gorootde closed 8 years ago

gorootde commented 9 years ago

The files generated by the TTS engine are played by the openhab runtime. At least if using openJDK, pulseaudio is used as default output method (org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider). To be able to route the audio output to any kind of speakers, openhab has to accept the PULSE_SINK environment variable to bind openhab to a dedicated sink, instead of always using the default one. Furthermore "setMasterVolume" does not work at all if used with pulseaudio.

kgoderis commented 9 years ago

Interesting

How could we couple this to the fact that OH itself is home of different kinds of sources of Audio? not only TTS, but also various types of media players like SqueezeBox and Sonos? Could we enlarge this to a general concept of sinks and sources?

On 30 Aug 2014, at 00:26, kwave notifications@github.com wrote:

The files generated by the TTS engine are played by the openhab runtime. At least if using openJDK, pulseaudio is used as default output method (org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider). To be able to route the audio output to any kind of speakers, openhab has to accept the PULSE_SINK environment variable to bind openhab to a dedicated sink, instead of always using the default one. Furthermore "setMasterVolume" does not work at all if used with pulseaudio.

— Reply to this email directly or view it on GitHub.

gorootde commented 9 years ago

This is already a working concept, if used with the pulseaudio binding. Openhab just needs to leave the connection to pulseaudio open, to be able to assign different sources to varous outputs. And thats exactly what my issue is about.

kgoderis commented 9 years ago

Mhh... I do not share this opinion though. As far as I understand pluseaudio, it uses soundcards/equipment on either the local host or a remote host to pipe music to connected speakers. In that sense it can be used to implement a multi-room audio system in the sense that Sonos already does "embedded". From openhab's point of view Pulseaudio, Squeezebox, Sonos etc are alike: they are sound systems, possibly sources of music, that are to be controlled by openHAB. As far as I can see, pulseaudio can not be used to feed a Sonos or Squeezebox system perse.

In larger scale of things, you would be able to use a "say(some text, some sink)" command in your OH scripts, with sink being an pulseaudio, sonos,... instance ,or use the play() command with some "source" and "sink" input variables. With the current state of things, we tend to have "solutions" that depend on "special" situations or conditions. By that I mean: the line-out of the OH host connected to a Sonos player, in order to pipe audio from openHAB to the Sonos network of players, or, Pulseaudio having a hook into the soundcard of the Openhab host etc. This is still different from openHAB actively taking sound from a source and pass it to a sink. In a certain way, openHAB would become a streaming server. It is a complicated subject.

K

On 30 Aug 2014, at 11:38, kwave notifications@github.com wrote:

This is already a working concept, if used with the pulseaudio binding. Openhab just needs to leave the connection to pulseaudio open, to be able to assign different sources to varous outputs. And thats exactly what my issue is about.

— Reply to this email directly or view it on GitHub.

kaikreuzer commented 9 years ago

Please also note my comment in this discussion a few weeks ago: https://groups.google.com/d/msg/openhab/yTJZbpk2BtQ/YgwSWFlSmTkJ So I think a source-sink concept is definitely interesting, but will be a rather huge project that only makes sense for Eclipse SmartHome / openHAB 2, but not for openHAB 1.x anymore.

teichsta commented 8 years ago

this issue should be further discussed at https://community.openhab.org. Would mind starting an appropriate discussion thread at https://community.openhab.org/c/add-ons/addons-other @kwave? Thanks, Thomas E.-E.