Opened 6 weeks ago

Last modified 3 days ago

#69539 new enhancement

VLC: implement building from source again, build with X11 for older OS (?)

Reported by: barracuda156 Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.9.1
Keywords: Cc: RJVB (René Bertin)
Port: VLC

Description (last modified by ryandesign (Ryan Carsten Schmidt))

  1. Desired enhancement: restore building VLC3 from source, which was removed in [ddd6f4336c9cb206f76bc438e355a929425676b0/macports-ports]
  1. It seems that Qt can be disabled altogether for VLC, and then there is nothing to prevent it from building in principle even on Tiger. Even with no GUI it should be perfectly usable, as long as the output is sent to X window.

If the point 1 is too complicated to implement, maybe we can make vlc-cli port?

Attachments (5)

Screen Shot 2024-04-18 at 01.43.53.png (47.8 KB) - added by RJVB (René Bertin) 10 days ago.
My audio devices
Screen Shot 2024-04-18 at 01.47.18.png (28.8 KB) - added by RJVB (René Bertin) 10 days ago.
Sound playing
Portfile (10.1 KB) - added by barracuda156 9 days ago.
FWIW, this is the portfile for PulseAudio I have now (I dropped PowerPC patch, since it is not relevant for you, AFAIU)
patch-meson.build.diff (1.8 KB) - added by barracuda156 9 days ago.
And a patch to enable CoreAudio (dylib part is redundant, ignore it)
default.pa (4.5 KB) - added by RJVB (René Bertin) 3 days ago.
The default.pa file I promised.

Download all attachments as: .zip

Change History (53)

comment:1 Changed 6 weeks ago by RJVB (René Bertin)

You can try, but you'll probably run into the reasons why I got fed up with building from source in a "MacPorts condoned fashion".

comment:2 Changed 6 weeks ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)

comment:3 in reply to:  1 Changed 6 weeks ago by barracuda156

Replying to RJVB:

You can try, but you'll probably run into the reasons why I got fed up with building from source in a "MacPorts condoned fashion".

I have VLC2 building now on PowerPC, but I did not try VLC3 in any form.

comment:4 Changed 6 weeks ago by barracuda156

Apparently support for Qt4 existed early in 3.x branch: https://github.com/videolan/vlc/commit/1c221a77d92935866e897254c07e1d12a4b95ae0

Though it could be a clean-up too. But if it still worked at the time of 3.0.0-1, it is likely restorable into a bit later version.

comment:5 in reply to:  1 ; Changed 6 weeks ago by barracuda156

Replying to RJVB:

You can try, but you'll probably run into the reasons why I got fed up with building from source in a "MacPorts condoned fashion".

By the way, are you okay if I modify VLC2 port substantially? Or should I keep changes to the minimum?

It is broken now, and if no one intends to use it for current macOS versions, I rather rewrite the thing to make it easily maintainable for systems without Qt5. Essentially, drop the stuff that does not work, use Qt4 and X11, remove libvlc2 subport etc.

Alternatively, I can make VLC2-X11, for example, or however we call it, to implement support for older OS.

(This only applies to VLC2; VLC3, if restored, should target new macOS.)

comment:6 in reply to:  5 Changed 6 weeks ago by RJVB (René Bertin)

I cannot recall having tried Qt4 anytime since I started working on the port but the Qt5 interface never worked properly because it does things that Qt5 doesn't support on Mac. If memory serves me well, creating timers and/or an event loop that is not on the main thread. That's a design quirk that will undoubtedly be very hard to change.

Replying to barracuda156:

By the way, are you okay if I modify VLC2 port substantially? Or should I keep changes to the minimum?

If you take maintainership you can do what you like, and I have my own version in my MacStrop tree anyway. I'd appreciate if you kept the libVLC subport just in case anyone picks up/creates a port that (would) depend on it. If you can figure out a way to build only that part you could even let the main port depend on it (rather than conflict with it like now) without having to rebuild everything.

It is broken now

I haven't rebuilt it in a while but I'm guessing that means broken either on (much) newer OS versions than my 10.9 or on older ones?

(This only applies to VLC2; VLC3, if restored, should target new macOS.)

Reminder: upstream didn't like the idea of having a "non-official" build in MacPorts back when the subject came up in a ticket I created.

comment:7 Changed 12 days ago by barracuda156

Actually did not take much, I have VLC 3.0.20 built on PowerPC.

Need to figure out how to set Pulse Audio correctly, otherwise it spits out vlcpulse audio output error: PulseAudio server connection failure: Connection refused, but video works. Given that, audio should be fixable.

Obviously, with X11 backend – I won't bother trying to restore Qt4 GUI, it is not really essential. Once I get audio working and sort out patches, I can make VLC-x11 port.

comment:8 Changed 12 days ago by RJVB (René Bertin)

FWIW, back when I did my 64bit wxGTk build of Audacity it happily used CoreAudio (through PortAudio). PortAudio is a dependency of my Linux port for VLC3 so you should be able to use it on Mac too, and thus (hopefully) get access to direct audio playback rather than through PulseAudio.

comment:9 in reply to:  8 Changed 12 days ago by barracuda156

Replying to RJVB:

FWIW, back when I did my 64bit wxGTk build of Audacity it happily used CoreAudio (through PortAudio). PortAudio is a dependency of my Linux port for VLC3 so you should be able to use it on Mac too, and thus (hopefully) get access to direct audio playback rather than through PulseAudio.

Hmm, how do you make it work with it? Configure does not seem to have such an option anymore.

And CoreAudio, I think, upstream has deliberately broken. Won’t be hard to keep stuff working, given it works fine with other software, but instead they do this: https://github.com/videolan/vlc/commit/ad17fde5c6753e5ed1b13087db62e3b92561227e

comment:10 Changed 12 days ago by RJVB (René Bertin)

You're right, apparently we found a dangling/obsolete dependency in my port. Bummer.

Upstream don't support legacy OS X versions, so it makes sense that they remove unnecessary code. Shouldn't be hard to reintroduce though, from the looks of it.

If not ... how about JACK? If memory serves me well (rare these days ;)) my PPC Macs were the only systems where I used that stuff with some form of success. PulseAudio can work, but it can also introduce noticeable lag. (On Linux it typically runs under some form of realtime control.)

comment:11 Changed 12 days ago by RJVB (René Bertin)

Or ... have you looked at all at PipeWire? It's touted as the replacement/alternative to PA solving all (kinds of) woes, and there's this: https://www.remlab.net/vlc-plugin-pipewire/

comment:12 in reply to:  10 Changed 12 days ago by barracuda156

Replying to RJVB:

You're right, apparently we found a dangling/obsolete dependency in my port. Bummer.

Upstream don't support legacy OS X versions, so it makes sense that they remove unnecessary code. Shouldn't be hard to reintroduce though, from the looks of it.

If not ... how about JACK? If memory serves me well (rare these days ;)) my PPC Macs were the only systems where I used that stuff with some form of success. PulseAudio can work, but it can also introduce noticeable lag. (On Linux it typically runs under some form of realtime control.)

Jack is/was broken on 32-bit archs due to a bug in upstream GCC, which led to ICE during compilation. It might have been fixed in the latest snapshot of GCC in fact. I will try building it (since I have just yesterday built my gcc-powerpc from the new snapshot of GCC 13).

I have seen that error with pulseaudio on Sonoma by the way, with a different port. Do you know how to make in work on macOS/in Macports? It could be I just do not add needed environment settings or smth alike.

comment:13 in reply to:  11 Changed 12 days ago by barracuda156

Replying to RJVB:

Or ... have you looked at all at PipeWire? It's touted as the replacement/alternative to PA solving all (kinds of) woes, and there's this: https://www.remlab.net/vlc-plugin-pipewire/

Isn't pipewire Linux-only? I thought it relied on some Linux system libs which do not exist in macOS. Like alsa. (This is from memory, I can be wrong.)

  1. S. So silly they dropped portaudio, which is the most reliable of all these.

comment:14 in reply to:  10 ; Changed 11 days ago by barracuda156

Replying to RJVB:

If not ... how about JACK? If memory serves me well (rare these days ;)) my PPC Macs were the only systems where I used that stuff with some form of success. PulseAudio can work, but it can also introduce noticeable lag. (On Linux it typically runs under some form of realtime control.)

Well, no luck:

during GIMPLE pass: eh
In file included from ../macosx/coreaudio/JackCoreAudioDriver.mm:29:
../common/JackLockedEngine.h: In member function 'int Jack::JackLockedEngine::PortRegister(int, const char*, const char*, unsigned int, unsigned int, jack_port_id_t*)':
../common/JackLockedEngine.h:196:13: internal compiler error: in objc_eh_runtime_type, at objc/objc-next-runtime-abi-01.cc:2795
  196 |         int PortRegister(int refnum, const char* name, const char *type, unsigned int flags, unsigned int buffer_size, jack_port_id_t* port)
      |             ^~~~~~~~~~~~
Please submit a full bug report, with preprocessed source (by using -freport-bug).

And yes, this one is not reported as fixed: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61759

comment:15 in reply to:  14 Changed 11 days ago by RJVB (René Bertin)

Replying to barracuda156:

I have seen that error with pulseaudio on Sonoma by the way, with a different port. Do you know how to make in work on macOS/in Macports? It could be I just do not add needed environment settings or smth alike.

I just remember that it's tricky enough that at some point I created a hacked version of the port that renames the binary to prevent it from getting auto-started (and for the rest just serve to fulfill dependencies, but as usual, if I did make any notes about it they've since been removed).

Replying to barracuda156:

Isn't pipewire Linux-only? I thought it relied on some Linux system libs which do not exist in macOS. Like alsa. (This is from memory, I can be wrong.)

I didn't have it down as Linux-specific though their homepage does say "for Linux"; the build system also seems to support (some) *BSD versions. Those *might* have ALSA, though that library is not a required dependency though. There are too many dependencies and the install instructions mute about that, so I can't easily say what PipeWire will fall back on in case ALSA is missing. I wonder if no one ever wrote a bridge from ALSA to CoreAudio?

(And VLC dropped PortAudio because it was buggy and unreliable. Really not illogical when you have a native implementation, esp. since older PA versions couldn't really copy with dis/appearing sound devices without restarting the application.) IMHO the best solution would be to get the existing VLC CoreAudio backend to build. That's probably mostly a 1-time effort, and hopefully almost exclusively a question of reintroducing code that was stripped. CoreAudio hasn't evolved much after all.

Replying to barracuda156:

Replying to RJVB: Well, no luck:

during GIMPLE pass: eh
In file included from ../macosx/coreaudio/JackCoreAudioDriver.mm:29:

I recently built a couple of projects using GCC 12 where I ended up setting OBJCXX to (a recent enough) clang. For other reasons (@autorelease and family) but it may be your solution too. If that works here you can let the Portfile pick the most recent known-compatible clang version the user already has installed or else pull in a version of your choice. (I do that with Python build dependencies nowadays.)

Last edited 11 days ago by RJVB (René Bertin) (previous) (diff)

comment:16 Changed 10 days ago by barracuda156

With almost the same patches (I had to drop a patch for freetype, otherwise it did not build) on Sonoma I got a nearly identical result: video works, audio is broken. So at least it is not specific to powerpc. Either some patch is wrong, or pulseaudio is broken, or VLC is broken without GUI. Hopefully the first :)

I tired playing some FLAC on Sonoma:

~ % vlc file:///Users/svacchanda/Downloads/\(G\)I-DLE\ -\ I\ burn\ \(2021.01.11\)\ \[FLAC_24bits_96kHz\]\ \{NetEase\ Music\}/06.\ DAHLIA.flac  
VLC media player 3.0.20 Vetinari (revision 3.0.20-0-g6f0d0ab126b)
W: [] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
[000000012d604c10] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Remote control interface initialized. Type `help' for help.
status change: ( audio volume: 256 )

And have no audio output at all.

comment:17 Changed 10 days ago by barracuda156

On PowerPC pulseaudio just segfaults on start, so no surprise it failed with VLC. Should be fixable. Sonoma still makes me wonder though.

Segfault on ppc fixed, and I have found something very funny which perhaps explains why it does not work: the port installs dylibs, but its binaries are looking for .so objects:

36-5% pulseaudio
W: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
E: [(null)] ltdl-bind-now.c: Failed to open module module-device-restore.so: dlopen(module-device-restore.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-stream-restore.so: dlopen(module-stream-restore.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-card-restore.so: dlopen(module-card-restore.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-augment-properties.so: dlopen(module-augment-properties.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-switch-on-port-available.so: dlopen(module-switch-on-port-available.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-detect.so: dlopen(module-detect.so, 2): image not found
W: [(null)] module-detect.c: failed to detect any sound hardware.
E: [(null)] module.c: Failed to load module "module-detect" (argument: ""): initialization failed.
E: [(null)] ltdl-bind-now.c: Failed to open module module-native-protocol-unix.so: dlopen(module-native-protocol-unix.so, 2): image not found
W: [(null)] authkey.c: Failed to open cookie file '/Users/svacchanda/.config/pulse/cookie': No such file or directory
W: [(null)] authkey.c: Failed to load authentication key '/Users/svacchanda/.config/pulse/cookie': No such file or directory
W: [(null)] authkey.c: Failed to open cookie file '/Users/svacchanda/.pulse-cookie': No such file or directory
W: [(null)] authkey.c: Failed to load authentication key '/Users/svacchanda/.pulse-cookie': No such file or directory
E: [(null)] ltdl-bind-now.c: Failed to open module module-default-device-restore.so: dlopen(module-default-device-restore.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-always-sink.so: dlopen(module-always-sink.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-null-sink.so: dlopen(module-null-sink.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-intended-roles.so: dlopen(module-intended-roles.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-suspend-on-idle.so: dlopen(module-suspend-on-idle.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-position-event-sounds.so: dlopen(module-position-event-sounds.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-role-cork.so: dlopen(module-role-cork.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-filter-heuristics.so: dlopen(module-filter-heuristics.so, 2): image not found
E: [(null)] ltdl-bind-now.c: Failed to open module module-filter-apply.so: dlopen(module-filter-apply.so, 2): image not found
W: [(null)] cli-command.c: stat('/opt/local/etc/pulse/default.pa.d'): No such file or directory

I guess no one used it so far? )

Lumme sort this madness out.

Last edited 10 days ago by barracuda156 (previous) (diff)

comment:18 Changed 10 days ago by barracuda156

And yeah, same mess on Sonoma with dylibs:

svacchanda@43-123 ~ % pulseaudio
W: [] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] ltdl-bind-now.c: Failed to open module module-device-restore.so: dlopen(module-device-restore.so, 0x0002): tried: 'module-device-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-device-restore.so' (no such file), '/opt/local/lib/pulseaudio/module-device-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-device-restore.so' (no such file), '/opt/local/lib/pulseaudio/module-device-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-device-restore.so' (no such file), '/usr/lib/module-device-restore.so' (no such file, not in dyld cache), 'module-device-restore.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-stream-restore.so: dlopen(module-stream-restore.so, 0x0002): tried: 'module-stream-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-stream-restore.so' (no such file), '/opt/local/lib/pulseaudio/module-stream-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-stream-restore.so' (no such file), '/opt/local/lib/pulseaudio/module-stream-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-stream-restore.so' (no such file), '/usr/lib/module-stream-restore.so' (no such file, not in dyld cache), 'module-stream-restore.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-card-restore.so: dlopen(module-card-restore.so, 0x0002): tried: 'module-card-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-card-restore.so' (no such file), '/opt/local/lib/pulseaudio/module-card-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-card-restore.so' (no such file), '/opt/local/lib/pulseaudio/module-card-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-card-restore.so' (no such file), '/usr/lib/module-card-restore.so' (no such file, not in dyld cache), 'module-card-restore.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-augment-properties.so: dlopen(module-augment-properties.so, 0x0002): tried: 'module-augment-properties.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-augment-properties.so' (no such file), '/opt/local/lib/pulseaudio/module-augment-properties.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-augment-properties.so' (no such file), '/opt/local/lib/pulseaudio/module-augment-properties.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-augment-properties.so' (no such file), '/usr/lib/module-augment-properties.so' (no such file, not in dyld cache), 'module-augment-properties.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-switch-on-port-available.so: dlopen(module-switch-on-port-available.so, 0x0002): tried: 'module-switch-on-port-available.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-switch-on-port-available.so' (no such file), '/opt/local/lib/pulseaudio/module-switch-on-port-available.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-switch-on-port-available.so' (no such file), '/opt/local/lib/pulseaudio/module-switch-on-port-available.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-switch-on-port-available.so' (no such file), '/usr/lib/module-switch-on-port-available.so' (no such file, not in dyld cache), 'module-switch-on-port-available.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-detect.so: dlopen(module-detect.so, 0x0002): tried: 'module-detect.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-detect.so' (no such file), '/opt/local/lib/pulseaudio/module-detect.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-detect.so' (no such file), '/opt/local/lib/pulseaudio/module-detect.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-detect.so' (no such file), '/usr/lib/module-detect.so' (no such file, not in dyld cache), 'module-detect.so' (no such file)
W: [] module-detect.c: failed to detect any sound hardware.
E: [] module.c: Failed to load module "module-detect" (argument: ""): initialization failed.
E: [] ltdl-bind-now.c: Failed to open module module-native-protocol-unix.so: dlopen(module-native-protocol-unix.so, 0x0002): tried: 'module-native-protocol-unix.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-native-protocol-unix.so' (no such file), '/opt/local/lib/pulseaudio/module-native-protocol-unix.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-native-protocol-unix.so' (no such file), '/opt/local/lib/pulseaudio/module-native-protocol-unix.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-native-protocol-unix.so' (no such file), '/usr/lib/module-native-protocol-unix.so' (no such file, not in dyld cache), 'module-native-protocol-unix.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-default-device-restore.so: dlopen(module-default-device-restore.so, 0x0002): tried: 'module-default-device-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-default-device-restore.so' (no such file), '/opt/local/lib/pulseaudio/module-default-device-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-default-device-restore.so' (no such file), '/opt/local/lib/pulseaudio/module-default-device-restore.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-default-device-restore.so' (no such file), '/usr/lib/module-default-device-restore.so' (no such file, not in dyld cache), 'module-default-device-restore.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-always-sink.so: dlopen(module-always-sink.so, 0x0002): tried: 'module-always-sink.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-always-sink.so' (no such file), '/opt/local/lib/pulseaudio/module-always-sink.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-always-sink.so' (no such file), '/opt/local/lib/pulseaudio/module-always-sink.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-always-sink.so' (no such file), '/usr/lib/module-always-sink.so' (no such file, not in dyld cache), 'module-always-sink.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-null-sink.so: dlopen(module-null-sink.so, 0x0002): tried: 'module-null-sink.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-null-sink.so' (no such file), '/opt/local/lib/pulseaudio/module-null-sink.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-null-sink.so' (no such file), '/opt/local/lib/pulseaudio/module-null-sink.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-null-sink.so' (no such file), '/usr/lib/module-null-sink.so' (no such file, not in dyld cache), 'module-null-sink.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-intended-roles.so: dlopen(module-intended-roles.so, 0x0002): tried: 'module-intended-roles.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-intended-roles.so' (no such file), '/opt/local/lib/pulseaudio/module-intended-roles.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-intended-roles.so' (no such file), '/opt/local/lib/pulseaudio/module-intended-roles.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-intended-roles.so' (no such file), '/usr/lib/module-intended-roles.so' (no such file, not in dyld cache), 'module-intended-roles.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-suspend-on-idle.so: dlopen(module-suspend-on-idle.so, 0x0002): tried: 'module-suspend-on-idle.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-suspend-on-idle.so' (no such file), '/opt/local/lib/pulseaudio/module-suspend-on-idle.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-suspend-on-idle.so' (no such file), '/opt/local/lib/pulseaudio/module-suspend-on-idle.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-suspend-on-idle.so' (no such file), '/usr/lib/module-suspend-on-idle.so' (no such file, not in dyld cache), 'module-suspend-on-idle.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-position-event-sounds.so: dlopen(module-position-event-sounds.so, 0x0002): tried: 'module-position-event-sounds.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-position-event-sounds.so' (no such file), '/opt/local/lib/pulseaudio/module-position-event-sounds.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-position-event-sounds.so' (no such file), '/opt/local/lib/pulseaudio/module-position-event-sounds.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-position-event-sounds.so' (no such file), '/usr/lib/module-position-event-sounds.so' (no such file, not in dyld cache), 'module-position-event-sounds.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-role-cork.so: dlopen(module-role-cork.so, 0x0002): tried: 'module-role-cork.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-role-cork.so' (no such file), '/opt/local/lib/pulseaudio/module-role-cork.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-role-cork.so' (no such file), '/opt/local/lib/pulseaudio/module-role-cork.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-role-cork.so' (no such file), '/usr/lib/module-role-cork.so' (no such file, not in dyld cache), 'module-role-cork.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-filter-heuristics.so: dlopen(module-filter-heuristics.so, 0x0002): tried: 'module-filter-heuristics.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-filter-heuristics.so' (no such file), '/opt/local/lib/pulseaudio/module-filter-heuristics.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-filter-heuristics.so' (no such file), '/opt/local/lib/pulseaudio/module-filter-heuristics.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-filter-heuristics.so' (no such file), '/usr/lib/module-filter-heuristics.so' (no such file, not in dyld cache), 'module-filter-heuristics.so' (no such file)
E: [] ltdl-bind-now.c: Failed to open module module-filter-apply.so: dlopen(module-filter-apply.so, 0x0002): tried: 'module-filter-apply.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OSmodule-filter-apply.so' (no such file), '/opt/local/lib/pulseaudio/module-filter-apply.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-filter-apply.so' (no such file), '/opt/local/lib/pulseaudio/module-filter-apply.so' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/pulseaudio/module-filter-apply.so' (no such file), '/usr/lib/module-filter-apply.so' (no such file, not in dyld cache), 'module-filter-apply.so' (no such file)
W: [] cli-command.c: stat('/opt/local/etc/pulse/default.pa.d'): No such file or directory

comment:19 Changed 10 days ago by RJVB (René Bertin)

That looks like a not uncommon build system bug where modules/plugins are built as shared libraries (which they are... more or less) but the build system thinks that means they need to have a .dylib extension. There are several ways to fix that, but beware that some projects actually do use modules as shared libraries, usually for unit-testing. And that won't work when you build them as modules because Darwin does generate slightly different file types for that. The easiest solution would be to install symlinks or rename the files in the post-destroot.

I honestly can't remember if I ever ran into this issue on Mac, but I do know that pulseaudio worked (for some people) at some time.

You can use paplay from port:pulseaudio itself for basic testing, and port:pavucontrol for more advanced tinkering. That port was updated quite recently so someone must have tested pulseaudio...

comment:20 in reply to:  19 ; Changed 10 days ago by barracuda156

Replying to RJVB:

That looks like a not uncommon build system bug where modules/plugins are built as shared libraries (which they are... more or less) but the build system thinks that means they need to have a .dylib extension. There are several ways to fix that, but beware that some projects actually do use modules as shared libraries, usually for unit-testing. And that won't work when you build them as modules because Darwin does generate slightly different file types for that. The easiest solution would be to install symlinks or rename the files in the post-destroot.

Yeah, I can try that. Fixing the source turned out not to be trivial. Thanks.

I honestly can't remember if I ever ran into this issue on Mac, but I do know that pulseaudio worked (for some people) at some time.

Perhaps they have broken it when switched to Meson?

Before I forgot, anyway: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/3808

comment:21 in reply to:  20 Changed 10 days ago by barracuda156

Replying to RJVB:

Okay, symlinking fixed looking for modules, but I still get no sound. The output is like this:

36-5% pulseaudio
W: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
W: [(null)] module-detect.c: failed to detect any sound hardware.
E: [(null)] module.c: Failed to load module "module-detect" (argument: ""): initialization failed.

And trying playback via VLC-x11:

36-5% vlc file:///Users/svacchanda/Dev/jennie_solo_test.mp4 
VLC media player 3.0.20 Vetinari (revision 3.0.20-0-g6f0d0ab126b)
W: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
[02802330] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Remote control interface initialized. Type `help' for help.
status change: ( audio volume: 256 )
[13061ea0] xcb_x11 vout display error: shared memory allocation error: Cannot allocate memory
status change: ( audio volume: 256 )
[13061ea0] xcb_x11 vout display error: shared memory allocation error: Cannot allocate memory
[13061ea0] xcb_x11 vout display error: shared memory allocation error: Cannot allocate memory
status change: ( audio volume: 256 )

(xcb errors notwithstanding, video works fine, but still no sound.)

UPD. Verbose run output:

36-5% pulseaudio -v --daemonize=no
W: [(null)] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
I: [(null)] core-util.c: Failed to acquire high-priority scheduling: Operation not supported
I: [(null)] main.c: This is PulseAudio 17.0
I: [(null)] main.c: Page size is 4096 bytes
I: [(null)] main.c: Machine ID is ee9b77dff35e0b2f3ea56e75652910b1.
I: [(null)] main.c: Using runtime directory /Users/svacchanda/.config/pulse/ee9b77dff35e0b2f3ea56e75652910b1-runtime.
I: [(null)] main.c: Using state directory /Users/svacchanda/.config/pulse.
I: [(null)] main.c: Using modules directory /opt/local/lib/pulseaudio/modules.
I: [(null)] main.c: Running in system mode: no
I: [(null)] main.c: System supports high resolution timers
I: [(null)] database.c: Successfully opened 'device-volumes' database file '/Users/svacchanda/.config/pulse/ee9b77dff35e0b2f3ea56e75652910b1-device-volumes.gdbm'.
I: [(null)] module.c: Loaded "module-device-restore" (index: #0; argument: "").
I: [(null)] database.c: Successfully opened 'stream-volumes' database file '/Users/svacchanda/.config/pulse/ee9b77dff35e0b2f3ea56e75652910b1-stream-volumes.gdbm'.
I: [(null)] module.c: Loaded "module-stream-restore" (index: #1; argument: "").
I: [(null)] database.c: Successfully opened 'card-database' database file '/Users/svacchanda/.config/pulse/ee9b77dff35e0b2f3ea56e75652910b1-card-database.gdbm'.
I: [(null)] module.c: Loaded "module-card-restore" (index: #2; argument: "").
I: [(null)] module.c: Loaded "module-augment-properties" (index: #3; argument: "").
I: [(null)] module.c: Loaded "module-switch-on-port-available" (index: #4; argument: "").
W: [(null)] module-detect.c: failed to detect any sound hardware.
E: [(null)] module.c: Failed to load module "module-detect" (argument: ""): initialization failed.
I: [(null)] module.c: Loaded "module-native-protocol-unix" (index: #6; argument: "").
I: [(null)] module-default-device-restore.c: No previous default sink setting, ignoring.
I: [(null)] module-default-device-restore.c: No previous default source setting, ignoring.
I: [(null)] module.c: Loaded "module-default-device-restore" (index: #7; argument: "").
I: [(null)] sink.c: Created sink 0 "auto_null" with sample spec s16be 2ch 44100Hz and channel map front-left,front-right
I: [(null)] sink.c:     device.description = "Dummy Output"
I: [(null)] sink.c:     device.class = "abstract"
I: [(null)] sink.c:     device.icon_name = "audio-card"
I: [(null)] source.c: Created source 0 "auto_null.monitor" with sample spec s16be 2ch 44100Hz and channel map front-left,front-right
I: [(null)] source.c:     device.description = "Monitor of Dummy Output"
I: [(null)] source.c:     device.class = "monitor"
I: [(null)] source.c:     device.icon_name = "audio-input-microphone"
I: [null-sink] util.c: Successfully acquired real-time thread priority.
I: [(null)] core.c: default_source: (unset) -> auto_null.monitor
I: [(null)] core.c: default_sink: (unset) -> auto_null
I: [(null)] module.c: Loaded "module-null-sink" (index: #9; argument: "sink_name=auto_null sink_properties='device.description="Dummy Output"'").
I: [(null)] module.c: Loaded "module-always-sink" (index: #8; argument: "").
I: [(null)] module.c: Loaded "module-intended-roles" (index: #10; argument: "").
I: [(null)] module.c: Loaded "module-suspend-on-idle" (index: #11; argument: "").
I: [(null)] module.c: Loaded "module-position-event-sounds" (index: #12; argument: "").
I: [(null)] module.c: Loaded "module-role-cork" (index: #13; argument: "").
I: [(null)] module.c: Loaded "module-filter-heuristics" (index: #14; argument: "").
I: [(null)] module.c: Loaded "module-filter-apply" (index: #15; argument: "").
W: [(null)] cli-command.c: stat('/opt/local/etc/pulse/default.pa.d'): No such file or directory
I: [(null)] main.c: Daemon startup complete.
I: [(null)] module-suspend-on-idle.c: Sink auto_null idle for too long, suspending ...
I: [(null)] core.c: We are idle, quitting...
I: [(null)] main.c: Daemon shutdown initiated.
I: [(null)] module.c: Unloading "module-filter-apply" (index: #15).
I: [(null)] module.c: Unloaded "module-filter-apply" (index: #15).
I: [(null)] module.c: Unloading "module-filter-heuristics" (index: #14).
I: [(null)] module.c: Unloaded "module-filter-heuristics" (index: #14).
I: [(null)] module.c: Unloading "module-role-cork" (index: #13).
I: [(null)] module.c: Unloaded "module-role-cork" (index: #13).
I: [(null)] module.c: Unloading "module-position-event-sounds" (index: #12).
I: [(null)] module.c: Unloaded "module-position-event-sounds" (index: #12).
I: [(null)] module.c: Unloading "module-suspend-on-idle" (index: #11).
I: [(null)] module.c: Unloaded "module-suspend-on-idle" (index: #11).
I: [(null)] module.c: Unloading "module-intended-roles" (index: #10).
I: [(null)] module.c: Unloaded "module-intended-roles" (index: #10).
I: [(null)] module.c: Unloading "module-null-sink" (index: #9).
I: [(null)] core.c: default_sink: auto_null -> (unset)
I: [(null)] core.c: default_source: auto_null.monitor -> (unset)
I: [(null)] sink.c: Freeing sink 0 "auto_null"
I: [(null)] source.c: Freeing source 0 "auto_null.monitor"
I: [(null)] module.c: Unloaded "module-null-sink" (index: #9).
I: [(null)] module.c: Unloading "module-always-sink" (index: #8).
I: [(null)] module.c: Unloaded "module-always-sink" (index: #8).
I: [(null)] module.c: Unloading "module-default-device-restore" (index: #7).
I: [(null)] module.c: Unloaded "module-default-device-restore" (index: #7).
I: [(null)] module.c: Unloading "module-native-protocol-unix" (index: #6).
I: [(null)] module.c: Unloaded "module-native-protocol-unix" (index: #6).
I: [(null)] module.c: Unloading "module-switch-on-port-available" (index: #4).
I: [(null)] module.c: Unloaded "module-switch-on-port-available" (index: #4).
I: [(null)] module.c: Unloading "module-augment-properties" (index: #3).
I: [(null)] module.c: Unloaded "module-augment-properties" (index: #3).
I: [(null)] module.c: Unloading "module-card-restore" (index: #2).
I: [(null)] module.c: Unloaded "module-card-restore" (index: #2).
I: [(null)] module.c: Unloading "module-stream-restore" (index: #1).
I: [(null)] module.c: Unloaded "module-stream-restore" (index: #1).
I: [(null)] module.c: Unloading "module-device-restore" (index: #0).
I: [(null)] module.c: Unloaded "module-device-restore" (index: #0).
I: [(null)] main.c: Daemon terminated.
Last edited 10 days ago by barracuda156 (previous) (diff)

comment:22 Changed 10 days ago by RJVB (René Bertin)

The X11 shared memory errors are common and frequent, due to the fact that shared memory limits are quite low by default on Mac. I have started getting them after a GTk3 update, leading to apps being aborted until I wrote an X11 error handler that ignores certain errors. I figured out how to avoid the allocation failure by increasing the right limits but then got 2 KPs in a row while testing an update to webkit2-gtk and decided I could live with the errors that are mostly without consequence. (That might be different for video playback).

Obvious/stupid question: did you verify if PA needs to load a dedicated module for supporting CoreAudio? I'm on my Linux system ATM, and see 3 modules for ALSA, and 2 for OSS:

  /opt/local/lib/pulseaudio/modules/libalsa-util.so
  /opt/local/lib/pulseaudio/modules/module-alsa-card.so
  /opt/local/lib/pulseaudio/modules/module-alsa-sink.so
  /opt/local/lib/pulseaudio/modules/module-alsa-source.so
  /opt/local/lib/pulseaudio/modules/liboss-util.so
  /opt/local/lib/pulseaudio/modules/module-oss.so

comment:23 in reply to:  22 ; Changed 10 days ago by barracuda156

Replying to RJVB:

While Brew tries to patch CoreAudio back in: https://github.com/Homebrew/homebrew-core/blob/e6393482b5900eb856691c2dbee0013dfdb43d55/Formula/p/pulseaudio.rb And I tried to do the same, I suspect it is either not supported or needs some specific efforts to make it work. I will look into that.

pavucontrol only sees dummy output too by the way. And OSS does not build, failing at configure itself.

comment:24 Changed 10 days ago by barracuda156

Oh, okay, I made it recognized, but it is broken, I get hiss but not proper audio. Anyway, at least it is clear now what is broken.

comment:25 in reply to:  23 ; Changed 10 days ago by RJVB (René Bertin)

Replying to barracuda156:

While Brew tries to patch CoreAudio back in: https://github.com/Homebrew/homebrew-core/blob/e6393482b5900eb856691c2dbee0013dfdb43d55/Formula/p/pulseaudio.rb And I tried to do the same, I suspect it is either not supported or needs some specific efforts to make it work. I will look into that.

Wait, there's no more CoreAudio support in PulseAudio? From what I see in the HB recipe they only make CoreAudio the built-in default.

pavucontrol only sees dummy output too by the way.

Logical, pavucontrol sees what pulseaudio provides...

And OSS does not build, failing at configure itself.

There's no port for that, or is there? I'm not aware whether it works on Mac. I know I mentioned it but that was just to show that PulseAudio has modules for the different sound backends. However, getting hiss is a first step to getting something a bit more meaningful.

comment:26 in reply to:  25 ; Changed 10 days ago by barracuda156

Replying to RJVB:

Replying to barracuda156:

While Brew tries to patch CoreAudio back in: https://github.com/Homebrew/homebrew-core/blob/e6393482b5900eb856691c2dbee0013dfdb43d55/Formula/p/pulseaudio.rb And I tried to do the same, I suspect it is either not supported or needs some specific efforts to make it work. I will look into that.

Wait, there's no more CoreAudio support in PulseAudio? From what I see in the HB recipe they only make CoreAudio the built-in default.

Looks like it was turned off: https://github.com/pulseaudio/pulseaudio/commit/2eb8ec93a2ad79cffe3371867e1a8951e65fed82

Though I guess at least in 2015 it worked for you? https://lists.apple.com/archives/coreaudio-api/2015/Feb/msg00001.html

I am afraid some rather archaic code needs to be dug out to make it work on older systems: https://pulseaudio-discuss.freedesktop.narkive.com/0h3Q2vci/patch-modules-coreaudio-replace-deprecated-functions I will check what is going on with Sonoma now.

  1. S. By the way, how do I check pulseaudio on its own, without VLC? Who know how messed is VLC code, it may not be PulseAudio bug after all.

comment:27 Changed 10 days ago by barracuda156

On Sonoma it just does not work :)

Also in Tsunami editor (where PortAudio works):

svacchanda@43-123 ~ % tsunami

----------------------------- Error! -----------------------------
kaba/asm: unsupported CPU instruction set
------------------------------------------------------------------

Tsunami 0.7.114.1 "absolute 2er0"
  ...don't worry. Everything will be fine!
audio library selected: pulseaudio
midi library selected: -none-

----------------------------- Error! -----------------------------
pa_context_connect: Connection refused

paplay does not work either, refusing connection on Sonoma and failing to open a file on Snow Leopard.

comment:28 in reply to:  26 ; Changed 10 days ago by RJVB (René Bertin)

Replying to barracuda156:

Though I guess at least in 2015 it worked for you? https://lists.apple.com/archives/coreaudio-api/2015/Feb/msg00001.html

You must have understood how well it worked... Thing is I can't even remember why I even tried this, but it must have been before I found out about libVLC and the VLC backend to phonon that works just fine to get sound in KDE applications.

I am afraid some rather archaic code needs to be dug out to make it work on older systems: https://pulseaudio-discuss.freedesktop.narkive.com/0h3Q2vci/patch-modules-coreaudio-replace-deprecated-functions

Ah yes, I remember running into code that required those changes to build. Honestly, I wouldn't bother backporting, I'd first try a PulseAudio version from before that patch above.

  1. S. By the way, how do I check pulseaudio on its own, without VLC?

As I said, paplay.

Do you have a VLC2.x version that makes sound through CoreAudio on your legacy systems? If so I'd try to get the CoreAudio "driver" to build and work with VLC3.

comment:29 in reply to:  28 ; Changed 10 days ago by barracuda156

Replying to RJVB:

Ah yes, I remember running into code that required those changes to build. Honestly, I wouldn't bother backporting, I'd first try a PulseAudio version from before that patch above.

I have found something potentially interesting, though old: https://github.com/zonque/PulseAudioOSX

  1. S. By the way, how do I check pulseaudio on its own, without VLC?

As I said, paplay.

Does not work on either systems, though fails a bit differently.

Do you have a VLC2.x version that makes sound through CoreAudio on your legacy systems? If so I'd try to get the CoreAudio "driver" to build and work with VLC3.

That is not trivial, unfortunately, since the code in libauhal depends on general VLC headers (like vlc_es.h) and just replacing with VLC2 versions does not work. So now the question is whether it is easier to fix the current code and restore the older but working one (which would require modifying stuff beyond CoreAudio plugin).

comment:30 Changed 10 days ago by barracuda156

Ah, this was the error with the VLC3 libauhal:

audio_output/auhal.c:450:27: error: 'kAudioObjectPropertyScopeOutput' undeclared (first use in this function); did you mean 'kAudioDevicePropertyScopeOutput'?
  450 |                           kAudioObjectPropertyScopeOutput);
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

(and more of the same). It also uses AudioFormatID which is 10.10+: https://developer.apple.com/documentation/coreaudiotypes/audioformatid

Which led to to a choice of disabling it in a hope PulseAudio will save us. Well, PulseAudio is broken and god knows which is broken worse :)

  1. S. On a side note, FreeBSD folks proposed an incredible solution to a broken pulseaudio: https://forums.freebsd.org/threads/pulseaudio-problem.7388/#post-43341
Last edited 10 days ago by barracuda156 (previous) (diff)

comment:31 Changed 10 days ago by barracuda156

Okay, I have fixed compiling libauhal in VLC3 (no idea if it gonna work though yet).

SOUND WORKS NOW!

I will review the hacks to see what can be dropped. But looks like I have a working thing now.

Last edited 10 days ago by barracuda156 (previous) (diff)

Changed 10 days ago by RJVB (René Bertin)

My audio devices

Changed 10 days ago by RJVB (René Bertin)

Sound playing

comment:32 Changed 10 days ago by RJVB (René Bertin)

Replying to barracuda156:

SOUND WORKS NOW!

Yay!


You mentioned a SIGSEGV in pulseaudio? I just got one when letting it launch as a daemon. In that case it tries to do something you're not allowed to do after a fork() on OS X (but I don't know since what version).

Starting it normally:

> pulseaudio --version
pulseaudio 13.99.1-rebootstrapped
> pulseaudio --realtime
W: [] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
W: [] pid.c: Stale PID file, overwriting.
W: [] socket-util.c: IP_TOS failed: Invalid argument
E: [] module-zeroconf-discover.c: pa_avahi_client_new() failed: Daemon not running
E: [] module.c: Failed to load module "module-zeroconf-discover" (argument: ""): initialization failed.
E: [] stdin-util.c: pa_module_load() failed

See the 2 attachments I uploaded for more proof ;)

comment:33 in reply to:  32 ; Changed 9 days ago by barracuda156

Replying to RJVB:

You mentioned a SIGSEGV in pulseaudio?

The one I referred to is specific either to powerpc or at least to < 10.7. Something which is supposed to work in libpthreads is in fact pretty broken. I have seen that failure elsewhere, though I am not entirely sure whether it is just broken or fails to work in some conditions but not generally.

I just got one when letting it launch as a daemon. In that case it tries to do something you're not allowed to do after a fork() on OS X (but I don't know since what version).

Later versions perhaps use poll, and that will not work correctly.

See the 2 attachments I uploaded for more proof ;)

From your log it follows you use rather old version of it. I did not try it. Was it built from a custom portfile or standard, just archaic one?

Changed 9 days ago by barracuda156

Attachment: Portfile added

FWIW, this is the portfile for PulseAudio I have now (I dropped PowerPC patch, since it is not relevant for you, AFAIU)

Changed 9 days ago by barracuda156

Attachment: patch-meson.build.diff added

And a patch to enable CoreAudio (dylib part is redundant, ignore it)

comment:34 in reply to:  33 ; Changed 9 days ago by RJVB (René Bertin)

Replying to barracuda156:

From your log it follows you use rather old version of it.

Yes, but should be new enough. (I do use a newer version on Linux.)

Was it built from a custom portfile or standard, just archaic one?

https://github.com/RJVB/macstrop/tree/master/www/audio/pulseaudio

comment:35 in reply to:  34 Changed 9 days ago by barracuda156

Replying to RJVB:

Replying to barracuda156:

From your log it follows you use rather old version of it.

Yes, but should be new enough. (I do use a newer version on Linux.)

Was it built from a custom portfile or standard, just archaic one?

https://github.com/RJVB/macstrop/tree/master/www/audio/pulseaudio

Thank you.

If you have a few min, could you try the current version on your system? I just wanna make sure it is not broken just for me (which is possible if I do something wrong).

comment:36 in reply to:  34 ; Changed 9 days ago by barracuda156

Replying to RJVB:

Replying to barracuda156:

From your log it follows you use rather old version of it.

Yes, but should be new enough. (I do use a newer version on Linux.)

Was it built from a custom portfile or standard, just archaic one?

https://github.com/RJVB/macstrop/tree/master/www/audio/pulseaudio

That version somehow manager to fail at configure with an odd error:

configure:10445: checking whether C compiler accepts -std=gnu11
configure:10465: /opt/local/bin/gcc-mp-13 -c -pipe -Os -arch ppc -pedantic -Werror -std=gnu11 -I/opt/local/include conftest.c >&5
conftest.c:75: error: "_DARWIN_C_SOURCE" redefined [-Werror]
   75 | #define _DARWIN_C_SOURCE 200112L
      | 
conftest.c:50: note: this is the location of the previous definition
   50 | #define _DARWIN_C_SOURCE 1
      | 
cc1: all warnings being treated as errors
configure:10465: $? = 1

It thinks gcc13 does not support gnu11 :)

comment:37 in reply to:  36 ; Changed 9 days ago by RJVB (René Bertin)

Replying to barracuda156:

If you have a few min, could you try the current version on your system? I just wanna make sure it is not broken just for me (which is possible if I do something wrong).

You do mean the current mainstream version then? I can try, but not promise when. Why don't you ask on one of the mailing lists, or file a ticket? After all my system isn't really relevant for what you're doing.

Replying to barracuda156:

That version somehow manager to fail at configure with an odd error:

configure:10445: checking whether C compiler accepts -std=gnu11
configure:10465: /opt/local/bin/gcc-mp-13 -c -pipe -Os -arch ppc -pedantic -Werror -std=gnu11 -I/opt/local/include conftest.c >&5
conftest.c:75: error: "_DARWIN_C_SOURCE" redefined [-Werror]

...

It thinks gcc13 does not support gnu11 :)

Not exactly. GCC is very good at backward compatibility with older OS versions, but not so much with older build systems. You could try to figure out where the earlier _DARWIN_C_SOURCE definition comes from, but redefining a token is in no way an error in C (AFAIK!) so at least the -Werror argument would have to be dropped from CFLAGS during these tests.

comment:38 Changed 9 days ago by RJVB (René Bertin)

FWIW, I think I had a renewed interest in PulseAudio a few years back to see if it would allow me to have remote sound when working over a VNC connection. I never managed to get that to work, possibly because I don't feel like running Avahi in addition to Apple's own ZeroConf/Bonjour (see the zeroconf init error in the terminal output I copied).

comment:39 in reply to:  29 Changed 9 days ago by RJVB (René Bertin)

Replying to barracuda156:

I have found something potentially interesting, though old: https://github.com/zonque/PulseAudioOSX

Looks like something written "around" PulseAudio. The prefpane and helper might be interesting, if they don't require the HAL plugin (of which I fail to see the interest).

comment:40 in reply to:  37 Changed 9 days ago by RJVB (René Bertin)

Replying to RJVB:

Replying to barracuda156:

If you have a few min, could you try the current version on your system? I just wanna make sure it is not broken just for me (which is possible if I do something wrong).

You do mean the current mainstream version then? I can try, but not promise when.

Did that. Something appears to be wrong with the CoreAudio modules: they fail to initialise, and PulseAudio quits because it doesn't detect any sound hardware as a result.

The dylib-instead-of-so thing is because of the move to Meson, easy enough to fix in modules/meson.build but you the etc/pulse/* config files (that should be installed as samples, not overwrite the current versions!) need to be fixed too. (Plus evidently meson doesn't use the same weird versioning as libtool/autoconf so you end up with libraries with a lower compatibility version and are rejected by all dependents...)

EDIT: I see that the CoreAudio code hasn't changed between the PA version in my tree and the current version (17), except for an additional headerfile that doesn't appear to be used. The reason module initialisation fails (or is thought to fail) could thus be trivial...

Last edited 9 days ago by RJVB (René Bertin) (previous) (diff)

comment:41 Changed 8 days ago by RJVB (René Bertin)

Hah, got PulseAudio 17 to work! Now to figure out what darwin_versions to specify in the meson build files so I don't have to rebuild my dependents... ;)

diff --git src/modules/orig.meson.build src/modules/meson.build
index 3636ce0..67535bc 100644
--- src/modules/orig.meson.build
+++ src/modules/meson.build
@@ -331,5 +331,6 @@ foreach m : all_modules
     link_args : [nodelete_link_args, no_undefined_args],
     link_with : extra_libs,
     name_prefix : '',
+    name_suffix : 'so',
     implicit_include_directories : false)
 endforeach
diff --git orig.meson.build meson.build
index ea897f1..d2427b7 100644
--- orig.meson.build
+++ meson.build
@@ -153,7 +153,7 @@ cdata.set_quoted('PA_BUILDDIR', meson.current_build_dir())
 if host_machine.system() == 'windows'
   cdata.set_quoted('PA_SOEXT', '.dll')
 elif host_machine.system() == 'darwin'
-  cdata.set_quoted('PA_SOEXT', '.dylib')
+  cdata.set_quoted('PA_SOEXT', '.so')
 else
   cdata.set_quoted('PA_SOEXT', '.so')
 endif

comment:42 in reply to:  41 ; Changed 4 days ago by RJVB (René Bertin)

Replying to RJVB:

Hah, got PulseAudio 17 to work! Now to figure out what darwin_versions to specify in the meson build files so I don't have to rebuild my dependents... ;)

FYI, I have pushed a full upgrade to 17.0 at https://github.com/RJVB/macstrop/tree/master/audio/pulseaudio (URL fixed).

Darwin/Linux so there's some crud to filter out, but: it works. Heck, even publishing over Apple "Bonjour" works; I've been able to stream audio from my Linux rig. Sadly there's no implementation for the opposite direction, but then I have almost no PA clients on Mac anyway.

Last edited 3 days ago by RJVB (René Bertin) (previous) (diff)

comment:43 in reply to:  41 ; Changed 3 days ago by barracuda156

Replying to RJVB:

Hah, got PulseAudio 17 to work! Now to figure out what darwin_versions to specify in the meson build files so I don't have to rebuild my dependents... ;)

diff --git src/modules/orig.meson.build src/modules/meson.build
index 3636ce0..67535bc 100644
--- src/modules/orig.meson.build
+++ src/modules/meson.build
@@ -331,5 +331,6 @@ foreach m : all_modules
     link_args : [nodelete_link_args, no_undefined_args],
     link_with : extra_libs,
     name_prefix : '',
+    name_suffix : 'so',
     implicit_include_directories : false)
 endforeach
diff --git orig.meson.build meson.build
index ea897f1..d2427b7 100644
--- orig.meson.build
+++ meson.build
@@ -153,7 +153,7 @@ cdata.set_quoted('PA_BUILDDIR', meson.current_build_dir())
 if host_machine.system() == 'windows'
   cdata.set_quoted('PA_SOEXT', '.dll')
 elif host_machine.system() == 'darwin'
-  cdata.set_quoted('PA_SOEXT', '.dylib')
+  cdata.set_quoted('PA_SOEXT', '.so')
 else
   cdata.set_quoted('PA_SOEXT', '.so')
 endif

Switching to .so on macOS is wild LOL

Let me try. Great, if it gonna work finally.

comment:44 in reply to:  42 Changed 3 days ago by barracuda156

Replying to RJVB:

FYI, I have pushed a full upgrade to 17.0 at https://github.com/RJVB/macstrop/tree/master/www/audio/pulseaudio

Am I doing something wrong?

404 - page not found
The master branch of macstrop does not contain the path www/audio/pulseaudio.

UPD. Never mind, I guess this https://github.com/RJVB/macstrop/commit/b106262c4bf7b6268f817e0d52327fc371a124a5

Last edited 3 days ago by barracuda156 (previous) (diff)

comment:45 in reply to:  42 Changed 3 days ago by barracuda156

Replying to RJVB:

I guess I miss something. With paplay I keep getting this:

Connection failure: Connection refused
pa_context_connect() failed: Connection refused

With pulseaudio I just get a bunch of complaints on trying to launch it:

% /opt/local/bin/pulseaudio.daemon
W: [] caps.c: Normally all extra capabilities would be dropped now, but that's impossible because PulseAudio was built without capabilities support.
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
E: [] core-util.c: Failed to connect to system bus: Failed to connect to socket /opt/local/var/run/dbus/system_bus_socket: No such file or directory
W: [] module-detect.c: failed to detect any sound hardware.
E: [] module.c: Failed to load module "module-detect" (argument: ""): initialization failed.
W: [] cli-command.c: stat('/opt/local/etc/pulse/default.pa.d'): No such file or directory

So it looks like I am back to this: https://trac.macports.org/ticket/69539#comment:21 With fixed modules, but broken CoreAudio.

Last edited 3 days ago by barracuda156 (previous) (diff)

comment:46 Changed 3 days ago by RJVB (René Bertin)

I'll try to remember to upload my /opt/local/etc/pulse/default.pa file when I get back to my Mac. There may be something wrong in the one that gets installed by default, I haven't tested that. The simplest explanation would be that it checks for the existence of modules with a .dylib extension.

I also got the "any sound hardware" error the 1st time I tried and I wouldn't be surprised if that's because of looking for modules with the wrong extension. But you should be able to test that with pactl load-module module-coreaudio-detect and pactl load-module module-coreaudio-device.

The system bus messages come from the fact that you're not running a system dbus daemon. I think you can ignore them safely.

Changed 3 days ago by RJVB (René Bertin)

Attachment: default.pa added

The default.pa file I promised.

comment:47 Changed 3 days ago by RJVB (René Bertin)

BTW, my renaming of the daemon to pulseaudio.daemon is in no way responsible for the fact it works; I just began doing that at some point so it wouldn't be auto-started.

I do install it setuid root so I can start it with --realtime but I'm not convinced that it actually has Mach realtime support and it shouldn't need to run with escalated privileges just in order to detect sound hardware, of course.

comment:48 in reply to:  43 Changed 3 days ago by RJVB (René Bertin)

Replying to barracuda156:

Switching to .so on macOS is wild LOL

Not really. The linker won't find libfoo.so from -lfoo of course, but it will accept the file just the same (the actual libraries in frameworks don't even have an extension at all).

But there's no standard for the extension of shared modules/plugins and as I said before, those can be created in a way that you can't use them as shared libraries even if they otherwise behave the same way.

Note: See TracTickets for help on using tickets.