{"id":1441,"date":"2012-11-01T01:21:53","date_gmt":"2012-10-31T21:21:53","guid":{"rendered":"http:\/\/sandalov.org\/blog\/?p=1441"},"modified":"2013-12-12T15:20:32","modified_gmt":"2013-12-12T11:20:32","slug":"streaming-audio-from-ubuntu-linux-to-a-dlna-player-without-rygel","status":"publish","type":"post","link":"https:\/\/sandalov.org\/blog\/1441\/","title":{"rendered":"Streaming audio from Ubuntu Linux to a DLNA player without Rygel"},"content":{"rendered":"<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n<p>Recently, I became the proud owner of <a href=\"http:\/\/www.eu.onkyo.com\/en\/products\/tx-nr515-76085.html\" target=\"_blank\">Onkyo TX-NR515<\/a> 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).<\/p>\n<p>Streaming the sound from PC to my DLNA device over wlan was a tough task, but I managed to solve it the way I&#8217;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.<\/p>\n<ul>\n<li>Traditional way of streaming audio with DLNA server involved using <a href=\"http:\/\/www.collabora.com\/projects\/rygel\/\" target=\"_blank\">rygel<\/a> which has a capability of taking pulseaudio sink (exposed by <a href=\"https:\/\/live.gnome.org\/Rygel\/Pulseaudio\" target=\"_blank\">module-http-protocol-tcp<\/a>) and stream it to DLNA enabled device: <a href=\"http:\/\/chemicaloliver.net\/linux\/streaming-audio-from-ubuntu-linux-to-a-dlna-player-blu-ray-or-ps3\/\" target=\"_blank\">http:\/\/chemicaloliver.net\/linux\/streaming-audio-from-ubuntu-linux-to-a-dlna-player-blu-ray-or-ps3\/<\/a><\/li>\n<li>Another way with DLNA server is to save the stream to audio file and then pass it to minidlna:<br \/>\n<a href=\"http:\/\/askubuntu.com\/questions\/187086\/how-do-i-set-up-live-audio-streams-to-a-dlna-compliant-device\" target=\"_blank\">http:\/\/askubuntu.com\/questions\/187086\/how-do-i-set-up-live-audio-streams-to-a-dlna-compliant-device<\/a><\/li>\n<li>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&#8217;t find any positive experience on the net, I also don&#8217;t know anything about sound quality of such solution. But 45\u20ac price for the dongle is worth a try. See my experience with UBT-1 <a href=\"http:\/\/sandalov.org\/blog\/1547\/\" target=\"_blank\">here<\/a>.<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p>The rygel way worked on my Ubuntu 12.04 with 4-12 sec delay. I&#8217;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.<\/p>\n<p>The way I have it now: I pass the pulseaudio stream over HTTP, setup a &#8216;Favourite&#8217; link on Onkyo receiver then play it. It works a lot more stable without DLNA server.<\/p>\n<ul>\n<li>Get the name of your pulseaudio sink:\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\npacmd list-sources | grep name\r\n<\/pre>\n<\/li>\n<li>Start the HTTP streaming of pulseaudio sink (use your sink name from list-sources) with some transcoding (more on transcoding and streaming: <a href=\"http:\/\/wiki.videolan.org\/Documentation:Streaming_HowTo\/Command_Line_Examples\" target=\"_blank\">http:\/\/wiki.videolan.org\/Documentation:Streaming_HowTo\/Command_Line_Examples<\/a>)\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncvlc -vvv pulse:\/\/alsa_output.pci-0000_00_1b.0.analog-stereo.monitor --sout \\\r\n'#transcode{acodec=mpga,ab=128,channels=2}:standard{access=http,dst=0.0.0.0:8080\/pc.mp3}'\r\n<\/pre>\n<\/li>\n<li>Test playing the stream on some PC within your LAN, then go to Onkyo&#8217;s web interface and save to Favourites the link to stream:\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">http:\/\/your.ip:8080\/pc.mp3<\/pre>\n<\/li>\n<li>Via Onkyo interface go to Favourites and play the stream<\/li>\n<\/ul>\n<p>Such solution is very stable for my network and transcoding config can be easily tweaked. Though it has some drawbacks: firstly, there&#8217;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.<\/p>\n<div class=\"2d836d85a73757df15d0de19d7bef594\" data-index=\"1\" style=\"float: none; margin:10px 0 10px 0; text-align:center;\">\n<script type=\"text\/javascript\"><!--\r\ngoogle_ad_client = \"ca-pub-2287684400845931\";\r\n\/* valerymorozov *\/\r\ngoogle_ad_slot = \"5606708872\";\r\ngoogle_ad_width = 728;\r\ngoogle_ad_height = 90;\r\n\/\/-->\r\n<\/script>\r\n<script type=\"text\/javascript\"\r\nsrc=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\">\r\n<\/script>\n<\/div>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a class=\"continue-reading-link\" href=\"https:\/\/sandalov.org\/blog\/1441\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[118,52],"tags":[302,304,301,297,181,303,296,298,294,300,292,295,293,299,379,80],"class_list":["post-1441","post","type-post","status-publish","format-standard","hentry","category-linux-2","category-ubuntu","tag-12-10","tag-audio","tag-avr","tag-dlna","tag-ffmpeg","tag-http-streaming","tag-minidlna","tag-onkyo","tag-pulseaudio","tag-receiver","tag-rygel","tag-sink","tag-streaming","tag-tx-nr515","tag-ubuntu","tag-vlc"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/comments?post=1441"}],"version-history":[{"count":15,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1441\/revisions"}],"predecessor-version":[{"id":1902,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/posts\/1441\/revisions\/1902"}],"wp:attachment":[{"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/media?parent=1441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/categories?post=1441"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sandalov.org\/blog\/wp-json\/wp\/v2\/tags?post=1441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}