Coder Social home page Coder Social logo

Comments (12)

Takkat-Nebuk avatar Takkat-Nebuk commented on July 19, 2024

This can be done without any change in the code of pulseaudio-dlna by loading default pulseaudio modules.

pactl load-module module-switch-on-connect

To make this work we will also have to disallow pulseaudio to restore a device's stream properties by editing the following line in default.pa to

load-module module-stream-restore restore_device=false

A minor glitch is the sometimes rather lengthy renderer URL we need to give, which can only easily be found out by running pulseaudio-dlna in -debug mode. Any chance to shorten that in any way (e.g. device name)?

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

Hello Takkat. Sorry for the late reply. Was a week in NY for business.

When i understand it correctly, you want a CLI option which enables you to select a single renderer from the list of the detected ones, right?

So, if you have just one renderer in your network everything works without any modification. You just have a problem when there is more than one, thats why you specifiy the renderer url yourself, besides that feature was never meant to be used that way 😄

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

@Takkat-Nebuk I made a branch (feature/device-filter) which implements a --device-filter option.

Can you check it out and report if thats suitable for you?

from pulseaudio-dlna.

Takkat-Nebuk avatar Takkat-Nebuk commented on July 19, 2024

@masmu hey thanks for coming back to this, it is a promising approach.

I can restrict discovery to only one device by saying e.g --device-filter [+bubble] or [+TVUE40ES6100] but if I say [+BubbleUPnP] or [+tvue40es6100] it will still discover and use both devices. It may be just me getting the options wrong but it appears a bit inconsistent.

Nevertheless I am quite happy with the option --renderer-urls which gives me consistent and good results.

At present I make good progress in adding support for pulseaudio-dlna to my GUI wrapper for several audio streaming solutions (stream2ip). We are now able to wait for a single renderer to become available then connect and automatically switch sinks. We can also disconnect/reconnect if this renderer was temporarily lost, all provided we had an URL of the device. At present I use the URL from the renderer URL I submit to pulseaudio-dlna --renderer-urls.

Finding this URL is not so easy however. At present I use pulseaudio-dlna in --debug mode to search for Response from upnp device which usually is followed by the renderer URL. It would be nice if we had pulseaudio-dlna running in normal non-debug mode to also print the renderer URLs in addition to the device names.

A really cool feature I would love to see would be an option --discover-only when pulseaudio-dlna only prints discovered devices and their renderer URLs but then just quits without connecting to them. Finding the URLs (or parsing them in another application) would then be much much easier (and more consistent, --debug mode certainly was not meant for that).

Finally, another feature (where I am not sure if and how this could be done easily) would be that pulseaudio-dlna removed a sink from a renderer as soon as the renderer was disconnected. At present it will still show a sink of a lost device.

Hope this was not too much for now.

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

@Takkat-Nebuk : I updated the branch and replaced the regular expression with plain text search.
So, regardless how many devices there are in your network, --device-filter="Wohnzimmer,Nexus 5" will just find those both and --device-filter="Nexus 5" just the one.

Could you explain me a little bit more what you are trying to build? 😄

from pulseaudio-dlna.

Takkat-Nebuk avatar Takkat-Nebuk commented on July 19, 2024

Well, may app "stream2ip" is a Gtk3 GUI wrapper for all kinds of audio network streaming solutions (it all started with supporting AirTunes for my AirportExpress I had). Over the years I added more and more other streaming solutions. The aim always was to just start stream2ip per a single mouse click (or even from autostart) and it will take care of everything else to switch pulseaudio to any streaming sink we had set up (e.g. RAOP device, Bluetooth device, Icecast server, pulseaudio RTP).

Now pulseaudio-dlna fits in rather nicely as it fills the gap to allow doing that for a DLNA renderer. If you are interested to can get it from https://launchpad.net/stream2ip/+download. It is all Python3 but may also run with Python2. Please don't look at the code, it's awful! It grew over the years without anybody (me) feeling like having time to put it in an appropriate shape. 😳

At present, if we run the setup routine to choose "DLNA live" we can search for a renderer with the looking glass button. This calls pulseaudio-dlna in debug mode just to get the renderer URL of a single DLNA device - then kills it again. A bit hacky, I know. That's where a --discover-only option would come in handy, also to allow choosing from a list of devices (which then would need an additional window to be made).

The main program can be set up to wait a given interval for the renderer's IP to respond to a ping, only then call pulseaudio-dlna, and if a new sink was created, switch audio output to that sink. If that IP gets lost pulseaudio-dlna will be terminated, and the previous audio sink restored.

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024
  • 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

from pulseaudio-dlna.

Takkat-Nebuk avatar Takkat-Nebuk commented on July 19, 2024

Thank you so much Massimo. We can now select from a renderer to support autoconnecting in stream2ip 1.0.8. 😃

After a successful discovery a little selection box will pop up:

dlna-live

In addition I thought it may be a good idea to also support other options for non-default sets. This can now be done either by giving in a full command set as options for "DLNA live" or by a configuration file padlna.cfg in ~/.config/stream2ip/ to always add additional options before we call pulseaudio-dlna.

from pulseaudio-dlna.

lavaed avatar lavaed commented on July 19, 2024

Hi! Pulseaudio-dlna doesn't see the device on hostapd. I have ubuntu with the adjusted point of access of hostapd! When I start pulseaudio-dlna on this ubuntu, the devices connected to hostapd aren't found! Prompt please as to correct it?

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

@lavaed Sorry, i really don't understand. Could you explain it a little bit more?

from pulseaudio-dlna.

lavaed avatar lavaed commented on July 19, 2024

Forgive for my English! I have ubuntu 14.04 server. And not a simple network configuration. I found out that the started pulseaudio-dlna on server works only with default a route. And options - host, - renderer-host don't help to find the device in a home network!

from pulseaudio-dlna.

lavaed avatar lavaed commented on July 19, 2024

Pulseaudio-dlna saw devices in a network after I added a route route add -net 239.255.255.250 netmask 255.255.255.255 wlan1!
Answer please! A sound delay at a pulseaudio-dlna broadcast of 13 seconds it is normal and whether it is possible to correct it?

from pulseaudio-dlna.

Related Issues (20)

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.