Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Hmm...sorry about the confusing "patches".

Yes, I had previously worked on the same files (hence the telltale "LAULAND" comment!) in https://github.com/macos-powerpc/po...les/0003-Cocoa-adjustments-to-fix-build.patch

I believe that was to get the cocoa driver to work on tiger with SDL 2.0.3, and THIS time it is get the SAME driver to work on 10.5/10.6 with SDL 2.3x.x. (ie "safe" and "test" are for SDL 2.3x.x).

I apologize for any confusion, let me know if I can straighten out what is what.

I'd wanted to work on SDL without any dependencies (so no macports), to isolate any problems with SDL itself, but that makes it very difficult to later, when/if you actually wanted, to pull those changes into powerpc ports.

When I have time I'll install powerpc ports on both leopard and a5 (and possibly tiger too), so I could do actual PRs or plain old patches instead of sending you naked tar files and making you do so much work! (And that way base any changes I propose on actual existing ports).
 
I got SDL3 working without sound on my machines. I need to add context lines to the patches before it will be worth making a PR. Luckily, lite-xl is already working!
@lauland @barracuda156 - is it possible to build SDL with sound support? FFplay is a very nice player if SDL can provide sound support.
For SDL3, I may test the pulseaudio backend at some point to see if it works.
 

Attachments

  • Picture 2.png
    Picture 2.png
    149.9 KB · Views: 12
  • Like
Reactions: barracuda156
I got SDL3 working without sound on my machines. I need to add context lines to the patches before it will be worth making a PR. Luckily, lite-xl is already working!

That’s good to know.

@lauland @barracuda156 - is it possible to build SDL with sound support? FFplay is a very nice player if SDL can provide sound support.

It should be, but someone has to do that. You could try resurrecting an earlier version of coreaudio implementation or see if Copilot can make a patch for the current version (I think it is a single file, not something at complexity level of OpenGL).

For SDL3, I may test the pulseaudio backend at some point to see if it works.

If you get it working, let me know, I was never patient enough to figure out how to use it on any macOS (arm64 included) LOL
 
SDL3! Very very nice! I haven't even tried it, as didn't have anything that needed it, but great to hear you got it working!

Check and make sure the audio dummy driver is enabled, if you don't already have it. It isn't a real driver and returns 0's and nulls for almost everything.

I think an attempt at resurrecting an older coreaudio would be a good idea, similar to what I did with the Cocoa one. Mostly fixing a ton of tiny things to work on newer OS's, but also going from older SDL to newer, and possibly adding dummy funcs for things that didn't exist in old SDL. Looking at that has been on my list, but I've never had the time.

If you start working on an audio driver of any sort, let me know, and I can follow along and may be able to help.
 
@lauland @barracuda156 - is it possible to build SDL with sound support? FFplay is a very nice player if SDL can provide sound support.
I know that thedoc of Leopard Ports has his own versions of SDL1+2. I took a very quick look at them and some of them were older, and/or different versions, than what is in macports and ppc_ports. Sound works in most versions of SDL 2.0.x, but not newer (ie 2.3x.x). I didn't try his newer versions to see if they had working sound yet, but its on my todo list. (If they do, we really should merge in his changes).
 
  • Like
Reactions: barracuda156
I made some progress patching it back to close to how it was in 2.0.6, but I am getting a linking error.
Patches and logs are attached. I also modified two patches that currently modify the relevant files so my patches could apply.
 

Attachments

  • tiger-coreaudiom.txt
    61.2 KB · Views: 16
  • tiger-coreaudio.txt
    2.1 KB · Views: 9
  • 0001-Fixes-for-PowerPC.txt
    2 KB · Views: 10
  • 0002-gcc-build.txt
    4.8 KB · Views: 8
  • sdl2-cocoa-log.txt
    537.1 KB · Views: 12
I just did a build of 2.0.3 with coreaudio, outside of ports, and can see it linking with "AudioUnit", which it looks like you are missing, in addition to CoreAudio and AudioToolbox, which you already have. Looks like you may just need to add it.
 
FYI thedoc of Leopard Ports has provided a pre-built copy of ppc ports. Its a 10.5g download, but I decided to give it a try.

I haven't checked yet which port he installed for SDL2, but it looks like version 2.32.0. I built the SDL2 tests separately using it to see what it had.

It looks like it has the cocoa driver, but doesn't have the fix I found for logging, which is outside the cocoa driver. (In SDL_log.c I think?)

leopard:test lauland$ ./testver
2025-12-17 09:47:01.474 testver[1495:10b] INFO
2025-12-17 09:47:01.480 testver[1495:10b] INFO
2025-12-17 09:47:01.482 testver[1495:10b] INFO

It also seems to have a working audio driver, as "loopwave" plays...which is awesome!
 
Last edited:
It looks like whomever wrote the code was trying to put the log/error output to the System log, using SDL_NSLog(), but didn't do it quite right? So the timestamp and "INFO" or "ERROR" (or whatever) goes to stderr/stdout, but the ACTUAL message goes "somewhere else".

I did a cursory look in the logs and couldn't find the messages easily, but expect them to be SOMEWHERE in the log viewer Console Application.

I thought it was silly to have the timestamps and INFO show up but not the message, so to Do it Right (TM) you'd want both parts to AT LEAST go to the SAME place, ie both to the system log or both to stderr/stdout.

--

For my personal copies of SDL, I made the executive decision to have everything go to stderr/stdout so it would be like on Linux.

So, to fix it THAT way in the Cocoa driver, in SDL_cocoavideo.m replace the line:
NSLog(@"%s %s", prefix,text);
with
fprintf(stderr,text); fflush(stderr);

NOTE: The fprintf does NOT include "prefix" on purpose because that is the datestamp/INFO and that is ALREADY going to stderr/stdout.

--

Alternately, in SDL_Log.c, where the prefix is sent to stderr/stdout should be #ifdef'd out for COCOA, so the prefix/INFO isn't printed twice (in two different places), and the entire message goes wherever NSLog goes. I didn't look to see how THAT should be done, but could if you wanted me to. (I'm happy with just stderr personally).
 
FYI I Found just INFO in /var/system.log, so it really isn't working without some sort of fix:
Dec 17 09:48:27 leopard testaudioinfo[1500]: INFO
Dec 17 09:49:34 leopard testsprite2[1501]: INFO
Dec 17 09:54:40 leopard testver[2749]: INFO
Dec 17 09:54:46 leopard loopwave[2750]: INFO
 
Excuse me. I've got SDL_Init failed with mpv on A5 radeon 9600.
VLC-X11 says it can't play h264. And asks to rebuild. Rebuild fails even after changing wrong tar checksums.
The only player working - mplayer :)
 
Excuse me. I've got SDL_Init failed with mpv on A5 radeon 9600.
VLC-X11 says it can't play h264. And asks to rebuild. Rebuild fails even after changing wrong tar checksums.
The only player working - mplayer :)

1. Try this first:
Code:
sudo port -v upgrade —enforce-variants libsdl2-cocoa +oldapi
If it doesn’t work, then ATI support is broken in Cocoa.

2. In that case this should work fine:
Code:
sudo port -f deactivate libsdl2-cocoa
sudo port -v install libsdl2-x11
sudo port -v install xquartz
Reboot, try running mpv.
You may or may not need to install ffmpeg7 with +x11 and mpv with +x11. (I cannot check now, no machine with ATI here.)
If X server complains about dbus session, run the command which it suggests from non-root user (without sudo).

P. S. If you already have some version of X server working (which probably is the case, if you ran VLC), then installing xquartz port is not required, xorg-server-legacy works too.
 
Last edited:
Excuse me. I've got SDL_Init failed with mpv on A5 radeon 9600.
VLC-X11 says it can't play h264. And asks to rebuild. Rebuild fails even after changing wrong tar checksums.
The only player working - mplayer :)

I will check VLC, but it is not advised in any case. I was considering to delete the port altogether since it was broken for a while. It worked on its last update, but it is worse that other alternatives, buggy and unstable.

What’s up with QMPlay2, QMPlay2-devel and mplayer-devel? QMPlay2* is generally the best.

Upd. I will deal with fixing VLC-X11 build now, at the very least it missed a revbump for libtheora update. However, I really recommend going with QMPlay2*.
 
Last edited:
@lauland Could you take a look why mpv via SDL2 Cocoa has no slider for the video? The video (and audio) plays perfectly fine, but the app is "frozen" with ball spinning, so playback cannot be controlled normally. This is not a new problem, I just think it will be nice to fix it.
Via X11 it works as expected.
 
A quick question about the latest SDL2 available for Leo/SnowLeo PPC: would be possible to have it also as Framework bundle and not only as library? I am asking this because if a remote possibility exist to have the MAME emulator built for one or both the above OSX systems, the SDL2 Framework will be needed for the executable to be easily portable between Macs without the need of MacPorts installed. Many thanks! :)
 
A quick question about the latest SDL2 available for Leo/SnowLeo PPC: would be possible to have it also as Framework bundle and not only as library? I am asking this because if a remote possibility exist to have the MAME emulator built for one or both the above OSX systems, the SDL2 Framework will be needed for the executable to be easily portable between Macs without the need of MacPorts installed. Many thanks! :)

Well, it probably is possible, but someone has to implement a variant for that, since MacPorts does not have it for modern macOS either: https://ports.macports.org/port/libsdl2/details
 
Thank you, maybe my question was a bit incorrect, what I meant was: looking at the SDL2 repository for 2.32.10

https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.32.10.zip

inside there is an Xcode project for building the needed Framework but of course it is tuned for modern Xcode app and without any support for PPC Macs but would it be possible to apply the same patches done so far for the libraries also to this Xcode project and have a functional SDL2 framework at least for SnowLeo PPC?
 
Thank you, maybe my question was a bit incorrect, what I meant was: looking at the SDL2 repository for 2.32.10

https://github.com/libsdl-org/SDL/archive/refs/tags/release-2.32.10.zip

inside there is an Xcode project for building the needed Framework but of course it is tuned for modern Xcode app and without any support for PPC Macs but would it be possible to apply the same patches done so far for the libraries also to this Xcode project and have a functional SDL2 framework at least for SnowLeo PPC?

Since powerpc systems support frameworks, it should be possible to build SDL as one. You may try looking at how a) SDL upstream did it around SDL 2.0.3 and b) MacPorts does it for libsdl (v. 1.x) for +framework variant.
 
1. Try this first:
Code:
sudo port -v upgrade —enforce-variants libsdl2-cocoa +oldapi
If it doesn’t work, then ATI support is broken in Cocoa.

2. In that case this should work fine:
Code:
sudo port -f deactivate libsdl2-cocoa
sudo port -v install libsdl2-x11
sudo port -v install xquartz
Reboot, try running mpv.
You may or may not need to install ffmpeg7 with +x11 and mpv with +x11. (I cannot check now, no machine with ATI here.)
If X server complains about dbus session, run the command which it suggests from non-root user (without sudo).

P. S. If you already have some version of X server working (which probably is the case, if you ran VLC), then installing xquartz port is not required, xorg-server-legacy works too.
Hi!

port uninstall installed, port clean all, port sync
install VLC-X11 - video ASCII, install xorg-server-legacy - reboot - yes it works. No gui, but h264 playback present.
install mpv - SDL2 error.

port -v upgrade --enforce-variants libsdl2-cocoa +oldapi
mpv works, no window decorations, cursor = spinning beachball.

sudo port -f deactivate libsdl2-cocoa
sudo port -v install libsdl2-x11

mpv with decorations, video - slide show.

install QMPlay2 - there is gui there, h264 doesn't play - no image, time counter at 00 then stops.
install QMPlay2-devel (removed libsdl2-x11) - video plays, slide show. 1 core load, changing ffmpeg threads to 2 didn't change anything.
 
port uninstall installed, port clean all, port sync

You may just do deactivate installed, to avoid re-downloading or recompiling unchanged ports.

install VLC-X11 - video ASCII, install xorg-server-legacy - reboot - yes it works. No gui, but h264 playback present.

Good to know it is usable. VLC was always a pain.

install mpv - SDL2 error.

This is specific to A5 which needs +oldapi (because it uses old GL from Leopard).

port -v upgrade --enforce-variants libsdl2-cocoa +oldapi
mpv works, no window decorations, cursor = spinning beachball.

This is known glitch, I hoped @lauland could help with this.

sudo port -f deactivate libsdl2-cocoa
sudo port -v install libsdl2-x11
mpv with decorations, video - slide show.

Performance via X11 is inferior, if you mean video lags. It was normally usable on the Quad at least (unless you wanna play 4k 60fps av1).
What does mpv show on command line? Does it use sdl or x11 directly? Does it use gl or not?

install QMPlay2 - there is gui there, h264 doesn't play - no image, time counter at 00 then stops.

This is weird, I will check it. Do other videos play normally?
Have you compiled it locally or used my package? Do you have qt4-mac or qt4-mac-devel installed?

install QMPlay2-devel (removed libsdl2-x11) - video plays, slide show. 1 core load, changing ffmpeg threads to 2 didn't change anything.

This should not be the case, but I am not sure how to debug it without reproducing. I will verify it uses all cores (it was before).
 
@krrsh Could you show the output for:

port -v installed libsdl2-x11 libsdl2-cocoa libplacebo mpv ffmpeg ffmpeg5 ffmpeg7
krsshs-Power-Mac-G5:~ krssh\$ port -v installed libsdl2-x11 libsdl2-cocoa libplacebo mpv ffmpeg ffmpeg5 ffmpeg7
The following ports are currently installed:
ffmpeg @4.4.6_7+G5+gpl2 (active) requested_variants='+G5' platform='darwin 10' archs='ppc' date='2025-12-31T10:59:48+0300'
ffmpeg5 @5.1.8_1+G5+gpl2 (active) requested_variants='+G5' platform='darwin 10' archs='ppc' date='2025-12-31T11:45:46+0300'
ffmpeg7 @7.1.3_1+gpl2+vmaf (active) requested_variants='' platform='darwin 10' archs='ppc' date='2025-12-31T10:48:09+0300'
libplacebo @7.351.0_0+opengl (active) requested_variants='' platform='darwin 10' archs='ppc' date='2025-12-31T10:59:12+0300'
libsdl2-cocoa @2.32.10_1+oldapi+opengl requested_variants='+oldapi' platform='darwin 10' archs='ppc' date='2025-12-31T11:17:27+0300'
libsdl2-cocoa @2.32.10_1+opengl (active) requested_variants='' platform='darwin 10' archs='ppc' date='2025-12-31T10:35:37+0300'
mpv @0.41.0_0+audiocd+bluray+dvd+libarchive+libmpv+network_ytdlp+opengl+osd+python313+rubberband (active) requested_variants='' platform='darwin 10' archs='ppc' date='2025-12-31T11:01:45+0300'
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.