roc-toolkit icon indicating copy to clipboard operation
roc-toolkit copied to clipboard

Please make stream idle state available with roc api

Open stjangh opened this issue 3 years ago • 4 comments

Hello,

as mentionend and discussed here and here right now it is not possible for the pipewire module-roc-source to know if the roc link is active or not. Knowing the idle state would allow freeing the hardware device in use and thus power savings or accessing it with different bitrates.

The issue probably affects also the pulseaudio module-roc-sink-input.

Btw.:
The roc-recv binary seems to know about the idle state but doesn't make use of it. Loading it with
roc-recv -s rtp+rs8m::10001 -r rs8m::10002 -d alsa --sess-latency=64ms -v shows creating session and removing session messages:

08:52:00.127 [inf] roc_sndio: sox sink: opening: driver=alsa output=default
08:52:00.170 [inf] roc_sndio: sox sink: bits=32 out_rate=48000 in_rate=0 ch=2 is_file=0
08:52:00.171 [inf] roc_netio: udp receiver: opened port 0.0.0.0:10001
08:52:00.171 [inf] roc_pipeline: receiver: adding port rtp+rs8m:0.0.0.0:10001
08:52:00.171 [inf] roc_netio: udp receiver: opened port 0.0.0.0:10002
08:52:00.171 [inf] roc_pipeline: receiver: adding port rs8m:0.0.0.0:10002
08:52:51.317 [inf] roc_pipeline: receiver: creating session: src_addr=192.168.2.107:42878 dst_addr=0.0.0.0:10001
08:52:58.437 [inf] roc_pipeline: receiver: removing session

But the alsa device is always running, even if there is nothing playing: cat /proc/asound/card0/pcm0p/sub0/status

state: RUNNING
[...]

stjangh avatar May 01 '22 07:05 stjangh

Hi, thanks for report. Yes, roc internally has some information for it, although the feature is not fully finished. I'll raise the priority of this.

Related: roc-streaming/roc-pulse#22, roc-streaming/roc-pulse#4.

gavv avatar Jun 26 '22 09:06 gavv

I would like to second this as something I require in my application quite desperately, as this is currently forcing around 40w extra power consumption per unit by keeping amps active unnecessarily .

IMbackK avatar Jul 16 '23 14:07 IMbackK