Recently, I became the proud owner of Onkyo TX-NR515 receiver. This device is DLNA MediaRenderer as upnp-inspector says. The A/V receiver is from the 2012 devices family (TX-NR414/TX-NR515/TX-NR616).
Streaming the sound from PC to my DLNA device over wlan was a tough task, but I managed to solve it the way I’ll describe below. The main idea is to pass the alsa/pulseaudio output stream over LAN to DLNA device. There are 2 ways of doing it: with DLNA server or without.
- Traditional way of streaming audio with DLNA server involved using rygel which has a capability of taking pulseaudio sink (exposed by module-http-protocol-tcp) and stream it to DLNA enabled device: http://chemicaloliver.net/linux/streaming-audio-from-ubuntu-linux-to-a-dlna-player-blu-ray-or-ps3/
- Another way with DLNA server is to save the stream to audio file and then pass it to minidlna:
http://askubuntu.com/questions/187086/how-do-i-set-up-live-audio-streams-to-a-dlna-compliant-device - The third way involves buying a Bluetooth UBT-1 dongle from Onkyo. The dongle is plugged to AVR and after pairing with source device becomes available as output device. I didn’t find any positive experience on the net, I also don’t know anything about sound quality of such solution. But 45€ price for the dongle is worth a try. See my experience with UBT-1 here.
The rygel way worked on my Ubuntu 12.04 with 4-12 sec delay. I’m ok with such delay when listening to music. For video I used mplayer audio-video delay settings that easily allowed me to solve audio syncing problems. After upgrade to Ubuntu 12.10 the way with pulseaudio and rygel did not work for me.
The way I have it now: I pass the pulseaudio stream over HTTP, setup a ‘Favourite’ link on Onkyo receiver then play it. It works a lot more stable without DLNA server.
- Get the name of your pulseaudio sink:
pacmd list-sources | grep name
- Start the HTTP streaming of pulseaudio sink (use your sink name from list-sources) with some transcoding (more on transcoding and streaming: http://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples)
cvlc -vvv pulse://alsa_output.pci-0000_00_1b.0.analog-stereo.monitor --sout \ '#transcode{acodec=mpga,ab=128,channels=2}:standard{access=http,dst=0.0.0.0:8080/pc.mp3}'
- Test playing the stream on some PC within your LAN, then go to Onkyo’s web interface and save to Favourites the link to stream:
http://your.ip:8080/pc.mp3
- Via Onkyo interface go to Favourites and play the stream
Such solution is very stable for my network and transcoding config can be easily tweaked. Though it has some drawbacks: firstly, there’s still a delay (depends on transcoding settings). Secondly, VLC is a sledge-hammer to crack nuts. Using ffmpeg/avconv instead of VLC would be a better solution.
I appreciate, lead to I found just what I used to be taking a look for. You’ve ended my 4 day lengthy hunt! God Bless you man. Have a great day. Bye
Might be someone find’s it useful:
http://dpc.ucore.info/blog/2012/11/07/dlna-streaming-in-ubuntu-12-dot-10/
For some reasons my Onkyo refuses to play the stream.
I use my raspberry pi for playing this stream.
Thanks,
Christian
Thanks.
This is the simplest method i can find 🙂
Thank you. Your solution works fine with my Onkyo 3009
The cvlc route worked for me with a couple of Sonos Play:1, I just had to change the acodec from mpga to mp3 (that and install the Sonos desktop controller in VirtualBox simply to add the url to my radio list, I mean surely, it should be possible to do that from the phone app, right? Grrrr… )
Anyways, thanks for your post, very useful stuff!
Pingback: Ubuntu 13.10 on a Dell XPS 13 | In The Armchair
hey thanks, this works great with my ubuntu 13 laptop and my raspberry running openelec connected to my hifi. but i did not manage to mute my laptop without muting the output to the raspberry. how can i achieve that? Since there is a slight delay its kinda annoying hearing the music from both devices ;O
Thanks dmitry for this very simple but clean solution! Three points to mention:
1) I had first to unmute the output monitor.
$ pacmd
Welcome to PulseAudio! Use “help” for usage information.
>>> set-source-mute alsa_output.pci-0000_00_1b.0.analog-stereo.monitor false
>>> exit
2) Second, as wilks discribes, I had to change the acodec from mpga to mp3 as well.
3) Third, there is still the muting-problem keydon describes.
@keydon: Found the solution the muting-problem: Muting with the normal mute-button muetes the master of the alsa mixer. But we only want to muete the speakers of the laptop. So we can execute this command:
amixer -c 0 set Speaker playback 0%
Hey. This seems the perfect solution for me, but I don’t get it working. 🙁
Hi.
Looks like precisely the solution I am looking for, just a question what kind of delay do you get with this solution?
When I tested this option in 2012 I had (0.5-1)s delay over Ethernet and (2-4)s over 802.11n. I don’t use this way at the moment because of constant PulseAudio problems: missing sinks, lost network connections, etc. I believe PA with Ubuntu are more stable now. I also didn’t have time to test it with my 802.11ac. As an alternative I use the UBT-1 dongle. With Chinese Dongles I get (900-1000)ms delay, and (50-100)ms with Nexus 4, Nexus 7 from Google and Plantronics BackBeat Go 2.
Perfect solution.
I get a 10 second delay via LAN streaming but can happily live with this.
Many thanks for sharing this.
Hi Dmitry. This is still a great solution, but the delay (10sec over ethernet) is a bit annoying.
I can’t seem te find any other solution, so is there a way to get rid of the delay, maybe by using ffmpeg?
I have a DLNA audio renderer, with built in hardware digital to analog converter. Which is supposed to be more HIFI than say an analog connection from a computer etc. I thought that finding clients that could play to a renderer would be very simple, but after trying many different pieces of software, I haven’t really gotten that far!
Anyway I did find pulseaudio-dlna which is similar to what you have here. It lets you direct various audio inputs to your pulseaudio-dlna outputs that can include chromecasts. You can also link them up as well, so have multiple device output. First impressions are that it transcodes the computers audio output to mp3, and presents as a stream. You do get a delay. (I was hoping to bypass transcoding for supported formats.) The nice thing about pulse-dlna is that you can pretty much wire any audio output from any application to your renderer. Perhaps I need to just dig into the dlna spec, because in my mind it should be as easy as presenting a url to the renderer. Volume, play, pause and seek would be nice from multiple devices. Very disappointed in the userland apps for DLNA. Makes CD use, and flipping vinyl a doddle by comparison for us fat controllers.