roc-streaming / roc-toolkit

Real-time audio streaming over the network.
https://roc-streaming.org
Mozilla Public License 2.0
1.06k stars 213 forks source link

Add pipewire support or maybe integrate roc into pipewire. #446

Closed ranomier closed 3 years ago

ranomier commented 3 years ago

Pipewire is the new kid.

Pipewire is awesome. It is my stable daily driver now. (In my case it is stable. I'm sure there are issues)

Pipewire is still lacking the possibility to share audio via network.In my opinion pipewire and roc toolkit share some values about realtime.

Maybe roc could work together with the pipewire devs :)

Just an idea. What would you think?

gavv commented 3 years ago

Hi!

Yes, this makes sense. We'll definitely need some kind of integration with it.

Personally I didn't have a chance to look at pipewire close yet. So far I have no idea how such an integration should look like. I will look at it, eventually, but for now suggestions or pull requests are welcome :)

Shados commented 3 years ago

For what it's worth, the command-line roc- tools currently work fine with pipewire's pulseaudio compatibility/support. I've been using roc-send to stream stuff from my pipewire-using desktop to my android phone.

jave commented 3 years ago

I also had some success with a server running pulseaudio and the module-roc-sink to send to a client machine running just roc-recv and pipwire, this works well even if I have other audio sources on the client machine because the way pipewire works.

However, the server uses module-roc-sink and pulse, and that combination is slightly flaky in my case. It worked very well for a week, then the roc-sink stopped working, and I didnt figure out a way to reset it, so I launched a new instance, and then I could select that new instance in pavucontrol.

Anyway, just a datapoint.

jave commented 3 years ago

I have a server i upgraded from fc32 which defaults to pulse, to fc34, which defaults to pipewire.

Now when I try to install roc pulse modules I get:

pactl load-module module-roc-sink remote_ip=192.168.210.3 Failure: No such entity

I tried strace to see where the Failure message comes from, but so far I cant figure it out.

Any relevant debugging hints would be appreciated.

SanchayanMaity commented 3 years ago

There is an implementation in pipewire master upstream now with https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/793.

souravdas142 commented 3 years ago

@SanchayanMaity @gavv Do I need to compile roc-toolkit wtih --build-3rdparty=openfec,pulseaudio for pipewire? specially --build-3rdparty=pulseaudio ? I'm confused. This need to be cleared. I'm going to publish roc-toolkit package on https://launchpad.net/~pipewire-debian PPA that will work on all debain based distros.

SanchayanMaity commented 3 years ago

@souravdas142 build-3rdparty=pulseaudio enables roc-pulse modules, those are not required for pipewire.

souravdas142 commented 3 years ago

@SanchayanMaity Thanks a lot for your quick reply. By the way If I built with build-3rdparty=pulseaudio and split the package something like name roc-pulse-module ? with pulseaudio

/usr/lib/pulse-13.99.1/modules/module-roc-sink-input.so
/usr/lib/pulse-13.99.1/modules/module-roc-sink.so

this two files are only generated. Should i do that or it still not required or have problems if with pipewire in future ? btw, If I do that, roc-conv depends on some pulsaudio library.

ldd debian/roc/usr/bin/roc-conv | grep pulse
        libpulse.so.0 => /lib/x86_64-linux-gnu/libpulse.so.0 (0x00007fdd47700000)
        libpulsecommon-13.99.so => /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-13.99.so (0x00007fdd470a1000)

So I should not package roc-toolkit with splitting package with pulseaudio right ? Or should I?

SanchayanMaity commented 3 years ago

@souravdas142 To be honest, am not sure when it comes to packaging the rest of roc as such. What pipewire roc modules depend on is libroc. May be the roc PKGBUILD for Arch might give you an idea. What I do when building roc on Arch using that is remove lines 32-38 to not enable the pulseaudio modules. Have no idea about the rest of roc provided tools, as I only tested/needed libroc for network streaming with pipewire.

For example, this is the ldd output. You can see openfec is also required.

ldd src/modules/libpipewire-module-roc-source.so 
    linux-vdso.so.1 (0x00007fff0a1c3000)
    libpipewire-0.3.so.0 => /home/core/GitSources/pipewire/build/src/modules/../pipewire/libpipewire-0.3.so.0 (0x00007f5128f47000)
    libroc.so.0.1 => /usr/lib/libroc.so.0.1 (0x00007f5128ef3000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f5128ed2000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f5128d06000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f5128cff000)
    libuv.so.1 => /usr/lib/libuv.so.1 (0x00007f5128ccc000)
    libunwind.so.8 => /usr/lib/libunwind.so.8 (0x00007f5128cb0000)
    libopenfec.so.1 => /usr/lib/libopenfec.so.1 (0x00007f5128c71000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007f5128b2d000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f5128917000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x00007f512901d000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007f51288ef000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f51288d2000)
souravdas142 commented 3 years ago

@SanchayanMaity Thanks a lot man. I have ready two source package (for debian based distros)roc-toolkit its for PipeWire and roc-toolkit-pulse its for PulseAduio. I will be published them on Launchapd PPA, may be tomorrow.

souravdas142 commented 3 years ago

@SanchayanMaity @gavv roc-toolkit package is now available at launchpad and ready for PipeWire (without pulseaudio modules).

However the second source package roc-toolkit-pulse with pulseaudio modules is building failed at Launchapd build environment. Because the scons wanted to download it's dependencies (e.g. PulseAudio, libtool, etc) but may be because of the builder machine is not connected with internet (or need a proxy? but how? ) it leads to a fail build. The detailed issue created at https://github.com/pipewire-debian/pipewire-debian/issues/20 here. Can you please help regarding on this matter?

gavv commented 3 years ago

There is an implementation in pipewire master upstream now with https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/793.

@SanchayanMaity Awesome, thanks!

gavv commented 3 years ago

For example, this is the ldd output. You can see openfec is also required.

libroc typically depends on libuv, libopenfec (optional but recommended), libpulse (optional).

If you build libroc with --build-3rdparty, dependencies will be built as static libraries and compiled into libroc. This may be useful for openfec because AFAIK it's not packaged anywhere and because we use our own unofficial fork with various fixes.

gavv commented 3 years ago

@souravdas142 I've replied to your other questions in roc-streaming/roc-pulse#11.

gavv commented 3 years ago

@SanchayanMaity I wonder if it makes sense to create a native pipewire client for command-line tools to avoid using pulseaudio compatibility layer. What benefits can be gained by this? Does pulseaudio compat layer affects latency, for example? Also, what pipewire API is intended for this, Core API or Remote API?

SanchayanMaity commented 3 years ago

@SanchayanMaity I wonder if it makes sense to create a native pipewire client for command-line tools to avoid using pulseaudio compatibility layer. What benefits can be gained by this? Does pulseaudio compat layer affects latency, for example? Also, what pipewire API is intended for this, Core API or Remote API?

@gavv

Am not too well versed with PipeWire either. Started contributing recently. Also, haven't looked at the command line tools so far. Will try to take a look and see if I can get further along on answering those questions.

jave commented 3 years ago

There is native support in pipewire for roc audio now.

I tried it today, it worked well so far.

this is with todays pipewire git version

I would consider closing this bug as done.

ranomier commented 3 years ago

OK lets close it :) OK?

jave commented 3 years ago

Ok, I also worked with some bugfixes in pipewire for roc, they should be upstreamed soonish. With those, pipewire works very well with roc.

jave commented 3 years ago

@ranomier I guess you need to close since you opened the issue!

gavv commented 3 years ago

Thanks to everybody involved!

I've created two new issues for further work (in roc) related to pipewire:

(BTW I would be happy if someone would like to help with them).

I think this issue can be closed.

@jave

Ok, I also worked with some bugfixes in pipewire for roc, they should be upstreamed soonish.

Cool, would be great if you leave a link to MR here! (I didn't find one on pipewire gitlab, guess it's not published yet?)