Coder Social home page Coder Social logo

Comments (4)

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

Defining a dummy stream before we start pulseaudio_dlna.py indeed leads to the expected results. We can now switch to the DLNA sink without the need of starting our output first.

This can be done e.g. by running from a script:

#! /bin/bash

PASTREAMS=$(pacmd list-sink-inputs)
if [[ $PASTREAMS == *"0 sink input(s)"* ]]; # only if there were no streams
then
    echo "Creating dummy stream"
    pacat /dev/zero &
fi
python pulseaudio_dlna.py

Killing pacat after a DLNA-sink was selected will still let us start another stream on that sink.

We could put this somewhere in the code of pulseaudio_dlna.py to

  1. establish a dummy stream on selecting a DLNA-sink before we actually switch to this sink.
  2. this only should be done if there was no other stream.
  3. the dummy stream can be terminated as soon as it was sent to parec for the DLNA sink.

I suspect the appropriate place would be in pulseaudio.py PulseWatcher but I am not so familiar with the code, or any other place it could sit. In case we do not worry about a dummy stream sitting in the background it could also be added to pulseaudio_dlna.py

from pulseaudio-dlna.

masmu avatar masmu commented on July 20, 2024

Thank you very much for your detailed report and your efforts. 😄

I am currently pretty busy, but i think i tracked it down.

Could you please test this? bug/on-stream-changes

from pulseaudio-dlna.

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

Wow, that's just brilliant!

Much better than creating a stupid dummy stream. Everything seems to work as expected now.

Thank you!!!

from pulseaudio-dlna.

masmu avatar masmu commented on July 20, 2024

Merged.

PulseAudio just informs you that a device (sink, stream) changed, but not what changed. So, its kind of tricky and therefore up to you to find out what actually changed. When i implemented the PulseWatcher i pretty was sure that on_new_playback_stream and on_playback_stream_removed would get pretty handy sometime 😄.

Thanks for being so tenacious.

And I don't think your solution was stupid at all, it was a good lead to what was really going on.

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

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.