Home > linux > pulseaudio – quick’n'dirty playback over the network

## pulseaudio – quick’n'dirty playback over the network

The joyful lives of many Linux desktop users are clouded by many packages and frameworks that are well-intentioned and try to solve real and painful problems, but which are immature, not designed in the UNIX spirit, poorly documented and most importantly, do not really have a working implementation. Oh well. I have taken the stance of patience and ascetic acceptance of the new burdens – instead of trying to purge my systems of all that is unholy and evil, I spend that time trying to debug and fix up the problems they incur (often in vain). Sometimes I even file bugs, but that can be rather… unrewarding experience – more about that at another time.

So, I have two OpenSUSE 11.2 machines – a notebook with GNOME and a workstation with KDE 4.2 and some real speakers. My notebook uses PulseAudio semi-automagically, but after many perpetual problems with pulseaudio, phonon, java and flash, I really gave up on the workstation and turned pulseaudio off. However, it is desirable to coil up in the bed and watch a movie on the notebook while NOT listening to the notebook speakers. So I want to play sound over the network, notebook to workstation.

What to do on the notebook:

$echo default-server =$IP_of_workstation >>/etc/pulse/client.conf
$mplayer -ao pulse ... That was easy. Your girlfriend watches you type along over your head. What to do on the workstation? Surely that will also be piece of cake! $ echo load-module module-native-protocol-tcp auth-anonymous=1 >>/etc/pulse/default.pa
$pulseaudio -v Ok. Try to fire up mplayer and… it’s all silent! You stare at the log for a bit, then you see it: I: sink-input.c: Created input 0 "audio stream" on alsa_output.pci-0000_01_00.1.hdmi-stereo with sample spec s16le 2ch 44100Hz and channel map front-left,front-right But, that’s wrong! There is nothing hooked up on the HDMI! The speakers are analog. Why is it playing over the HDMI? You click around a bit, google around a bit, nothing comes up. Your girlfriend stirs impatiently. You go through the log, see that pulseaudio first sees the HDMI sink, then the analog sink. Hm. You find the set-default-sink command somewhere and do $ echo set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo >>/etc/pulse/default.pa

Pulseaudio restart. Nice red message:

E: main.c: Sink alsa_output.pci-0000_00_1b.0.analog-stereo does not exist

Aha! Pulseaudio sees HDMI right away, sets it up, _then_ finishes initializing and prints this error, and only about two seconds later it goes all “oh, look, there’s another card plugged in here!”. What the heck?

At this point, you either give up or try to google around again madly. After 10 minutes, while your girlfriend is browsing DeviantArt bored, sound finally comes from the speakers after you figure out to issue

pacmd  'set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo'

while having a running pulseaudio.

You will probably need to have a dbus connection to your pulseaudio if you want to do this. If you are setting up the workstation remotely, you need to either create your own dbus session or hook up to a running one if you are logged in physically as well. This is a very simple, user friendly step:

$ps axu ... chidori 3036 0.0 0.4 151192 16564 ? S 09:40 0:00 kdeinit4: kded4 [kdeinit] ...$ cat /proc/3036/environ | tr '\0' '\n' | grep DBUS
\$ export cat /proc/3036/environ | tr '\0' '\n' | grep DBUS

Yay, what a nice, user-friendly, easy to set up piece of software we have here.

(BTW, the movie stutters every two minutes or so anyway; another time I feel shiny and optimistic, I will try to figure out if using some compression for the network audio is possible nowadays.)

Categories: linux Tags:
1. May 24th, 2010 at 17:27 | #1

Hi,

nice guide, I had to try it. So it generaly works very well, I had no problem with selecting sink because I have only notebook with simple analog sound card. We tried this with roommate on college, both with Ubuntu 10.04. But what nice we discovered is this: when some app starts with defined remote server, it connect to them and keep connection until it close, its normal behavior, but we wanted changing local/remote playing in “realtime” without closing application (and changing conf file). We done this using “module-tunnel-sink”, which creates new virtual output sink, that is connected to remote server. So you can let all application to connect to your local server and then you can easily (by pactl or in latest ubuntu by sound-applet) change output sink in realtime ;) (see pulseaudio wiki about this module)

2. June 7th, 2010 at 09:43 | #2

I have old machines (Pentium 1) used as X11 terminals. I gave a try to pulseaudio. Not a chance: the pusleadio server consumed whole CPU and suicided with a complain about no free CPU cycles.

Thus I returned to esound that worked at acceptable level. I tested nasd too but it had bad delay or crashed spontaneously.

3. July 7th, 2014 at 03:47 | #3

Good blog you have got here.. It’s difficult to find high
quality writing like yours nowadays. I seriously appreciate
people like you! Take care!!

4. July 15th, 2014 at 09:29 | #4

If you are going for best contents like me, just pay a visit this website every day as
it offers feature contents, thanks

5. August 5th, 2014 at 04:13 | #5
6. August 15th, 2014 at 05:25 | #6

If you want to build teamwork, you will definitely want to practice together, of
gear up those paintball guns! If” scenarios, and more, work on offensive and defensive strategies, code words, “what-.
Learn from the opposition together with your own teammates.
Tightly discover other paintball participants to build up new and winning strategies for future
online games. Does the opposition group discuss more than your
crew does? Do they really appear far more structured?
Watching the way your foes come together can help improve your team’s overall performance.
If your team is lacking in that area, take a look at your opponents paintball gear and see.
This can tremendously result your gameplay

7. August 15th, 2014 at 21:31 | #7

both of our websites are based around the same subject.

Cheers

8. August 23rd, 2014 at 04:59 | #8

It’s goinjg to be finish of mine day, however before end I am reading tuis wonderful pece of writing to increase my knowledge.

9. September 9th, 2014 at 06:47 | #9

An outstanding share! I have just forwarded this onto a colleague who was conducting a little research on this.
And he actually bought me breakfast due to the fact
that I discovered it for him… lol. So let me reword this….
Thanks for the meal!! But yeah, thanks for spending time to discuss this issue here on your web page.

10. September 13th, 2014 at 08:10 | #10

As I website possessor I believe the content matter here is rattling wonderful , appreciate it for your efforts. You should keep it up forever! Best of luck.
Pandora Charms http://www.permira.com/sites.aspx

11. September 13th, 2014 at 08:37 | #11

Wow wanted article! My spouse and i came up here since I could see your own personal comment at Krebs upon Safety measures site. It is a great help your enterprise is smart! Now I in the morning receiving a perception how these criminals are getting typically the components to try and do their own violations!
gucci outlet http://www.iphra.info

12. September 20th, 2014 at 03:00 | #12

At present TELLER MACHINES skimming is really a difficult issue, Very good revealing this particular posting. This is the very useful along with beneficial for you.
cheap beats by dre http://greensburgracquetclub.com/cheap-beats-by-dre.php

13. September 20th, 2014 at 04:40 | #13

It has the such as you discover my head! Material understand considerably about it, such as you authored the actual e book inside as well.. naprawa laptopów Piotrków Trybunalski I believe that you could do this with a few Per cent to push the solution property a bit more, but rather than this, that is excellent blog. A very good examine. I’m going to certainly return.

14. September 21st, 2014 at 02:25 | #14

I used to make a move actually like that method after i was a kindergarten teacher!

15. September 21st, 2014 at 04:02 | #15

Precisely how is Final. fm certainly not about this collection… also, have a look at tuberadio. com daaah, as the name says: options to be able to pandora bracelets as well as LASTFM simpleton!
gucci outlet http://www.gandsappaloosas.com/guccioutelt.php

16. September 21st, 2014 at 05:28 | #16

to be put in place, happen to be happen to be go away having demand this time (low bandwidth hats, Serious Bundle Assessment, bandwidth throttling and also carriers tend to be increasingly purchasing high priced and also fungible devices this incorporate deep packet examination technologies. For you to balance devices expenses, the insurers tend to be encouraged to make use of their consumible tools to be able to That it is a great along with valuable piece of facts. We are happy that you simply contributed that helpful info here. I highly recommend you keep us all up to date in this way. Many thanks discussing.

17. September 21st, 2014 at 07:34 | #17

ALRIGHT Just simply saved SBB rather than very pleased with everything especially not any get rid of possibilities taken out often the SBB and also Internet System elemnents from Cp nevertheless KHost and also KService continue being therefore using double a chance to anti virus software program as well upwards and so on and many others can certainly anyone assist me to disassemble them permenantly! Cheers in advance GEEZ! That is certainly *wrong*! Will it be certainly not within go against connected with agreement? That will pulls…

18. September 21st, 2014 at 08:09 | #18

Fantastic tutorial.. you overlooked a lot of format an excellent i actually ultimately got it runningno more major document mistakes: Deb No worries, thankful the idea in addition to strategy is when being used as much as the code. Undoubtedly I would refactor the codes easily needed the idea again: ) Best, Vincent rapid Became an additional 250 megabytes on account of you, and the statement I actually worked tirelessly on the ferry on my macbook ended up being replicated to be able to the personal computer at the office even before I go to your job along with the i phone at the same time! Just great, and yes it functions absolutely superior to icloud.

19. September 21st, 2014 at 10:33 | #19

I can’t work these types of motorists in the Microsoft windows seven.

20. September 21st, 2014 at 13:07 | #20

We tried looking at your site having this i-pod touch plus the layout will not are correct. Should check it out upon WAP in addition to this indicates the majority of mobile phone designs aren’t definitely cooperating with your website.

21. September 21st, 2014 at 16:40 | #21

22. September 23rd, 2014 at 07:22 | #22

Apple mackintosh loves releasing it is goods with out certain capabilities purposefully. So that they can increase of those capabilities inside next relieve and folks can buy the new model. . -= Nabeel’s last weblog… The way to administrative account within self applied hosted blogger weblog =-.

23. September 23rd, 2014 at 10:54 | #23

I possess learn some good things here. Undoubtedly well worth saving with regard to revisiting. I ponder simply how much energy you set to generate a really amazing educational site.

24. September 23rd, 2014 at 20:25 | #24
25. September 24th, 2014 at 15:11 | #25
26. September 24th, 2014 at 16:21 | #26

トリーバーチ ウェッジソール http://www.huishangedu.cn/upFile/226/women-bags-78

27. September 24th, 2014 at 20:11 | #27
28. September 24th, 2014 at 20:41 | #28

Great write-up to check on hidden individuals. But Therefore i’m also searching it intended for Skype ip telefoni hello, currently yahoo offers patched brand new diagnose approach also we need to wait around some more time for im hidden to the office flawlessly: )

29. September 24th, 2014 at 21:47 | #29
30. September 25th, 2014 at 01:07 | #30
31. September 25th, 2014 at 04:04 | #31
32. September 25th, 2014 at 10:18 | #32

Aw, this was a honestly nice post. In thought I would like to put in writing like this moreover – taking time and actual effort to make a really fine article?- but what can I say?- I procrastinate alot and by no means seem to get some thing carried out.
jordans online cheap http://www.hydacusa.com/techsupport/tech.asp?key=jordans-online-cheap-44

33. September 25th, 2014 at 11:58 | #33
34. September 25th, 2014 at 19:45 | #34
35. September 25th, 2014 at 22:54 | #35
36. September 26th, 2014 at 05:17 | #36
37. September 26th, 2014 at 13:34 | #37

Nice post. I be taught one thing more challenging on different blogs everyday. It should { be stimulating to read content material from different writers and Thanks for sharing.

38. September 26th, 2014 at 14:47 | #38
1. May 22nd, 2010 at 21:03 | #1
2. August 17th, 2010 at 15:55 | #2