Giter Site home page Giter Site logo

masmu / pulseaudio-dlna Goto Github PK

View Code? Open in Web Editor NEW
1.2K 49.0 162.0 1.73 MB

A lightweight streaming server which brings DLNA / UPNP and Chromecast support to PulseAudio and Linux

License: GNU General Public License v3.0

Makefile 0.62% Python 97.37% Shell 2.02%

pulseaudio-dlna's Introduction

About

This is pulseaudio-dlna. A lightweight streaming server which brings DLNA / UPNP and Chromecast support to PulseAudio and Linux. It can stream your current PulseAudio playback to different UPNP devices (UPNP Media Renderers) or Chromecasts in your network. Its main goals are: easy to use, no configuration hassle, no big dependencies.

UPNP renderers in your network will show up as pulseaudio sinks.

Image of pulseaudio-dlna

License

pulseaudio-dlna is licensed under GPLv3.

pulseaudio-dlna is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

pulseaudio-dlna is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with pulseaudio-dlna.  If not, see <http://www.gnu.org/licenses/>.

Donation

Image of pulseaudio-dlna If I could help you or if you like my work, you can buy me a coffee, a beer or pizza.

Changelog

  • master - (2017-04-06)

    • Fixed a bug where the detection of DLNA devices failed when there were multiple network interfaces
    • The application now binds to all interfaces by default
    • When using multiple network interfaces the appropriate network address is being used for streaming (new dependency python-pyroute2 (preferred) or python-netaddr (fallback))
    • Migrated to GI bindings (removed dependencies python-gobject python-rsvg python-gtk2, new dependency python-gi, new optional dependencies gir1.2-rsvg-2.0, gir1.2-gtk-3.0)
    • Fixed a bug where devices with the same name could keep updating each other
    • Fixed a bug where codec bit rates could not be set although those were supported
    • Fixed a bug where a missing xml attribute prevented xml parsing
    • Added the --disable-mimetype-check option
    • Disabled mimetype check for virtual Raumfeld devices
    • Subprocesses now always exit gracefully
    • Added the --chunk-size option
    • Added pulseaudio as an encoder backend (experimental)
    • You can now just start one instance of pulseaudio-dlna
    • Fixed a bug where non-ascii characters in $PATH broke distutils.spawn.find_executable()
    • Also use environment's XDG_RUNTIME_DIR for detecting the DBus socket
    • The detection of the stream servers host address now uses the systems routing table
    • Because of devices with a kernel < 3.9, python-zeroconf >= 0.17.4 is now required
  • 0.5.2 - (2016-04-01)

    • Catched an exception when record processes cannot start properly
  • 0.5.1 - (2016-04-01)

    • Fixed the --filter-device option
    • Prioritize mp3 over flac for Chromecasts
  • 0.5.0.1 - (2016-03-09)

    • Readded manpage
  • 0.5.0 - (2016-03-09)

    • Set Yamaha devices to the appropriate mode before playing (thanks to hlchau) (new dependency: python-lxml)
    • Fixed a bug where some SSDP messages could not get parsed correctly
    • Also support media renderers identifying as urn:schemas-upnp-org:device:MediaRenderer:2
    • Added the --disable-workarounds flag
    • Added the --auto-reconnect flag
    • Added the --encoder-backend option (new optional dependencies ffmpeg, libav-tools)
    • Removed shared encoder processes
    • Increased the default HTTP timeout to 15 seconds
    • Fixed a bug where manually added renderers could appear twice
    • Added device state polling for devices which start playing on their own
    • Added the flac encoder for Google Chromecast
    • Added support for Google Cast Groups (new dependency python-zeroconf)
    • Removed dependency python-beautifulsoup
    • Fixed a bug where bytes were not decoded properly to unicode
  • 0.4.7 - (2015-11-18)

    • The application can now co-exist with other applications which are using the port 1900/udp (thanks to klaernie)
    • Fixed the daemon mode to support psutil 1.x and 2.x (thanks to klaernie)
    • HTML entities in device descriptions are now converted automatically
    • Faster and more reliable device discovery (new dependency python-netifaces)
    • Added the --cover-mode option, one mode requires (optional) dependencies gtk, cairo, rsvg
    • L16 codecs are now selected better (e.g. needed for XBox 360)
    • Fixed a bug where sometimes it was tried to remove sinks twice on cleanup
    • Added the --update-device-config flag
    • Added the --ssdp-ttl, --ssdp-mx, --ssdp-amount options
    • Added the --msearch-port option
  • 0.4.6 - (2015-10-17)

    • Added support for Google Chromecast Audio (thanks to leonhandreke)
    • Fixed a bug where devices which does not specifiy control urls made the application crash
    • Added the --disable-device-stop flag
    • Added the --request-timeout option
    • You can now also add rules to renderers (e.g. DISABLE_DEVICE_STOP, REQUEST_TIMEOUT)
    • Fixed a bug where stream urls where not parsed correctly
    • Fixed a bug which made a Chomecast Audio throwing exceptions while stopping
    • Fixed a bug where the system's default encoding could not be determined when piping the applications output
  • 0.4.5.2 - (2015-09-21)

    • Fixed a bug where the encoding of SSDP headers was not detected correctly (new dependency: python-chardet)
  • 0.4.5.1 - (2015-09-20)

    • Added a missing dependency python-concurrent.futures (thanks to Takkat-Nebuk)
  • 0.4.5 - (2015-09-20)

    • Exceptions while updating sink and device information from pulseaudio are now handled better
    • Changed --fake-http10-content-length flag to --fake-http-content-length to also support HTTP 1.1 requests
    • Fixed a bug where the supported device mime types could not get parsed correctly
    • Fixed a bug where the device UUID was not parsed correctly
    • Fixed a bug where just mime types beginning with audio/ where accepted, but not e.g. application/ogg
    • The stream server will now respond with 206 when receiving requests with range header
    • UPNP control commands have now a timeout of 10 seconds
    • Fixed a bug where the wrong stream was removed from the stream manager
    • Fixed several bugs caused by purely relying on stopping actions for the devices idle state
    • Added L16 Encoder
    • The encoder option can now handle multiple options separated by comma
    • Added the --create-device-config flag
    • Fixed a bug where the dbus session was bound from the wrong process
    • Fix a bug where the wrong device UDN was retrieved from XML documents containing multiple devices
  • 0.4.4 - (2015-08-07)

    • Added --disable-ssdp-listener option
    • Fixed a bug with applications which remove and re-add streams all the time
    • Added a missing dependency python-psutil
  • 0.4.3 - (2015-08-02)

    • Fixed a bug when trying to terminate an encoder process
    • Catch exceptions when trying to update pulseaudio sinks
    • Fixed a timing issue where the streamserver was not ready but devices were already instructed to play
  • 0.4.2 - (2015-08-02)

    • The mp3 encoder is now prioritize over wav
    • Added --disable-switchback option
    • Wav encoders do not longer share their encoder process
  • 0.4.1 - (2015-07-27)

    • Fixed Makefile for launchpad
  • 0.4.0 - (2015-07-27)

    • Added the --fake-http10-content-length option
    • The application can now run as root
    • Catch pulseaudio exceptions for streams, sinks and modules when those are gone
    • Fixed a bug where a missing ssdp header field made the application crash
    • New devices are added now during runtime (thanks to coder-hugo)
    • Rewrite of the streaming server
    • Upnp devices can now request their audio format based on their capabilities
    • Added AAC encoder
    • If a device stops playing, the streams currently playing on the corresponding sink are switched back to the default sink
    • If a device failes to start playing, streams currently playing on the corresponding sink are switched back to the default sink
    • Added Chromecast support (new dependency: python-protobuf)
    • Fixed a bug where the application crashed when there was no suitable encoder found
    • Added the --bit-rate option
    • Added additional headers for DLNA devices
    • Added switch back mode also for sinks, not just for streams (new dependency: python-notify2)
    • Added better logging
    • Validate encoders for installed dependencies
  • 0.3.5 - (2015-04-09)

    • Fixed a bug where Sonos description XML could not get parsed correctly
  • 0.3.4 - (2015-03-22)

    • Fixed Makefile for launchpad
  • 0.3.3 - (2015-03-22)

    • Added the --filter-device option
    • Send 2 SSDP packets by default for better UPNP device discovery
    • Added virtualenv for local installation
  • 0.3.2 - (2015-03-14)

    • Added the Opus Encoder (new dependency: opus-tools) (thanks to MobiusHorizons)
    • Fixed a bug where an empty UPNP device name made the application crash
    • Added a missing dependency (python-gobject)
  • 0.3.1 - (2015-02-13)

  • 0.3.0 - (2015-02-01)

    • Added debian packaging
    • Added proper signal handlers (new dependency: python-setproctitle)
    • Fixed a bug where binding to an already used port made the application crash
    • HTTP charset encoding is now specified correctly
  • 0.2.4 - (2015-01-25)

    • Stream changes are now handled correctly (thanks to Takkat-Nebuk)
  • 0.2.3 - (2015-01-21)

    • Fixed a timing bug where the pulseaudio module was not loaded fast enough (thanks to Takkat-Nebuk)
  • 0.2.2 - (2015-01-18)

    • Fixed encoding issues
    • Try to load the DBus module if it is not loaded before (thanks to Takkat-Nebuk)
  • 0.2.1 - (2015-01-11)

    • TTL changed to 10 and timeout to 5 for UDP broadcasting
    • Added the --renderer-urls option to manually add UPNP devices via their control url
    • Added the --debug flag
    • The host ip address is now discovered automatically, no need to specifiy --host anymore

Installation via PPA

Supported Ubuntu releases:

  • 17.04 (Zesty Zapus)
  • 16.10 (Yakkety Yak)
  • 16.04 (Xenial Xerus)
  • 14.04.2 LTS (Trusty Tahr)

Ubuntu users can install pulseaudio-dlna via the following repository.

sudo apt-add-repository ppa:qos/pulseaudio-dlna
sudo apt-get update
sudo apt-get install pulseaudio-dlna

Starting

After that you can start pulseaudio-dlna via:

pulseaudio-dlna

Head over the the using section for further instructions.

Installation for other distributions

Some community members are providing packages for others distributions. Keep in mind that since i am not using those, i can hardly support them!

Installation via git

Other linux users can clone this git repository, make sure you have all the dependencies installed and the PulseAudio DBus module is loaded.

Basic requirements

These are the requirements pulseaudio-dlna acutally needs to run. These dependencies will get installed if you install it via the PPA.

  • python2.7
  • python-pip
  • python-setuptools
  • python-dbus
  • python-docopt
  • python-requests
  • python-setproctitle
  • python-gi
  • python-protobuf
  • python-notify2
  • python-psutil
  • python-concurrent.futures
  • python-chardet
  • python-netifaces
  • python-pyroute2 | python-netaddr
  • python-lxml
  • python-zeroconf
  • vorbis-tools
  • sox
  • lame
  • flac
  • faac
  • opus-tools

You can install all the dependencies in Ubuntu via:

sudo apt-get install python2.7 python-pip python-setuptools python-dbus python-docopt python-requests python-setproctitle python-gi python-protobuf python-notify2 python-psutil python-concurrent.futures python-chardet python-netifaces python-pyroute2 python-netaddr python-lxml python-zeroconf vorbis-tools sox lame flac faac opus-tools

PulseAudio DBus module

Since version 0.2.2 the DBus module should be loaded automatically, if it was not loaded before. It that does not work, you can load the DBus module in Ubuntu via the following command. Note that you have to do this every time you restart PulseAudio (or your computer).

pacmd load-module module-dbus-protocol

Or to make changes persistant edit the file /etc/pulse/default.pa with your favorite editor and append the following line:

load-module module-dbus-protocol

Install it local

The recommend method of using pulseaudio-dlna is to install it local to a python virtualenv. In that way you will keep your system clean. If you don't like it anymore, just delete the folder. For that method you need some additional dependencies.

virtualenv requirements

  • python-virtualenv (Ubuntu <= 14.04 Trusty LTS)
  • virtualenv (Ubuntu >= 14.10 Utopic)
  • python-dev

So all Ubuntu versions prior to 14.10 Utopic need to install:

sudo apt-get install python-virtualenv python-dev

All Ubuntu versions above install:

sudo apt-get install virtualenv python-dev

Installing & starting

Change to the project root folder and start the installation via:

make

After that you can start pulseaudio-dlna via:

bin/pulseaudio-dlna

Install it to your system

Since some people like it more to install software globally, you can do that too. In many software projects this is the default installation method.

Installing & starting

Change to the root folder and start the installation via:

make install

After that you can start pulseaudio-dlna via:

pulseaudio-dlna

Using

pulseaudio-dlna should detect the ip address your computer is reachable within your local area network. If the detected ip address is not correct or there were no ips found, you still can specifiy them yourself via the host option (--host <your-ip>)

Right after startup it should start searching for UPNP devices in your LAN and add new PulseAudio sinks. After 5 seconds the progress is complete and you can select your UPNP renderers from the default audio control.

In case you just want to stream single audio streams to your UPNP devices you can do this via pavucontrol.

You can install pavucontrol in Ubuntu via the following command:

sudo apt-get install pavucontrol

Note that pulseaudio-dlna has to run all the time while you are listening to your music. If you stop pulseaudio-dlna it will cleanly remove the created UPNP devices from PulseAudio and your UPNP devices will stop playing.

Since 0.4, new devices are automatically discovered as they appear on the network.

CLI

Usage:
    pulseaudio-dlna [--host <host>] [--port <port>][--encoder <encoders> | --codec <codec>] [--bit-rate=<rate>]
                    [--encoder-backend <encoder-backend>]
                    [--filter-device=<filter-device>]
                    [--renderer-urls <urls>]
                    [--request-timeout <timeout>]
                    [--chunk-size <chunk-size>]
                    [--msearch-port=<msearch-port>] [--ssdp-mx <ssdp-mx>] [--ssdp-ttl <ssdp-ttl>] [--ssdp-amount <ssdp-amount>]
                    [--cover-mode <mode>]
                    [--auto-reconnect]
                    [--debug]
                    [--fake-http10-content-length] [--fake-http-content-length]
                    [--disable-switchback] [--disable-ssdp-listener] [--disable-device-stop] [--disable-workarounds] [--disable-mimetype-check]
    pulseaudio-dlna [--host <host>] [--create-device-config] [--update-device-config]
                    [--msearch-port=<msearch-port>] [--ssdp-mx <ssdp-mx>] [--ssdp-ttl <ssdp-ttl>] [--ssdp-amount <ssdp-amount>]
    pulseaudio-dlna [-h | --help | --version]

Options:
    --create-device-config                 Discovers all devices in your network and write a config for them.
                                           That config can be editied manually to adjust various settings.
                                           You can set:
                                             - Device name
                                             - Codec order (The first one is used if the encoder binary is available on your system)
                                             - Various codec settings such as the mime type, specific rules or
                                               the bit rate (depends on the codec)
                                           A written config is loaded by default if the --encoder and --bit-rate options are not used.
    --update-device-config                 Same as --create-device-config but preserves your existing config from being overwritten
       --host=<host>                       Set the server ip.
    -p --port=<port>                       Set the server port [default: 8080].
    -e --encoder=<encoders>                Deprecated alias for --codec
    -c --codec=<codecs>                    Set the audio codec.
                                           Possible codecs are:
                                             - mp3   MPEG Audio Layer III (MP3)
                                             - ogg   Ogg Vorbis (OGG)
                                             - flac  Free Lossless Audio Codec (FLAC)
                                             - wav   Waveform Audio File Format (WAV)
                                             - opus  Opus Interactive Audio Codec (OPUS)
                                             - aac   Advanced Audio Coding (AAC)
                                             - l16   Linear PCM (L16)
    --encoder-backend=<encoder-backend>    Set the backend for all encoders.
                                           Possible backends are:
                                             - generic (default)
                                             - ffmpeg
                                             - avconv
    -b --bit-rate=<rate>                   Set the audio encoder's bitrate.
    --filter-device=<filter-device>        Set a name filter for devices which should be added.
                                           Devices which get discovered, but won't match the
                                           filter text will be skipped.
    --renderer-urls=<urls>                 Set the renderer urls yourself. no discovery will commence.
    --request-timeout=<timeout>            Set the timeout for requests in seconds [default: 15].
    --chunk-size=<chunk-size>              Set the stream's chunk size [default: 4096].
    --ssdp-ttl=<ssdp-ttl>                  Set the SSDP socket's TTL [default: 10].
    --ssdp-mx=<ssdp-mx>                    Set the MX value of the SSDP discovery message [default: 3].
    --ssdp-amount=<ssdp-amount>            Set the amount of SSDP discovery messages being sent [default: 5].
    --msearch-port=<msearch-port>          Set the source port of the MSEARCH socket [default: random].
    --cover-mode=<mode>                    Set the cover mode [default: default].
                                           Possible modes are:
                                             - disabled       No icon is shown
                                             - default        The application icon is shown
                                             - distribution   The icon of your distribution is shown
                                             - application    The audio application's icon is shown
    --debug                                enables detailed debug messages.
    --auto-reconnect                       If set, the application tries to reconnect devices in case the stream collapsed
    --fake-http-content-length             If set, the content-length of HTTP requests will be set to 100 GB.
    --disable-switchback                   If set, streams won't switched back to the default sink if a device disconnects.
    --disable-ssdp-listener                If set, the application won't bind to the port 1900 and therefore the automatic discovery of new devices won't work.
    --disable-device-stop                  If set, the application won't send any stop commands to renderers at all
    --disable-workarounds                  If set, the application won't apply any device workarounds
    --disable-mimetype-check               If set, the application won't check the device's mime type capabilities
    -v --version                           Show the version.
    -h --help                              Show the help.

Samples:

  • pulseaudio-dlna will start pulseaudio-dlna on port 8080 and stream your PulseAudio streams encoded with mp3.
  • pulseaudio-dlna --encoder ogg will start pulseaudio-dlna on port 8080 and stream your PulseAudio streams encoded with Ogg Vorbis.
  • pulseaudio-dlna --port 10291 --encoder flac will start pulseaudio-dlna on port 10291 and stream your PulseAudio streams encoded with FLAC.
  • pulseaudio-dlna --filter-device 'Nexus 5,TV' will just use devices named Nexus 5 or TV even when more devices got discovered.
  • pulseaudio-dlna --renderer-urls http://192.168.1.7:7676/smp_10_ won't discover upnp devices by itself. Instead it will search for upnp renderers at the specified locations. You can specify multiple locations via urls seperated by comma (,). Most users won't ever need this option, but since UDP multicast packages won't work (most times) over VPN connections this is very useful if you ever plan to stream to a UPNP device over VPN.

Device configuration rules

Most times the automatic discovery of supported device codecs and their prioritization works pretty good. But in the case of a device which does work out of the box or if you don't like the used codec you can adjust the settings with a device configuration.

If you want to create a specific configuration for your devices you can do that via the --create-device-config flag. It will search for devices on your network and write a config for them. It will look for / write them at:

  • ~/.local/share/pulseaudio-dlna/devices.json (prioritized)
  • /etc/pulseaudio-dlna/devices.json

The purpose of this is that the application should do the most work for the user. You just have to edit the file instead of writing it completely on your own.

Let's make an example: I started the application via pulseaudio-dlna --create-device-config and that is what was discovered:

    "uuid:e4572d54-c2c7-d491-1eb3-9cf17cf5fe01": {
        "rules": [],
        "flavour": "DLNA",
        "name": "Device name",
        "codecs": [
            {
                "rules": [],
                "bit_rate": null,
                "identifier": "mp3",
                "mime_type": "audio/mpeg"
            },
            {
                "rules": [],
                "identifier": "flac",
                "mime_type": "audio/flac"
            },
            {
                "channels": 2,
                "rules": [],
                "identifier": "l16",
                "sample_rate": 48000,
                "mime_type": "audio/L16;rate=48000;channels=2"
            },
            {
                "channels": 2,
                "rules": [],
                "identifier": "l16",
                "sample_rate": 44100,
                "mime_type": "audio/L16;rate=44100;channels=2"
            },
            {
                "channels": 1,
                "rules": [],
                "identifier": "l16",
                "sample_rate": 44100,
                "mime_type": "audio/L16;rate=44100;channels=1"
            }
        ]
    }

It was detected that the device supports the following codecs:

  • audio/mp3
  • audio/flac
  • audio/L16;rate=48000;channels=2
  • audio/L16;rate=44100;channels=2
  • audio/L16;rate=44100;channels=1

If you don't change the configuration at all, it means that the next time you start pulseaudio-dlna it will automatically use those codecs for that device. The order of the list also defines the priority. It will take the first codec and use it if the appropriate encoder binary is installed on your system. If the binary is missing it will take the next one. So here the mp3 codec would be used, if the lame binary is installed.

You can also change the name of the device, adjust the mime type or set the bit rate. A null value means default, for bit rates this is set to 192 Kbit/s.

In that case I want to rename my device to "Living Room". Besides that I don't want the L16 codecs, so i simply remove them and i want my mp3 to be encoded in 256 Kbit/s.

    "uuid:e4572d54-c2c7-d491-1eb3-9cf17cf5fe01": {
        "rules": [],
        "flavour": "DLNA",
        "name": "Living Room",
        "codecs": [
            {
                "rules": [],
                "bit_rate": 256,
                "identifier": "mp3",
                "mime_type": "audio/mpeg"
            },
            {
                "rules": [],
                "identifier": "flac",
                "mime_type": "audio/flac"
            }
        ]
    }

But as it turns out this device has a problem with playing the mp3 stream when you don't specify the --fake-http-content-length flag. Let's say flac works without the flag. So, you can add a rule for that to that device.

    "uuid:e4572d54-c2c7-d491-1eb3-9cf17cf5fe01": {
        "rules": [],
        "flavour": "DLNA",
        "name": "Living Room",
        "codecs": [
            {
                "rules": [
                    {
                        "name": "FAKE_HTTP_CONTENT_LENGTH"
                    }
                ],
                "bit_rate": 256,
                "identifier": "mp3",
                "mime_type": "audio/mpeg"
            },
            {
                "rules": [],
                "identifier": "flac",
                "mime_type": "audio/flac"
            }
        ]
    }

That's it. pulseaudio-dlna will automatically use that config if you don't use the --encoder or --bit-rate options.

Known Issues

  • Distorted sound

    If you experience distorted sound, try to pause / unpause the playback or changing / adjusting the volume. Some encoders handle volume changes better than others. The lame encoder handles this by far better than most of the other ones.

  • There is a delay about a few seconds

    Since there is HTTP streaming used for the audio data to transport, there is always a buffer involved. This device buffer ensures that even if you suffer from a slow network (e.g. weak wifi) small interruptions won't affect your playback. On the other hand devices will first start to play when this buffer is filled. Most devices do this based on the received amount of data. Therefore inefficient codecs such as wav fill that buffer much faster than efficient codecs do. The result is a noticeable shorter delay in contrast to e.g. mp3 or others. Note, that in this case your network should be pretty stable, otherwise your device will quickly run out of data and stop playing. This is normally not a problem with cable connections. E.g. I have a delay about 1-2 seconds with wav and a delay of about 5 seconds with mp3 with the same cable connected device. You can decrease the delay when using wav or using high bit rates, but you won't get rid of it completely. My advice: If you have a reliable network, use wav. It is lossless and you will get a short delay. If you have not, use another encoder which does not require that much bandwidth to make sure your device will keep playing. Of course you will be affected from a higher delay.

Troubleshooting

  • My device does not get discovered by pulseaudio-dlna

    The computer pulseaudio-dlna is running on and your device needs to be in the same network. In uncomplicated home LANs this is normally the case. You can test if other applications are able to find your device, e.g. BubbleUPnP (Android application). If they do it is likely that you are using a firewall / iptables. Try disabling it. If you verified that your firewall is blocking, you should use the --msearch-port <port> option and open port 8080/tcp, port 1900/udp and port <port>/udp.

  • The device is successfully instructed to play, but the device never connects to pulseaudio-dlna

    Check if your are using a firewall / iptables. If that works, open port 8080/tcp and port 1900/udp.

  • The device is successfully instructed to play, but the device immediately disconnects after some seconds

    Some devices do not stick to the HTTP 1.0/1.1 standard. Since most devices do, pulseaudio-dlna must be instructed by CLI flags to act in a non-standard way.

    • --fake-http-content-length

      Adds a faked HTTP Content-Length to HTTP 1.0/1.1 responses. The length is set to 100 GB and ensures that the device would keep playing for months. This is e.g. necessary for the Hame Soundrouter and depending on the used encoder for Sonos devices.

Tested devices

A listed entry means that it was successfully tested, even if there is no specific codec information available.

Device mp3 wav ogg flac aac opus l16
AVM FritzRepeater N/G โœ… โ” โ” โ” โ” โ” โ”
BubbleUPnP (Android App) โœ… โœ… โœ… โœ… โœ… ๐Ÿšซ โœ…
Cocy UPNP media renderer โœ… ๐Ÿšซ โœ… ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
D-Link DCH-M225/E โœ… โœ… ๐Ÿšซ โœ… โœ… ๐Ÿšซ ๐Ÿšซ
DAMAI Airmusic โ” โ” โ” โ” โ” โ” โ”
Denon AVR-3808 โ” โ” โ” โ” โ” โ” โ”
Denon AVR-X4000 โœ… โ” โ” โœ… โ” โ” โ”
Freebox Player Mini (4K) โœ… ๐Ÿšซ ๐Ÿšซ โœ… โœ… ๐Ÿšซ ๐Ÿšซ
Freebox Player (Revolution) โœ… โœ… โœ… โœ… ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
gmrender-resurrect โœ… โ” โ” โ” โ” โ” โ”
Google Chromecast (1st gen) โœ… โœ… โœ… โœ… โœ… ๐Ÿšซ ๐Ÿšซ
Google Chromecast Audio โœ… โœ… โœ… โœ… โœ… ๐Ÿšซ ๐Ÿšซ
Hame Soundrouter โœ…1 ๐Ÿšซ ๐Ÿšซ โœ…1 ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
LG BP550 โ” โ” โ” โ” โ” โ” โ”
Libratone ZIPP โœ… โœ… โœ… โœ… ๐Ÿšซ ๐Ÿšซ โœ…
Logitech Media Server โ” โ” โ” โ” โ” โ” โ”
Majik DSM โ” โ” โ” โ” โ” โ” โ”
Medion P85055 โ” โ” โ” โ” โ” โ” โ”
Naim Mu-So โœ… โœ… โœ… โœ… โ” โ” โœ…
Onkyo TX-8050 โœ… โœ… โ” โ” โ” โ” โœ…
Onkyo TX-NR509 โ” โœ… โ” ๐Ÿšซ โ” โ” โ”
Onkyo TX-NR616 7 โ” โœ… โ” โ” โ” โ” โ”
Onkyo TX-NR646 โœ… โ” โ” โ” โ” โ” โ”
Onkyo TX-NR727 7 โ” โ” โ” โ” โ” โ” โ”
Onkyo CR-N755 โœ…8 โœ… ๐Ÿšซ ๐Ÿšซ โ”9 ๐Ÿšซ โœ…
Oppo Sonica โœ… ๐Ÿšซ ๐Ÿšซ โœ… โœ… โ” โœ…
Pi MusicBox โ” โ” โ” โ” โ” โ” โ”
Panasonic TX-50CX680W โ” โ” โ” โ” โ” โ” โ”
Panasonic TX-50CX680W โœ… โœ… โ” โ” โ” โ” โ”
Philips NP2500 โ” โ” โ” โ” โ” โ” โ”
Philips NP2900 โ” โ” โ” โ” โ” โ” โ”
Pioneer SC-LX76 (AV Receiver) โœ… โœ… ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ โœ…
Pioneer VSX-824 (AV Receiver) โ” โ” โ” โ” โ” โ” โ”
Pure Jongo S3 โ” โ” โ” โ” โ” โ” โ”
Raumfeld One M โœ… โœ… ๐Ÿšซ โœ… โ” ๐Ÿšซ ๐Ÿšซ
Raumfeld Speaker M โ” โ” โ” โ” โ” โ” โ”
Raumfeld Speaker S โœ… โœ… โœ… โœ… โ” โ” โ”
ROCKI โ” โ” โ” โ” โ” โ” โ”
rygel โ” โ” โ” โ” โ” โ” โ”
RaidSonic IB-MP401Air โ” โ” โ” โ” โ” โ” โ”
Samsung Smart TV LED32 (UE32ES5500) โœ… ๐Ÿšซ โœ… โœ… ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ
Samsung Smart TV LED40 (UE40ES6100) โœ… โ” โ” โ” โ” โ” โ”
Samsung Smart TV LED46 (UE46ES6715) โœ… ๐Ÿšซ โœ… โœ… ๐Ÿšซ โ” ๐Ÿšซ
Samsung Smart TV LED48 (UE48JU6560) โœ… โœ… โœ… โœ… โšช2 ๐Ÿšซ ๐Ÿšซ
Samsung Smart TV LED60 (UE60F6300) โœ… โ” โ” โ” โ” โ” โ”
Sonos PLAY:1 โœ…3 โœ… โœ…3 โœ… ๐Ÿšซ ๐Ÿšซ โ”
Sonos PLAY:3 โœ…3 โœ… โœ…3 โœ… ๐Ÿšซ ๐Ÿšซ โ”
Sony SRS-X77 โœ…1 ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ โœ…1
Sony SRS-X88 โœ…1 ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ โœ…1
Sony SRS-ZR5 โœ… โœ… โœ… โœ… โœ… ๐Ÿšซ ๐Ÿšซ
Sony STR-DN1050 (AV Receiver) โ” โ” โ” โ” โ” โ” โ”
Volumio โœ… โ” โ” โ” โ” โ” โ”
Volumio 2 โœ… โ” โ” โ” โ” โ” โ”
Xbmc / Kodi โœ… โœ… โœ… โœ… โšช2 โšช2 โœ…
Xbox 360 โœ…5 ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ โ” ๐Ÿšซ โœ…
Yamaha CRX-N560D 4 โœ… ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ ๐Ÿšซ โœ…
Yamaha RX-475 (AV Receiver) โ” โ” โ” โ” โ” โ” โ”
Yamaha RX-V573 (AV Receiver) 6 โ” โ” โ” โ” โ” โ” โ”
WDTV Live โ” โ” โ” โ” โ” โ” โ”

1) Works when specifing the --fake-http-content-length flag

2) Is capable of playing the codec, but does not specifiy the correct mime type

3) Works since 0.4.5 (--fake-http-content-length is added automatic)

4) The device needs to be in SERVER mode to accept instructions

5) Was reported to buffer really long. Approximately 45 seconds

6) Was reported to have issues being discovered. Make sure you run the latest firmware

7) Reported to need a --request-timeout of 15 seconds to work. Since 0.5.0 the timeout is set to that value.

8) Stuttering at 256kbit/s and pretty unstable at 320kbit/s

9) The manual states it is supported. No success yet, neither with --fake-http-content-length nor with increased timeout values

Supported encoders

Encoder Description Identifier
lame MPEG Audio Layer III mp3
oggenc Ogg Vorbis ogg
flac Free Lossless Audio Codec flac
sox Waveform Audio File Format wav
opusenc Opus Interactive Audio Codec opus
faac Advanced Audio Coding aac
sox Linear PCM l16

You can select a specific codec using the --encoder flag followed by its identifier.

pulseaudio-dlna's People

Contributors

ambassadortux avatar antony avatar awidegreen avatar coder-hugo avatar d-vogel avatar dandv avatar e-alfred avatar ehntoo avatar gregorian21 avatar hlchau avatar hoojii avatar hv15 avatar joanwa avatar kelunik avatar klaernie avatar kristianholsheimer avatar leonhandreke avatar masmu avatar michaelkebe avatar nickdavies avatar plaes avatar q1x avatar regagain avatar sam-hobbs avatar sfstpala avatar super7ramp avatar svenpeldszus avatar vmx avatar zopieux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pulseaudio-dlna's Issues

Sangean DDR-63+ Support

Hi there, similar to #32 I have a problem with my Sangean DLNA client when I assign an audio output to it.

INFO:root:Found devices:
<CoinedUpnpMediaRenderer name="DDR-63+ 002261a8ce7e" short_name="ddr63002261a8ce7e" state="idle">
INFO:root:You can now use your upnp devices!
INFO:root:PulseWatcher.on_device_updated "/org/pulseaudio/core1/sink5"
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 230, in maybe_handle_message
    self._handler(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/pulseaudio.py", line 259, in on_device_updated
    self._handle_sink_update(sink_path)
  File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/pulseaudio.py", line 294, in _handle_sink_update
    if bridge.upnp_device.register() == 200:
  File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/upnp/renderer.py", line 253, in register
    return UpnpMediaRenderer.register(self, self.stream_url)
  File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/upnp/renderer.py", line 141, in register
    url = self._get_av_transport_url()
  File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/upnp/renderer.py", line 118, in _get_av_transport_url
    return self._get_url(av_transport['control_url'])
TypeError: 'NoneType' object has no attribute '__getitem__'

Add an option to not stop playback when all playbackstreams are destroyed

It would be great to have a 'continious stream' option so that if playbackstreams are destroyed it would not stop the device from playing.

Some music players without gapless playback with recreate playback stream for each track. This will make pulseaudio-dlna to issue stop to device and then play again, which is undesired

Veetop AirMusic box

This was working perfectly with my AirMusic box up until commit
15e51f1

Since then it is not recognised at all. My Chromecast is recognised. There have been some pretty major changes since then, not sure what's broken it for me. I'm on Ubuntu Gnome 15.04.

Thanks

version 4.x and switch back to default sink

Hi,
is it possible to get a switch for this new behaviour:
"If a device stops playing, the streams currently playing on the corresponding sink are switched back to the default sink"
Using version 4.1 with my Majik DSM every so often for no apparent reason output is switched back to my hardware sound card. It is possible then to directly switch back to padlna, but if you are not sitting near your computer, this behaviour ist really annoying.
Thx and bye.
Michael.

Majik DSM

Hi,
first let me say thank you for that really useful and simple to use piece of software! You've got a few Euros yesterday, because I was totally excited about it after having no success with rygel for months.
One question though:
We have a Majik DSM and two Phillips NP2900 in our network.
After installing your package yesterday everything worked like a charme.
Today the Majik DSM refused to play anything from its pulseaudio output device - no sound, although the device existed and pavucontrol clearly showed, that the music was playing.
After fiddling around a bit the solution was simply to switch the output in the playback section of pavucontrol to a different renderer and switch it back to the Majik DSM.
Is there anything you can send the Majik DSM (for example some kind of start signal), so that it will start playing without that manual back and forth switching?
Thx a lot!
Bye.
Michael.

failed to start on arch (manjaro kde)

hello,

here is what i have when i try to start pulseaudio-dlna

$ python pulseaudio_dlna
Traceback (most recent call last):
  File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "pulseaudio_dlna/__main__.py", line 52, in <module>
    import pulseaudio_dlna
ImportError: No module named 'pulseaudio_dlna'

i cloned the repos and cd pulseaudio-dlna
i checked/installed all dependencies
i tried to chmod +x all .py scripts
i am not a python ninja
any idea ?
i would love to run pusleaudio-dlna on my arch lap-top (combined with a rpi Musicbox)
if i succeed, it would be a great oportunity for me to learn how to build an arch package.

Load pulseaudio module-dbus-protocol at runtime

Rather than exiting the application it would be nicer to load the missing module-dbus-protocol at runtime. This module was not loaded in a default Ubuntu installation. Therefore before running pulseaudio-dlna a manual loading of this pulseaudio module or editing of default.pa is always required.

This may not be wanted later when users may be able to install e.g. by a DEB package.

Loading of this missing module can be done with the following lines in pulseaudio.py

    def _get_bus(self):
        try:
            server_address = self._get_bus_address()
            return dbus.connection.Connection(server_address)
        except dbus.exceptions.DBusException:
            subprocess.Popen(['pactl','load-module','module-dbus-protocol'])
            try:
                server_address = self._get_bus_address()
                return dbus.connection.Connection(server_address)
            except dbus.exceptions.DBusException:
                logging.error('PulseAudio seems not to be running ')
                sys.exit(1)

Cannot apt-add-repository ppa:qos/pulseaudio-dlna

apt-add-repository ppa:qos/pulseaudio-dlna
You are about to add the following PPA to your system:
A small DLNA server which brings DLNA / UPNP support to PulseAudio and Linux.

It can stream your current PulseAudio playback to different UPNP devices (UPNP Media Renderers) in your network. It's main goals are: easy to use, no configuration hassle, no big dependencies.

https://github.com/masmu/pulseaudio-dlna
More info: https://launchpad.net/~qos/+archive/ubuntu/pulseaudio-dlna
Press [ENTER] to continue or ctrl-c to cancel adding it

Traceback (most recent call last):
File "/usr/bin/apt-add-repository", line 160, in
sp = SoftwareProperties(options=options)
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 96, in init
self.reload_sourceslist()
File "/usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py", line 584, in reload_sourceslist
self.distro.get_sources(self.sourceslist)
File "/usr/lib/python2.7/dist-packages/aptsources/distro.py", line 87, in get_sources
raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

Startup error

When starting pulseaudio-dlna, I get the following error:

Traceback (most recent call last):
  File "bin/pulseaudio-dlna", line 9, in <module>
    load_entry_point('pulseaudio-dlna==0.3.4', 'console_scripts', 'pulseaudio-dlna')()
  File ".../masmu/pulseaudio-dlna/pulseaudio_dlna/__main__.py", line 160, in main
    pulseaudio_dlna.startup()
  File ".../masmu/pulseaudio-dlna/pulseaudio_dlna/__main__.py", line 121, in startup
    print(upnp_device)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 32: ordinal not in range(128)

FEATURE REQ: DLNA Renderer

This is a feature request:
I was wondering if Pulseaudio-dlna will ever act as a DLNA Media Renderer,
The scenario is:
Laptop or desktop computer (Pulseaudio-dlna) connected to a HiFi set with a good pair of speakers.
You and all of your house guests can reproduce the music that you have on the phones. Super!
No more usb cables copying files back and forth!
Thank you for sharing

systray support

I made systray application for pulseaudio_dlna. I just test it on Linuxmint with Cinnamon.

pulseaudio-dlna-systray

Stop menu item need signal-handler support for working proper.

Lubuntu ARM not working

Hello,
First of all: This is a great piece of software. I installed it on my Ubuntu 12.10 and it works like a charm, but I ran into trouble on Lubuntu ARM. I get an DBUS error which is very bad vor me as the target machine was the Lubuntu ARM and the Ubuntu 12.10 was just for testing :)
What I have tried so far is:

  • installation of all packages listed by pulseaudio-dlna
  • loading dbus module (I checked it.)

"pacmd list-modules" brings up:

index: 23
name:
argument: <>
used: -1
load once: yes
properties:
module.author = "Tanu Kaskinen"
module.description = "D-Bus interface"
module.version = "4.0"

  • so I would expect that dbus is running. I also tried to start pulseaudio again which states that already an instance is running.

-next I ran your script which seems to find all my dlna renderer:
./pulseaudio_dlna.py -p 1234 --debug

result:
...
Failure: Module initialization failed
ERROR:root:PulseAudio seems not to be running or pulseaudio dbus module could not be loaded.

I also started in parallel the dbus-monitor wondering if something happens there, but no message was received. I have no idea where to search for the issue. Any hint to solve to problem would be great. Thanks in advance. I would really like to get it up an running on my odroid. This was the only solution on the internet so far which totally met my needs :)

best
freggel

Move debian packaging stuff to a separte project

It's very uncommon to provide sources for a specific package manager within the main project as there are many different package managers out there. It's a common way to have a separate project for the packaging stuff.
If I remember correctly all of the documentations/tutorials I've seen about debian packaging say something similar. All of them describe how to build a debian package for a soures.tar.gz.

Fails to connect to Sink

I have a Raspberry Pi with Raspbian, with BubbleUPNP installed.
And when i try to connect. i get these errors:

pulseaudio-dlna
Using localhost: 192.168.1.30:8080
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.44
INFO:root:found upnp_device ""
INFO:root:Discovery complete. You can now use your upnp devices!
Fehlgeschlagen: Modulinitialisierung fehlgeschlagen
Traceback (most recent call last):
File "/usr/bin/pulseaudio-dlna", line 9, in
load_entry_point('pulseaudio-dlna==0.3.1', 'console_scripts', 'pulseaudio-dlna')()
File "/usr/lib/python2.7/dist-packages/pulseaudio_dlna/main.py", line 147, in main
pulseaudio_dlna.startup()
File "/usr/lib/python2.7/dist-packages/pulseaudio_dlna/main.py", line 128, in startup
self.pulse.set_upnp_devices(upnp_devices)
File "/usr/lib/python2.7/dist-packages/pulseaudio_dlna/pulseaudio.py", line 242, in set_upnp_devices
self._ensure_bridge(upnp_device)
File "/usr/lib/python2.7/dist-packages/pulseaudio_dlna/pulseaudio.py", line 247, in _ensure_bridge
upnp_device.short_name, upnp_device.name)
File "/usr/lib/python2.7/dist-packages/pulseaudio_dlna/pulseaudio.py", line 121, in create_null_sink
entity_id = int(subprocess.check_output(cmd))
File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '[u'pactl', u'load-module', u'module-null-sink', u'sink_name=""', u'sink_properties=device.description=""']' returned non-zero exit status 1

Sangean DDR-63+ ValueError UPNP Renderer

When I'm running pulseaudio-dlna and have my Sangean set to network player mode I encounter the following error twice:

Exception happened during processing of request from ('192.168.178.32', 52591)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 599, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 655, in init
self.handle()
File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/listener.py", line 36, in handle
self.server.renderers_holder.process_notify_request(packet)
File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/renderers.py", line 119, in process_notify_request
self._add_renderer_with_filter_check(device_id, device)
File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/renderers.py", line 67, in _add_renderer_with_filter_check
self._add_renderer(device_id, device)
File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/renderers.py", line 73, in _add_renderer
device.activate()
File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/plugins/upnp/renderer.py", line 156, in activate
self.get_protocol_info()
File "/usr/lib/python2.7/site-packages/pulseaudio_dlna/plugins/upnp/renderer.py", line 250, in get_protocol_info
http_get, w1, mime_type, w2 = sink.strip().split(':')
ValueError: need more than 1 value to unpack

System info:

Linux version 3.18.20-1-MANJARO (builduser@manjaro) (gcc version 5.2.0 (GCC) )
pulseaudio-dlna 0.4.3-1 from AUR

version 4.x : "The SSDP listener could not bind to the port 1900/UDP"

Thanks for "pulseaudio-dlna", it is generally very usefull.

I was using "pulseaudio-dlna" on a Linux Mint 17.2 Cinnamon 64-bit computer to push the sound on my HiFi music player Sony:CMT-SBT300W. It worked fine with the 3.5 version.

After an update to 4.3 version, "pulseaudio-dlna" terminates with this message (whether the musicplayer is connected or not) :

"pulseaudio dlna.application ERROR The SSDP listener could not bind to the port 1900/UDP. Perhaps this is already in use? Application terminates"

I am back to 3.5 and it works again.

Distortion on multiples sources

Hey,
thanks for this extension, works perfectly for me in general!

However, I am observing a problem I cannot explain. Assume I choose the dlna device as default sound device. When I start streaming music, delay is fine at about 2 seconds. The problem occurs if a new local sound source starts (i.e. new Playback in PulseAudio Volume Control). This is e.g. when a new sound application starts or each time skype pops up a notification, each time you switch to another desktop.... This also occurs if I change the volume (either application or sound device). At this time, there is distortion created in the stream, that I hear after about 2 seconds.

I want to describe what I mean by distortion. I would expect the two sources to be mixed and to be sent onto the stream. But this has two side-effects:

  1. The music playback at this time is not seamlessly but sounds like some scratching because of empty buffers (stuttering) for a bit less than a second.
  2. Additionally, (because of the stuttering?) it makes the complete playback to become more delayed

For me, this does not really seem to be a core problem of your pulseaudio-dlna. Instead, it seems to be related to pulseaudio that mixes in the new sound. However, if I playback on a local device everything sounds seamlessly. Could there be a problem on the interface between pulseaudio and the dlna playback device?

Btw, if I feed the stream directly from the music application only, there is no stuttering when another sound is played on a local device or when I change the volume.

Are you aware of this or can you even verify this behaviour?
Thanks,

Steffen

option to allow multiple encoders

Feature Request:

create an option to select multiple encoders.

Maybe something like this is appropriate:
--encoders wav,flac

It would be cool to set also the order. When I start pa-dlna without --encoder parameter every possible encoder is activated, but I want a selection out of that. The order would define the sequence of audio formats for streaming.

With "--encoders wav,flac,mp3" for example only the encoder wav, flac, and mp3 would be activated and wav is preferred over flac and flac over mp3.

Rasberry Pi support

Hi,

I have a use case in which I would like to watch a movie in the Kodi (on Raspberry pi, running Archlinux Arm) and wish to stream the sound into my phone, so potentially I will hook headphones into the phone and will be able to listen to the movie without interupting anyone else

So far I think we are lacking dependencies, can you make sense for me if your project could do such a thing? and whether you will be able to help me getting my use case working?

Startup from network manager dispatcher fails

Hi,

I'm starting pulseaudio-dlna using NetworkManager dispatcher : https://wiki.archlinux.org/index.php/NetworkManager#Network_services_with_NetworkManager_dispatcher
when connection is up / down it executes scripts in a given directory.

In order to connect to existing dbus session I launch pulseaudio-dlna with such commands (in a bash script):

pid=`pidof pulseaudio` 
user=`ps -p $pid -o user=`
export `strings /proc/$pid/environ | grep DBUS_SESSION_BUS_ADDRESS`
sudo -E -u $user pulseaudio-dlna --debug 

I get some errors :

pa_context_connect() has failed: Connection refused

It cannot connect to dbus session daemon. When I execute same script from a terminal pulseaudio-dlna starts gently.
I found some interesting posts about connection from root to user dbus session :
http://lists.freedesktop.org/archives/dbus/2010-May/012766.html
I checked uid and DBUS_SESSION_BUS_ADDRESS was correctly set when some pactl subrpocesses are spawn but it does not help.

Have I missed something? Have you got some suggestions?

lah

Create DLNA/UPNP Group

It would be helpful if there was the ability to create a group of speakers that appeared as one device rather than each target having to be a separate device. It would also be cool if you could assign the to channels ie; LF, RF, RR, LR, Center.

I was able to do this manually by joining sinks and assigning channels to each through pulse audio but it was difficult to do.

closing pavucontrol stops playback

I open pavucontrol to select the audio device for the application (e.g. Spotify client). When I close pavucontrol the stream immediately stops and is not coming back when reopening pavucontrol.

cant stream to hamemusic soundrouter

hi

I am using a Hame UPNP/DLNA soundrouter (http://hamedata.com/hamemusic/hamemusic-help.html) to stream sound over wifi to a regular stereo amp. The device works just fine with my droid smartphone and tablet, using the bubbleupnp app. To stream audio from my ubuntu 14.04 laptop your solution would be perfect. But I cant get it to stream the audio.

The discovery of the soundrouter works as long as I connect my laptop to the hame wifi network with its own IP range and SSID. This is different from the android devices that discover the soundrouter even if they are connected to the regular home wifi network.

So here is what I do for discovery and what I get in return in the terminal
bb@dell6410:~$ pulseaudio-dlna
Using localhost: 192.168.169.2:8080
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.169.1
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.169.1
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.169.1
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.169.1
INFO:root:Discovery complete.
INFO:root:Found devices:

INFO:root:You can now use your upnp devices!
INFO:root:PulseWatcher.on_device_updated "/org/pulseaudio/core1/sink1"
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.169.1
192.168.169.1 - - [16/Apr/2015 22:31:08] "GET /hamemusic517a.stream HTTP/1.0" 200 -
INFO:root:starting sending stream to "HameMusic_517a"
INFO:root:"HameMusic_517a" registered.
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.169.1
INFO:root:"HameMusic_517a" is playing.
INFO:root:stream closed. cleaning up remaining procecces
INFO:root:PulseWatcher.on_new_playback_stream "/org/pulseaudio/core1/playback_stream26"
INFO:root:PulseWatcher.on_playback_stream_removed "/org/pulseaudio/core1/playback_stream26"
INFO:root:PulseWatcher.on_new_playback_stream "/org/pulseaudio/core1/playback_stream27"
INFO:root:PulseWatcher.on_playback_stream_removed "/org/pulseaudio/core1/playback_stream27"

As soon as I start playing I get
INFO:root:"HameMusic_517a" is playing.
INFO:root:stream closed. cleaning up remaining procecces

In soundsettings the device is visible, running test sounds gives me the same results.

All help would be very much appreciated. In Linux I have some experience but not all that much.

Output stream is only directed to DLNA device with a pre-existent stream.

We can smoothly switch our output stream from any sink to any DLNA sink created by pulseaudio-dlna and back by using the Ubuntu indicator sound applet. This is awesome!

But this will not work as expected if there was no stream present at the time we started pulseaudio-dlna.

  1. We can switch our output sink to the DLNA device, it will be listed in pacmd list-sinks, and pulseaudio-dlna PulseWatcher recognizes switching sinks. But a newly started stream will not be directed to the DLNA sink. There is no pulseaudio sink-input.
  2. Switching the output to any other sink (which could also be another DLNA device created by pulseaudio-dlna !) while playing a stream and then switching back to the desired DLNA device will make a DLNA sink-input available, streams then are as expected.
  3. We stopped the stream before switching to another non-DLNA sink. Then we switched back to the DLNA sink before we again started playing any stream. This will also work with little issues only (i.e. a somewhat longer delay).

I could trace this down to parec which, while running pulseaudio-dlna, will only be loaded when a stream was present. It will then stay loaded (even after the stream had disappeared) to send its stream to a DLNA sink selected as output device.

It may be that this is more an issue on the pulseaudio side but still it is confusing, and it would be very nice to be able to define the DLNA device as output sink before we start audio output.

To overcome this issue I was wondering if starting parec with e.g. a dummy stream on selecting a DLNA sink if there was no active stream present could be a solution. Alternatively it would be cool to find another way to switch to a DLNA sink when there are not yet any streams ready.

Fix typo

Just a small typo:

In __main__.py on line 88, determiate should be determine instead.

Thanks!

gapless

Hi,
is it possible to have gapless playback with pulseaudio-dlna?
If I don't get gapless playback, is it the application or is it pulseaudio or is it pulseaudio-dlna?
Renderer is my Linn MajiK-DSM, which definitely is capable of gapless playback.

TIA.
Bye.
Michael.

Use localhost IP if no --host option was given

To further ease usage let me suggest we use localhost IP if no IP was given as an option.

This can e.g. be done by changing code in pulseaudio_dlna.py as below:

+ import subprocess

-    if not options['--host']:
-        print('You must specify host address!')
-        sys.exit(1)
-    else:
-        host = str(options['--host'])
-        port = int(options['--port'])
+    port = int(options['--port'])
+    if options['--host']:
+        host = str(options['--host'])
+    else:
+        retcode = subprocess.Popen(['hostname', '-I'], stderr=subprocess.PIPE, stdout=subprocess.PIPE)
+        host = retcode.communicate()[0].decode().strip('\n')
+        print ('Using localhost: ' + host)

how to stream to android?

On your screenshot I see "Nexus 5" as a device. I haven't managed to make this work.
What are you using for this? BubbleUPnP? How is it set up?

Sound lag

Hello,

I'm using pulseaudio-dlna to stream audio from Ubuntu 14.04 to BubbleUPnP on Android phone. Works great, except there is audio lag about 5-15 seconds between sound was produced and moment when it reaches phone. By using fast forward button in BubbleUPnP I was able to minize lag to about 2 seconds, but 2 seconds is still too much (I would like to watch movie on TV connected to Ubuntu via HDMI cable, but stream audio to the phone). Is it possible to reach almost realtime delay or this is DLNA limitation and lag always will present?

Fedora rpm packages

Hi there,

I've setup a fedora copr repo at https://copr.fedoraproject.org/coprs/cygn/pulseaudio-dlna/
It's built on refactor branch so the current version is 3.4.

As a side note, I had to include notify2.py with the sources as it's not available in fedora, and encoders except vorbis are optional dependencies. I also had to hack setup.py a bit and add a MANIFEST.in to build the src.rpm correctly.

Thx for your work!

pulseaudio-dlna 0.4.1 stopped working

Hello,

thanks a lot for this lovely app.

The old version (0.3.x) worked very nicely between ubuntu and kodi. Since i accidentially installed 0.4.1 the connection to the dlna renderer is closed some seconds after i do switch to the renderer.

07-30 12:13:05 pulseaudio_dlna.streamserver INFO Requested streaming URL was: /musicbuero_dlna.wav (HTTP/1.1)
07-30 12:13:05 pulseaudio_dlna.streamserver INFO Got request from 192.168.123.132 - GET /musicbuero_dlna.wav HTTP/1.1,200,-
07-30 12:13:05 pulseaudio_dlna.streamserver INFO Client 192.168.123.132 registered to stream /musicbuero_dlna.wav.
07-30 12:13:05 pulseaudio_dlna.streamserver INFO Processes of /musicbuero_dlna.wav initialized ...
sox WARN wav: Length in output .wav header will be wrong since can't seek to fix it
07-30 12:13:05 pulseaudio_dlna.streamserver INFO Requested streaming URL was: /musicbuero_dlna.wav (HTTP/1.1)
07-30 12:13:05 pulseaudio_dlna.streamserver INFO Client 192.168.123.132 unregistered stream /musicbuero_dlna.wav using method 2.
07-30 12:13:05 pulseaudio_dlna.streamserver INFO Got request from 192.168.123.132 - GET /musicbuero_dlna.wav HTTP/1.1,200,-
07-30 12:13:05 pulseaudio_dlna.streamserver INFO Client 192.168.123.132 registered to stream /musicbuero_dlna.wav.
07-30 12:13:12 pulseaudio_dlna.streamserver INFO Client 192.168.123.132 unregistered stream /musicbuero_dlna.wav using method 2.
07-30 12:13:14 pulseaudio_dlna.streamserver INFO Stream closed. Cleaning up remaining processes ...
07-30 12:13:14 pulseaudio_dlna.pulseaudio INFO on_device_updated "/org/pulseaudio/core1/sink1"
07-30 12:13:15 pulseaudio_dlna.pulseaudio INFO The device "MusicBuero (DLNA)" was stopped.
C07-30 12:13:34 pulseaudio_dlna.pulseaudio INFO Remove "musicbuero_dlna" sink ...
Application is shutting down.
07-30 12:13:34 pulseaudio_dlna.pulseaudio INFO Remove "musicbuero_dlna" sink ...
07-30 12:13:34 pulseaudio_dlna.pulseaudio ERROR Could not remove entity 43

Just for your info. Old version still works very nicely.

Can'T stream to Philips AW9000

Hi Masmu,

thanks for your awsome work that you have done! I'm looking for precisely the solution that you started to implement! Maybe the pulseaudio-guys see this and will add this, because it looks to me, that with Rygel this cannot be achieved.

I have been following this issue here: "cant stream to hamemusic soundrouter" and have installed the latest developer-version, including your updates 7 days ago.

I try to play a wav-file to exclude any conversion issues, that does work when played through other apps.

The paplay-command starts to play and the speaker-status-light start to flash, as would be normal for playback. However, no music will be heard. Terminating pulse-dlna during playback reverts output to the default device and I can hear on local speakers.

I have attached all the information that you wanted to look into the other thread. I hopy you are able to help me.

Thanks Mario

HAME soundrouter discovery issue

I am using a Hame UPNP/DLNA soundrouter (http://hamedata.com/hamemusic/hamemusic-help.html) to stream sound over wifi to a regular stereo amp. The device works just fine with my droid smartphone and tablet, using the bubbleupnp app. To stream audio from my ubuntu 14.04 laptop your solution would be perfect.

The discovery of the soundrouter works as long as I connect my laptop to the hame wifi network with its own IP range and SSID. This is different from the android devices that discover the soundrouter even if they are connected to the regular home wifi network.

Sonos UPNP support

Hello!

First thank you very much for pulseaudio-dlna! It works great with BubbleUPNP on my Android device!
But when I try to use it with my Sonos speakers I get the following error:
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 230, in maybe_handle_message
self._handler(_args, *_kwargs)
File "/usr/local/src/pulseaudio-dlna-master/pulseaudio_dlna/pulseaudio.py", line 259, in on_device_updated
self._handle_sink_update(sink_path)
File "/usr/local/src/pulseaudio-dlna-master/pulseaudio_dlna/pulseaudio.py", line 294, in _handle_sink_update
if bridge.upnp_device.register() == 200:
File "/usr/local/src/pulseaudio-dlna-master/pulseaudio_dlna/upnp/renderer.py", line 253, in register
return UpnpMediaRenderer.register(self, self.stream_url)
File "/usr/local/src/pulseaudio-dlna-master/pulseaudio_dlna/upnp/renderer.py", line 141, in register
url = self._get_av_transport_url()
File "/usr/local/src/pulseaudio-dlna-master/pulseaudio_dlna/upnp/renderer.py", line 118, in _get_av_transport_url
return self._get_url(av_transport['control_url'])
TypeError: 'NoneType' object has no attribute 'getitem'

Technically streaming to Sonos should work as I am able to stream to my Sonos devices when using BubbleUPNP. Are there any debugging infos I could additionally send to help to get pulseaudio-dlna work with Sonos?

Thanks a lot
Alois

No service type found when start playing

When starting to stream to a sink I get an exception

  ERROR:dbus.connection:Exception in handler for D-Bus signal:
  Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/pulseaudio_dlna/upnp/renderer.py", line 113, in _get_av_transport_url
  return self._get_url(av_transport['control_url'])
  TypeError: 'NoneType' object has no attribute '__getitem__'

Looking at my server ( rygel ) it doesn't have any service with
urn:schemas-upnp-org:service:AVTransport:1 but with urn:schemas-upnp-org:service:AVTransport:2
so I tried change it and it worked.

I don't have a clue what that number means so without that knowledge I propose to change render.py accordingly:

   def _get_av_transport(self):
       for service in self.services:
            if service['service_type'].startswith(
                        'urn:schemas-upnp-org:service:AVTransport:'):
                return service

Sonos-Devices can't be found, after fix sound distored

I own two Sonos:3 and a Sonos:Amp, which run fine and can be used with other DLNA apps like BubbleUPNP. PulseAudio-DLNA 0.3.5 found those devices, but wasn't able to stream sound to them -- the players stayed quiet. Newer versions of PulseAudio-DLNA, like the current 0.4.4, don't find the boxes anymore. Currently I'm not at home, but i guess the output of "pulseaudio -debug" might be interesting. Do you need something else?

fresh install fails on headless server (ubuntu 14.04)

After a fresh install, using a vm, following the instructions, I get the following when running pulseaudio-dlna:

Traceback (most recent call last):
File "/usr/bin/pulseaudio-dlna", line 9, in
load_entry_point('pulseaudio-dlna==0.3.1', 'console_scripts', 'pulseaudio-dlna')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
entry = import(self.module_name, globals(),globals(), ['name'])
File "/usr/lib/python2.7/dist-packages/pulseaudio_dlna/main.py", line 40, in
import gobject
ImportError: No module named gobject

Google did not help, so what to do to fix this?

Thanks!

Roelof

PS: Is this a base to send a music stream to my dlna compliant receiver (as is possible with media player in Windows). So no player function on the receiver (that is exactly what I want to replace), only receiving.

Appreciate your feedback, thanks!

Add possibility for periodic polling for new UPnP devices

At the moment the application looks at the startup for UPnP devices. If it has found devices it will continue otherwise it stops. If the application runs and some of the UPnP devices are gone in the meantime the application won't recognize this.
This make it impossible to run this cool application as a daemon. Therefore it would be nice if you could add another option that enables a periodic polling for UPnP devices instead of the one time search. A second option for the polling interval would be nice as well.

Request: Signal handler

Hi,

Could you add some signal handler to pulseaudio_dlna.py?

I want this because I am using your code on cinnamon autostart and I can't send KeyboardInterrupt. Thats why if I kill process "pulse.cleanup()" & "dlna_server.server_close()" not working.

Unable to play to Libratone device

Hi! Not sure if this is a PulseAudio issue or it spplies to pulseaudio-dlna. When I attempt to play to the Libratone speaker at the office, pulseaudio-dlna throws an error but pavucontrol seems to indicate that it's playing. I hear nothing but silence though.

Output:

INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.0.65
INFO:root:found upnp_device ""
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.0.65
ERROR:root:"Libratone 083100" registering failed!
INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.0.65
ERROR:root:"Libratone 083100" playing failed!

Automatically connect to a single DLNA renderer

With the possibility to give a single renderer URL we are able to connect to a single known DLNA renderer in our network.

It would be nice to then automatically move the audio stream to this device once we had started pulseaudio-dlna.

Dbus or pulse audio not starting on Fedora

After running https://github.com/masmu/pulseaudio-dlna

Results in something like

INFO:root:You can now use your upnp devices! DEBUG:root:setting stream url for Upstairs to "http://192.168.1.65:8080/upstairs.stream" DEBUG:root:setting stream url for Kodi (Tardis) to "http://192.168.1.65:8080/koditardis.stream" DEBUG:root:setting stream url for Livingroom to "http://192.168.1.65:8080/livingroom.stream" Failure: Module initialization failed ERROR:root:PulseAudio seems not to be running or pulseaudio dbus module could not be loaded.

pacmd list-modules | grep dbus
name:

Has this issue been seen ?

Thanks

crash at discovering my device

Hi,

first, thanks for this fine extension!

I got the following error after starting the program width pulseaudio-dln --debug at discovering my devices.

http://pastebin.com/zdShHQ4x

My system: 3.18.3-031803-generic, Ubuntu 14.04.3 LTS

Does anyone have an idea how to fix this?

[feature] Support for upnp renderer type 3, 2

Hi Masmu,

Now upnp renderer:2, renderer:3 are not supported.
Only renderer:1 is supported, in fromURL method from UpnpMediaRendererFactory in renderer.py I've replaced l284 with :

if re.match(r"^urn:schemas-upnp-org:device:MediaRenderer:[1,2,3]$", device.devicetype.text) is None:

and tested with my rygel, gmrender renderers. All was fine.

Renderer of type 2, 3 are backward compatible in upnp, but it must be tested on some other renderers (I have only rygel and gmrender installed on some raspberry).

flac transcoding error

Hello !

Thank you for this work, it's very usefull (the systray support by queeup is awesome too) !

My request is about the flac encoder. When I launch the server with this options, it doesn't work.

This is what I see when the stream begin :

INFO:root:starting sending stream to "Server PreAmpli"

flac 1.3.0, Copyright (C) 2000-2009, 2011-2013 Josh Coalson & Xiph.Org Foundation
flac comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. Type `flac' for details.

(No runtime statistics possible; please wait for encoding to finish...)
INFO:root:PulseWatcher.on_new_playback_stream "/org/pulseaudio/core1/playback_stream176"
INFO:root:PulseWatcher.on_playback_stream_removed "/org/pulseaudio/core1/playback_stream176"

(The part where the encoder is launched appears just once ;) ). The stream is closed just after it is opened ...

Is there something I set wrong ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.