Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_out_pulse - pulseaudio output (Read 12081 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: foo_out_pulse - pulseaudio output

Reply #50
Here you go, this is your patch on top of git master.

For reference, I built this on Arch as follows (after installing mingw-w64 and some libraries, configure (ie. bootstrap.sh) tells you which ones you need if they're missing):

Code: [Select]
./bootstrap.sh --host=i686-w64-mingw32 --enable-shared --disable-static --disable-waveout --disable-orc
make -j16 LDFLAGS='-shared'

cp ./src/.libs/libpulsecommon-13.99.dll ./src/.libs/libpulse-0.dll ~/desktop/pa
cp /usr/i686-w64-mingw32/bin/{libFLAC-8.dll,libgcc_s_dw2-1.dll,libintl-8.dll,libiconv-2.dll,libogg-0.dll,libsndfile-1.dll,libssp-0.dll,libvorbis-0.dll,libvorbisenc-2.dll,libwinpthread-1.dll} ~/desktop/pa/

Re: foo_out_pulse - pulseaudio output

Reply #51
Here you go, this is your patch on top of git master.

Thanks.  Would you mind reporting what output you get with this build?

Re: foo_out_pulse - pulseaudio output

Reply #52
When playing something, I just get

Code: [Select]
load() function, cookie filename: C:\users\sam\.config\pulse\cookie
About to call pa_open_cloexec()
About to call pa_lock_fd()
About to call pa_loop_read()

Re: foo_out_pulse - pulseaudio output

Reply #53
Code: [Select]
load() function, cookie filename: C:\users\dave\.config\pulse\cookie
0134:warn:ntdll:FILE_CreateFile L"\\??\\C:\\users\\dave\\.config\\pulse" not found (c0000035)
About to call pa_open_cloexec()
About to call pa_lock_fd()
About to call pa_loop_read()
Failed to read cookie file 'C:\users\dave\.config\pulse\cookie': Unknown error 10009
load() function, cookie filename: C:\users\dave\.pulse-cookie
0134:warn:ntdll:FILE_CreateFile L"\\??\\C:\\users\\dave" not found (c0000035)

So essentially the same as yours, right up to the point where pa_loop_read() fails, and it moves on to the next location.  (I assume you fixed the bug in my patch that didn't open a block for the 'else' further up.)  Anyway, I'll continue to investigate.

Re: foo_out_pulse - pulseaudio output

Reply #54
I can't make much sense of this.  One way or another, pa_open_cloexec() would be making at least one open() call.  Yet, no syscall shows up in the strace.  I can see that happening if there was a problem with the path conversion, for example.  But, surely, it would return a negative value in that case.  If wine swallowed the open() call and returned a negative value, I would get an additional message from load() in the log.  It's like wine is declining to pass on the open() call, while also reporting success.  As you can imagine, it's a challenge to search the wine bug database for a common word like "open".  I'll try to update wine sometime soon and try again.  What version are you running @sammoth?

Re: foo_out_pulse - pulseaudio output

Reply #55
I'm using wine staging 5.18 at the moment, but it was working on some previous versions and non-staging too.

edit: have you tried looking at wine's full debug log output? WINEDEBUG=+all
it's pretty verbose though...

Re: foo_out_pulse - pulseaudio output

Reply #56
edit: have you tried looking at wine's full debug log output? WINEDEBUG=+all
it's pretty verbose though...

"Pretty verbose" is understating it. :)  Yes, I had let it run for something like 30 mins and the fb2k window never appeared.  All the while it was creating a log file in the hundreds of MB.  Then I killed it.

Re: foo_out_pulse - pulseaudio output

Reply #57
I upgraded to wine-vanilla-5.18, and now it's working.  :D   I didn't think it was working at first, until I discovered that I needed to update the symlinks for both 'wine' AND 'wine-vanilla', the latter of which still pointed to 5.0.1 and was used by Dolphin by default.  D'oh!

Before the upgrade, I did actually get a WINEDEBUG=+all log.  I started by making a copy of fb2k and stripped it down to the bare minimum - simplest DUI, one playlist with one local file, no library, nothing but standard components and foo_out_pulse.  Then I could get a +all log in a minute or two.  Without getting into the dirty details, it went like this.  pa_read() called recv(), which rightly failed.  The subsequent WSAGetLastError() call returned 0x2719, which corresponds to WSAEBADF, instead of the WSAENOTSOCK error that the pulseaudio code was expecting.  That lead me to the following commit to Wine on 2020-07-27, which changed the translation of STATUS_INVALID_HANDLE from WSAEBADF to WSAENOTSOCK.
https://source.winehq.org/git/wine.git/commitdiff/587732acb7834a52a2af5bb45e59899ab8ec3f5d

The following appears in the release notes of the next version after, 5.14.

Quote
Alistair Leslie-Hughes (1):
      ws2_32: Correct returned error code for an invalid socket.

In conclusion, at last as far as wine-vanilla is concerned, a minimum of version 5.14 is required.  I don't think it made it into the 5.0.2 stable release that came a little later.  I don't see a patch for this in wine-staging immediately prior to 5.14, either.

Re: foo_out_pulse - pulseaudio output

Reply #58
Oh nice work! I will make a note of it on the readme.

Re: foo_out_pulse - pulseaudio output

Reply #59
Is anyone using this with pipewire-pulse?

Pipewire wiki says enabling the port in pipewire-pulse.conf is equivalent to loading module-native-protocol-tcp
Code: [Select]
context.modules = [
    {   name = libpipewire-module-protocol-pulse
        args = {
    # the addresses this server listens on
            server.address = [
                "unix:native"
"tcp:4713"
"tcp:127.0.0.1"
Seems to work

$ PULSE_SERVER=tcp:127.0.0.1 pactl info
Code: [Select]
Server String: tcp:127.0.0.1
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: no
Client Index: 118
Tile Size: 65472
Server Name: PulseAudio (on PipeWire 0.3.34)
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.usb-Topping_D10-00.iec958-stereo
Default Source: easyeffects_source
Cookie: 74a4:5356

Playback in foobar2000 starts fine but if I seek through a track it halts. Any ideas?

Re: foo_out_pulse - pulseaudio output

Reply #60
Problem solved. Cause turned out to be PULSE_LATENCY_MSEC environment variable in my launcher script.

There is a noticeable (0.5sec~) latency while seeking now though, I don't remember that being an issue with pulseaudio. I hope one day foobar2000 can communicate with pipewire directly.