Coder Social home page Coder Social logo

Request: Signal handler about pulseaudio-dlna HOT 10 CLOSED

masmu avatar masmu commented on July 19, 2024
Request: Signal handler

from pulseaudio-dlna.

Comments (10)

masmu avatar masmu commented on July 19, 2024

Thanks for the hint.

On which device are you using pulseaudio-dlna. I am asking because i want to add some devices to the compatibility list.

Please test this feature/signal-handler.

This was a fast implementation. If its stable i will merge it some time later.

from pulseaudio-dlna.

queeup avatar queeup commented on July 19, 2024

I am using with XBMC(Kodi) media center from Linuxmint 17.1

from pulseaudio-dlna.

queeup avatar queeup commented on July 19, 2024

It looks working. Only thing there is 2 process. You know why I guess. Killing second process gives error but not interrupting stopping process

$ ./pulseaudio_dlna.py --debug
$ pidof -x pulseaudio_dlna.py
2359 2350
$ kill -TERM `pidof -x pulseaudio_dlna.py`

debug console output: http://pastebin.com/WwJdh88W

Note: somehow pacmd load-module module-dbus-protocol not working on Linuxmint 17.1. I can add module to /etc/pulse/default.pa and restart for success. Anyways this is some other topic. I will investigate and and open another issue for that.

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

pulseaudio-dlna runs a second process for the DLNA server. so, this is actually fine.

run ps -ejH.

You get an output like the following:

 3044  3044  3044 pts/4    00:00:00           bash
19862 19862  3044 pts/4    00:00:00             pulseaudio_dlna
19929 19862  3044 pts/4    00:00:00               pulseaudio_dlna
19943 19862  3044 pts/4    00:00:00                 parec
19944 19862  3044 pts/4    00:00:00                 lame

The second one is a child process.
Does a killall pulseaudio_dlna.py do the job?

Sadly, there are differences between linux distros how to load the module. Since i am using ubuntu i can't change that. Should not be that hard to find out how to load it under linux mint.

from pulseaudio-dlna.

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

As we can kill all pulseaudio_dlna processes sending TERM from a terminal but then they will fail to clean up. This will lead to multiple sink entries in pulseaudio on next start.

from pulseaudio-dlna.

queeup avatar queeup commented on July 19, 2024

It look good on me with kill -TERM. It's cleaning sink well with signal branch. I will test it deeper tomorrow.

from pulseaudio-dlna.

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

Killing the signal-handler enhanced pulseaudio_dlna.py requires to kill both python processes in order to terminate program execution and clean-up For a better handling (from scripts) killing just a single instance would be preferable IMHO.

from pulseaudio-dlna.

masmu avatar masmu commented on July 19, 2024

Hey guys. I updated the branch and renamed the processes.
I had to use a new module for that.
Install it via apt-get install python-setproctitle.

So kill -TERM pidof -x pulseaudio_dlna`` should work fine now.

Could you please test this?

from pulseaudio-dlna.

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

Nice, when run in a terminal as python pulseaudio_dlna.py we can kill the application by PID with appropriate clean-up.

However the terminal then stalls at:

Application is shutting down.
INFO:root:remove "<PulseSink path="/org/pulseaudio/core1/sink12" name="recivaradio" entity="36">
        -- no streams --" sink ...
INFO:root:remove "<PulseSink path="/org/pulseaudio/core1/sink13" name="tvuees" entity="37">
        <PulseStream path="/org/pulseaudio/core1/playback_stream5" device="/org/pulseaudio/core1/sink13">
" sink ...
INFO:root:remove "<PulseSink path="/org/pulseaudio/core1/sink14" name="bubbleupnpgti" entity="38">
        -- no streams --" sink ...
Assuming raw pcm input file
LAME 3.99.5 64bits (http://lame.sf.net)
Using polyphase lowpass filter, transition band: 20094 Hz - 20627 Hz
Encoding <stdin> to <stdout>
Encoding as 44.1 kHz j-stereo MPEG-1 Layer III (4.4x) 320 kbps qval=3
Error writing mp3 output 
takkat@home:~/Dokumente/Downloads/Ubuntu/Pulseaudio-DLNA/pulseaudio-dlna-feature-signal-handler$ write() failed: Broken pipe

until we release the app with CTRL+C.

No issues when running from a bash script. Great job!

from pulseaudio-dlna.

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

Note that there is now a PPA to install from.

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.