masmu / pulseaudio-dlna

A lightweight streaming server which brings DLNA / UPNP and Chromecast support to PulseAudio and Linux
GNU General Public License v3.0
1.25k stars 161 forks source link

ssdp_listener: excessive power usage, cannot be stopped #361

Open codethief opened 5 years ago

codethief commented 5 years ago

Hi there,

I've been using pulseaudio-dlna for quite a while and it's been working beautifully! Today, however, I was surprised to see that the ssdp_listener it spawns is using up enormous 10-11 W (on average) on my ThinkPad W510 according to powertop:

$ sudo powertop
Der Akku meldet eine Entladungsrate von 47.5 W
Die verbleibende Zeit beträgt vorraussichtlich noch 0 Stunden, 32 Minuten

Zusammenfassung: 1109,2 Wakeups/Sekunde,  0,0 GPU-Vorgänge/Sekunde, 0,0 VFS-Vorgänge/Sek. und 19,9% CPU-Auslastung

Energie ca.              Auslastung       Ereignisse/Sek.    Kategorie       Beschreibung
  19.5 W     3585 rpm                   Device         Laptop <--- Ignore this, my laptop's fan is broken
  11.2 W    122,2 ms/s     690,6        Process        ssdp_listener <--- The issue
  1.82 W      1,8 ms/s     113,3        kWork          dbs_work_handler
  1.41 W    100,0%                      Device         Display backlight
  789 mW      4,5 ms/s      49,1        Timer          tick_sched_timer
  769 mW      1,0 ms/s      47,8        Process        [irq/42-iwlwifi]
  415 mW      3,1 ms/s      25,8        Interrupt      PS/2-Touchpad/Tastatur/Maus
  404 mW      2,5 ms/s      25,1        Timer          hrtimer_wakeup
  271 mW    486,5 µs/s      16,9        Interrupt      [42] iwlwifi
  256 mW     96,4 µs/s      15,8        Process        [kworker/1:1]
  230 mW      1,4 ms/s      14,3        kWork          nouveau_fence_work_handler
  224 mW    135,8 pkts/s                Device         Netzwerkschnittstelle: wlp3s0(iwlwifi)
  201 mW      2,8 ms/s      12,4        Process        /usr/lib/firefox/firefox

So, after looking at pulseaudio-dlna --help, I ran $ pulseaudio-dlna --disable-ssdp-listener but this doesn't seem stop the ssdp_listener:

$ ps faux | grep -E 'ssdp|$'
codethief     1273  0.1  1.2 214524 48388 tty1     SN+  11:39   0:01              \_ pulseaudio-dlna
codethief     1410  0.0  0.9 288256 36636 tty1     SNl+ 11:39   0:00              |   \_ stream_server
codethief     1411  0.0  0.9 288644 37708 tty1     SNl+ 11:39   0:00              |   \_ pulse_watcher
codethief     1412  102  1.0 1158184 39948 tty1    SNl+ 11:39  20:08              |   \_ ssdp_listener

What gives?

Of course I could just kill the process but I'd obviously prefer a more graceful workaround for the power consumption issue.

I should mention, I'm on a university network right now whereas normally I just use my laptop at home or at a coffee shop and there have never seen ssdp_listener consume that much power. Could the size of the network be the cause here?