saussact / openhab

Automatically exported from code.google.com/p/openhab
0 stars 0 forks source link

Implement PulseAudio Binding (was: Multiroom Audio / Audio Matrix with jackaudio binding) #22

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There should be binding which provides audio routing features to openHAB. 
Audiorouting is necessary to control which player (mpd, etc.) is connected to 
which audio output/zone. In general there a special player will be connected to 
it's room but in some cases (e.g. a party) there will be only one player which 
serves all zones but with different volumes.

JackAudio provides such functionality on Linux-based hardware. So it would be 
possible to turn a built in 7.1 Surround Soundcard into a Multiroom Audio 
Controller with no extra cost.

Unfortunately the installation is difficult and not so well documented. The 
Feature will comprise of some C hacking (since JackAudio is written entirely in 
C). Implementations of JackAudio-Clients in JAVA exists as well.

The binding should provide the following minimum features:

* visualize the current connection state (player a -> audio 1+2, player b -> 
audio 3+4, etc.)
* change audio wiring (virtually). This should be implemented as matrix where 
there are all available players on one axis and the available outputs on the 
other axis. The user can change player wiring randomly
* change volume for each output

Original issue reported on code.google.com by teichsta on 21 Mar 2011 at 2:05

GoogleCodeExporter commented 9 years ago
absolutely + :-)

Original comment by udo1t...@gmail.com on 15 Sep 2012 at 9:35

GoogleCodeExporter commented 9 years ago
+1

As an alternative for jackaudio, perhaps pulseaudio?
I believe the intergration with pulseaudio is easier, simply executing some 
commands.

Ideally both implementations are available, implementing the same interface.

Original comment by joris.de...@gmail.com on 18 Sep 2012 at 10:35

GoogleCodeExporter commented 9 years ago
I checked in a first version of a pulseaudio binding in my clone 
(tbraeutigam-openhab).
Currently you can use it to change volume, mute and check the availability of 
audio sinks, sink-inputs, sources an source-outputs. Also you can change the 
slaves of an combined-sink or send commands directly to the pulseaudio server. 
It needs the module-cli-protocol-tcp loaded on the pulseaudio server, to be 
able to connect to the server.

As this is my first more complex binding, there may be quite a lot things, 
which can be improved, but at least its working and should be a good starting 
point for further development.

Original comment by TBraeuti...@gmail.com on 30 Oct 2012 at 9:12

GoogleCodeExporter commented 9 years ago
cool!

Thanks for sharing this! Since i am not familiar with pulseaudio, is it 
possible to route Audio from one input device to many outputs? I'd like to have 
a kind of audio-matrix.

Regards,

Thomas E.-E.

Original comment by teichsta on 30 Oct 2012 at 10:54

GoogleCodeExporter commented 9 years ago
Yes you can. Currently I use pulseaudio to achieve a synchronous playback over 
2 different linux-based devices (RaspberryPI + Alix1D) from my main Server, 
which is running Openhab + the Pulseaudio server + Mpd. So I have two "remote" 
sinks (everything that can playback audio is called sink in pulseaudio), which 
i have grouped to a combined sink (you can combine multiple sinks to a 
"playback group"). So when I start a Mpd-playback (this is the input device, 
called sink-input in pulseaudio), it is routed by default to my combined sink 
and played back perfectly synchronous on the two playback devices transparently 
over network. Additionally you can route the sink-input to any other available 
sink.

To achive this you have to have a running pulseaudio daemon on every device 
(Main-Server + the two remote devices). The remote devices tell the main server 
their available sinks via avahi automatically, and from that point on they are 
usable just like local sinks on the main server.

Original comment by TBraeuti...@gmail.com on 31 Oct 2012 at 7:31

GoogleCodeExporter commented 9 years ago
The binding is working fine for me, but as pulseaudio is quite a complex 
system, the binding has to be tested in other environments than mine. If there 
isn´t anyone who tested it yet, I would suggest to postpone it until the 1.1 
release is out.

Original comment by TBraeuti...@gmail.com on 29 Nov 2012 at 8:29

GoogleCodeExporter commented 9 years ago
did you checked in the pulseaudio-binding? I didn't find it in your clone ...

Original comment by teichsta on 29 Nov 2012 at 10:21

GoogleCodeExporter commented 9 years ago
I just saw, that it is in the 1.1.0-cometvisu branch. I´m still learing to use 
mercurial in the right way.

Original comment by TBraeuti...@gmail.com on 29 Nov 2012 at 10:25

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi Tobias, do you use the released version? Can you confirm, that it's working? 
Regards, Thomas E.-E.

Original comment by teichsta on 21 May 2013 at 9:47

GoogleCodeExporter commented 9 years ago
Hi Thomas, I´m using it and can confirm, that it´s working.

Original comment by TBraeuti...@gmail.com on 23 May 2013 at 2:42

GoogleCodeExporter commented 9 years ago
good to know! Then this issue can be closed :-)

Original comment by teichsta on 23 May 2013 at 2:48