|
|
|
|
| Welcome, Guest | Home | Search | Login | Register | |
| Author | Attempts to build m68k mpeg-dec (Read 159580 times) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
lauland
512 MB ![]() ![]() ![]() ![]() ![]() Posts: 674 Symtes 7 Mewconer! |
on: September 05, 2025, 19:03
This is using the source included in the second download on the MG page. To summarize so far: There are three folders in "src". One is titled "Mac" and is likely just the UI for the Mac version. Another is a command line demo player, which looks like it is for Linux. The final one is a "lib" that is non-platform specific and is the actual guts of the decoder. There are no Makefiles or project files included for the Mac build, so it isn't clear which compiler/assembler the original author used, but it is highly likely it was MPW. (Based on the age of the code). There are Makefiles included, but they are for x86 linux and "ColdFire", and separate ones for SAS/C on Amiga. ColdFire is a reduced function m68k that is typically used embedded or for some cpu accelerators on Atari ST. One notable use of it is in the iRiver ipod-like mp3 player. I have one of those and have been meaning to try out the RockBox 3rd party replacement firmware on it. It is possible the ColdFire code in mpeg-dec is used in it. ---- I created a codewarrior pro 6 project for mpeg-dec and after fixing a bunch of tiny language dialect problems in the C parts of mpeg-dec, was able to get all those parts built. There are several assembly language files in mpeg-dec, and at least one of them seems to be required, as the C code calls at least three functions in them. mpeg-dec includes multiple versions of these files, such as ones optimized for 68060 chips. It isn't clear which ones are needed for Mac. Codewarrior can't assemble "naked" assembly language files, so I can't build any of them in it. I tried using the "Asm" command in MPW to assemble the most likely looking file, but the resulting .o file doesn't contain any machine code. It looks like the assembly language dialect is NOT MPW, and probably Linux gcc/gas format, at least that is my best guess. I compared several MPW assembly language examples, and there are major differences in the syntax, just starting with the character used for comments. ---- The next thing I'll try is to use Retro68 to build mpeg-dec. This will probably require more tweaks to the C parts, as the version of gcc it uses is "quite recent" compared to CodeWarrior. I'll be able to use the included Makefile for the lib, with some new parts for Retro68, but will need to create a new one for the "Mac" folder. The key test will be to see if Retro68's assembler understands the assembly language files and actually generates machine code for them. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Last Edit: September 05, 2025, 19:05 by lauland
|
cballero
|
1024 MB ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1176 System 7, today and forever
Reply #1 on: September 06, 2025, 03:07
|
Oh my goodness! I had no clue this programming challenge adventure would turn out to be a real hornet’s nest as far as the sheer obscurity of the programming!I always assumed that each language was clear cut, but it wasn‘t until I started looking at the bits and pieces of MpegDec’s development that I even rediscovered that this was an application ported from the Amiga world, which I know so very little about! It’s still so amazing to see the breakdown of your journey you’ve endeavored so far, Lauland! I traveled out of town between yesterday and today, so I’m just getting to see all of this! I’m honored and humbled to be so clueless reading all of these updates, but I’m so grateful for even this awesome attempt overcome all of these programming obstacle; like I’ve been learning from so many of your past programming adventures, attempting these things becomes a real sleuthing job, even before you start adding anything to an existing program!
Last Edit: September 06, 2025, 03:20 by cballero
|
MTT
|
256 MB ![]() ![]() ![]() ![]() ![]() Posts: 394 SSW7 Oldtimer
Reply #2 on: September 06, 2025, 08:16
|
So then, Mark White used Rob Scott's ColdFire GNU ported code of Stephane Tavenard's original AMIGA source code which had been at the time recently GPL'd. That seems to me the source is now 3rd hand. Rob Scott noted in his documentation "The makefiles are currently set up to build with the uClinux ColdFire tool chain. Edit make.common to change the location of the toolchain. Go to mpegdec_lib, perform a make, then go to mpegdec_demo and do another make. This will result in a coldfire executable. If you wish to build an x86 version, comment out the ColdFire define the two directories' Makefiles, and do a "make clean && make" in both directories." I did some revisiting of MpegDec today, lauland, triggered by your interest here. Some of my findings: I managed to find an earlier MpegDec v2.5.3 (and added it to the MG's MpegDec page). This copy too, contains source code, but here's the disappointing part, the included source "src.sit" is the same as what is included in with v3.1.1 (checksums match), that is, the source archive in 3.1.1 was never updated for that newer version and who knows when this source was first used? This might be of interest: v2.5.3 includes an interesting folder named "alternativewindow" which contains some window resources. This version has rudimentary skinning, which perhaps could be further enhanced. This resource also works in v3.1.1 - Note; don't use the included icon resources if you try this out on 3.1.1. It might be better to use the original AMIGA source code, or at least take a look at it. Maybe it could be ported directly from the original source. Maybe a classic Mac application shell could house it, ignoring MpegDec outright. Some further notes to tie in with this thought: _________________ AMINET announcement: http://aminet.net/util/libs/mpega_library.readme Short: MPEGALibrary source code Author: Stephane Tavenard Uploader: amigasourcecodepreservation gmail com Type: util/libs Version: 2.4 Architecture: generic Source code for the MPEG library MPEGALibrary. Binaries: http://aminet.net/package/util/libs/mpega_library Uploaded to aminet for historical preservation. Many thanks to Stephane Tavenard for releasing the source code. License ======= MPEGALibrary is distributed under the terms of the GNU Lesser General Public License, version 2 or later. See the COPYING.LESSER file for details. _______________ Source available on AMINET: http://aminet.net/package/util/libs/mpega_library mpega_library.lha Short: MPEG Audio decoder library v2.4 (68020+) Architecture: m68k-amigaos,ppc-powerup Date: 1999-09-15 http://aminet.net/package/util/libs/MPEGALibrary_src MPEGALibrary_src.lha (v2.4) Short: MPEGALibrary source code Architecture: generic Date: 2017-10-11 http://aminet.net/package/mus/play/MPEGAPlayer_src MPEGAPlayer_src Short: MPEGAPlayer source code Author: Stephane Tavenard Version: 2.50 Architecture: generic Date: 2017-10-11 An updated source here: http://aminet.net/package/mus/play/MPEGA_src MPEGA_src.lha Short: MPEGA source code Version: 3.5 Architecture: generic Date: 2017-10-11 _______________ GUI front ends that are out out there somewhere: http://aminet.net/package/mus/play/3PMGUI 3PMGUI.lha Short: Skinnable MPEGA GUI-ideal for low CPUs! Version: 0.5 Architecture: m68k-amigaos Date: 2001-01-22 Requires: MPEGA http://aminet.net/package/mus/play/MpegA_GUI12 MpegA_GUI12.lha Short: GUI for mpega audio player/decoder V1.2 Author: MC6144 at mclink.it Architecture: m68k-amigaos Date: 1996-04-09 http://aminet.net/package/mus/play/BMG BMG Short: Mpega GUI - v1.041 Author: brucey at thenet.co.uk (Bruce A Henderson) Architecture: m68k-amigaos Date: 1997-06-28 http://aminet.net/package/mus/play/DiamondGUI13 DiamondGUI13.lha Short: v1.3 of the most usable GUI for MPEGA Architecture: m68k-amigaos http://www.amigaamp.de/ AmigaAMP WinAMP look alike player using Stephane Tavenard's mpega source for the engine. AmigaAMP Skins ! http://www.amigaamp.de/skins.shtml <-- awesome - do this for classic ![]() Other Links Earliest known web pages for MpegDec on jwgdesign.com (2006) http://web.archive.org/web/20060820233736/http://www.jwgdesign.com/mpegdec/about.htm With links to past news (2002) http://web.archive.org/web/20090225101133/http://www.jwgdesign.com/mpegdec/news2002.htm This linked to the earliest MpegDec page I could find via the WA: http://web.archive.org/web/20030409193802/http://members.aol.com/xanathus/mpegdec/about.htm Which in turn provided contact links for Mark White: http://web.archive.org/web/20050420104337/http://members.aol.com/xanathus/mpegdec/contact.htm Whereupon the trail goes cold...
Last Edit: September 06, 2025, 08:36 by MTT
|
cballero
|
1024 MB ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1176 System 7, today and forever
Reply #3 on: September 06, 2025, 14:13
|
Thanks for diving right into this, Mike! ![]() MpegDec has rightfully long been the darling MP3 tool for 68k Macs as well as PPC Macs, but you've now shed light that we didn‘t get all of its source code! Your suggestion of going back to Stephane’s original AMIGA source code seems to be a solid option considering the missing pieces of the current build. It's just such a shame that it was left out by mistake
|
Cashed
|
128 MB ![]() ![]() ![]() ![]() Posts: 192 System 7 Newcomer!
Reply #4 on: September 06, 2025, 18:00
|
Great project choice ![]() Limiting more inputs is necessary currently -couldn’t resist a quick peek. Slider CDEF 1.3.0 © 1993-94 by Harold Ekstrom was used in Mpegdec v3.1.1 There are earlier versions of SliderCDEF around prior to that, dating back to 1989-1991 by others. One is included with the AppMaker v1.54 ( P.S. None of them scanned ) Quote from: Low End Mac MpegDec purports to be able to play MP3s on any Mac with at least a 68040 processor, and it may be able to function on 68030 Macs as well. However, no 68k Mac I have tried has the ability to play a 128 kbps stereo MP3. There is simply not enough muscle in the old 68k Mac platform.MpegDec: Play MP3s and Streaming Audio on 680x0 and Old PowerPC Macs https://lowendmac.com/thompson/06/0314.html
|
Cashed
|
128 MB ![]() ![]() ![]() ![]() Posts: 192 System 7 Newcomer!
Reply #5 on: September 07, 2025, 15:07
|
Follow-up from previous post . . . Do not let that stop ya, hang in there -I think I there's a solution. In that previous quote from 2006.03.14, he didn’t specify what OS, hardware or connection he was using, nor if that was from streaming or playing locally. Found a follow-up to that statement. Quote from: Nathan Thompson - 2006.05.01 MpegDec Yesterday I was in the midst of archiving a lot of other things -when I had that quick peek at MpegDec. This morning I returned to all the opened browser tabs from where I left off yesterday. In one of them was NVDI for MagiC-Mac -an accelerator for the OS that uses what the system already understands -and bypasses the emulator. That got me thinking if there was a workaround . . . Quote from: Daniel Knight 1998 Fact is, every Mac ever made supports 230.4 kbps over the serial port.Article ->Macintosh Serial Throughput Using a WiRSa v3 Wifi RS232 Serial Modem adapter with SD -one can both stream MP3s and play them locally off an external SD card hocked up to the serial port. I remembered reading David Cook’s thread, he wrote a little program called Tiny Transfer! -a simple serial transfer tool. On Apple’s proprietary ACE3 USB-C controller there’s a serial connection. DEFCONConference: DEF CON 32 - From getting JTAG on the iPhone 15 to hacking Apple's USB-C Controller - Stacksmashing (3:10) ACE: Apple Type-C Port Controller Secrets -blog You can find some GUI sources on MacGUI for creating appearance themes. Maybe using something like the Appearance SDK, or Newlook -not sure if we have the source code for that or Kaleidoscope. What I’m trying to get at is, aim to make the application as lightweight as possible -so the system resources remains fast.
|
lauland
|
512 MB ![]() ![]() ![]() ![]() ![]() Posts: 674 Symtes 7 Mewconer!
Reply #6 on: September 07, 2025, 19:26
|
Ok...I'm going to set aside any customizing of the UI as far as themes until I get an actual Mac Application of any kind building! Obviously once I get anything built, we can talk about fixing and improving...but that's a way off yet. Looking at the sources, I did have the suspicion that what is there is NOT for the Mac 3.x version app binary that is publicly available, but maybe an older version. Regardless, I'll continue to try to build the source that I DO have, that came in the 3.x archive. If you guys find the SOURCE for any other Mac version, even 2.x, that would rock. (Other than SEVERAL Amiga which you did find). I want to build SOMETHING, version et al doesn't matter, for a start. ---- So one thing I'll try is building an x86 command line player from the source, as that seems to be included in the source. The only assembly included is m68k, so it occurs to me it very well might be possible to build it C only...and that's what an x86 version would be. I might be able to get a Mac C only version built that way...wouldn't be as fast, but would be a good "proof of concept". It may be the source detects the CPU and since I'm using an m68k compiler, it tries to use the m68k assembly files. I didn't see C versions of the specific funcs it is trying to call, but it may be that they are only part of the assembly code, and a C version of the decoder doesn't need them. Another thought I had was they might have used Think/Symantec C, so if I don't get anywhere with Retro68 that'll be something to try. I'm hoping the assembly language is gcc/gas compatible, and, if so, Retro68 will understand it fine...but we'll see... Otherwise I can try looking at the syntax closely and trying to identify which assembler/compiler they used...but it is completely possible what was actually used on the Mac is NOT included in the source archive! ---- Starting with the amiga version and building on that is a whole other thing. ie Getting a brand new m68k mpeg-dec. Possibly treating the lib (actual decoder) separate from the UI. If I did that it is possible I could re-use the existing UI source... ...but the "Mac" folder seems to include a few bits of the decoder also. In fact, there are several duplicate files to what is in the "lib" folder. There also is "mp3onlydec.c" which, my guess, is just mp3, and leaves out all other kinds of mpeg files. (And it duplicates funcs in other files). I am suspecting the Mac mpeg-dec uses it, as there is a copy in the "Mac" folder. ---- Anyway, next steps will be on a linux machine. Will try to see what makefiles make for x86, and also trying to build in Retro68...
Last Edit: September 07, 2025, 19:56 by lauland
|
wove
|
1024 MB ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1363
Reply #7 on: September 07, 2025, 21:58
|
Quote from: “lauland” So one thing I'll try is building an x86 command line player from the source, as that seems to be included in the source. There are a number of open source command line decoders/players for Linux and BSD, most written in "C". Would they make better starting points. Since I believe you mentioned have a 68k Linux installed, perhaps if nothing else you would get a handle on what sort of performance you could expect on a 68k machine. (The annual Rock Bend Folk Festival was this weekend in town. This afternoon was mostly Blue Grass music, all acoustic filtered though the trees and mummer of the crowd (a few thousand+/-). It was really very enjoyable. Music is a construct of the mind and I think way too much effort is put on bit rates and such.
|
ShinobiKenobi
|
256 MB ![]() ![]() ![]() ![]() ![]() Posts: 362 System 7 fan
Reply #8 on: September 07, 2025, 22:04
|
Interesting. I'll look into this when I get home (at work right now). Does it require advanced algorithms for the encoding? I have no background in codecs.
|
lauland
|
512 MB ![]() ![]() ![]() ![]() ![]() Posts: 674 Symtes 7 Mewconer!
Reply #9 on: September 08, 2025, 02:06
|
wove: Naw, what I'm trying to do is to use WHATEVER this source we already have, that comes with the Mac version of mpeg-dec to see if THAT can be used to build an x86 linux command line version, as a proof that the source works for at least that. ie My personal goal is to get that source building at all. When you say "starting point", that sounds like a completely different goal, as in to get just a player, any player, and possibly slap a mac gui on it. We already have the binary for a very nice Mac version, so...can we build THAT in any way? (Building a new player can be looked at next, but first what about this source that we have?!?) My theory is a hypothetical C only version can be built, without the assembly magic, it wouldn't run very well on any real m68k machine... ...BUT you bring up a very interesting idea with m68k linux, which I do have. And if I can build it x86 linux, there's a good chance I could build it on m68k linux. But only a chance. Debian m68k linux is QUITE old compared to any x86, so I'm likely to run into all sorts of problems, just to start how it outputs audio, which has radically evolved on linux extremely far over the years. But if it builds x86 linux, definitely can try m68k...I'm of mixed mind how useful and/or worth it or what it'd tell us other than "it doesn't run well without the assembly"...even if I can get it building which is a big question. Anyway...off to get the source from my Mac to my x86 linux machine now. To try and build the x86 command line and to see if, after creating a Makefile, I can get it to build in Retro68...
Last Edit: September 08, 2025, 02:08 by lauland
|
Cashed
|
128 MB ![]() ![]() ![]() ![]() Posts: 192 System 7 Newcomer!
Reply #10 on: September 08, 2025, 03:30
|
@lauland "...I'm of mixed mind how useful and/or worth it..." Did you ever read the initial S7T "MPEGdec" thread, 'A music stream player running on 68k ?' -the original was on MG. Would be nice with an update on how many stations actually still works. The last thing I want for you is to make an effort that's redundant in the end. Quote from: Steven Frank 2004 We Don't Miss The Past-Steven Frank · Audion · Panic As a side note. The source code for Winamp and Clementine are available.
|
lauland
|
512 MB ![]() ![]() ![]() ![]() ![]() Posts: 674 Symtes 7 Mewconer!
Reply #11 on: September 08, 2025, 04:35
|
re "We don't miss the past". Oh geez. Yes, sounds very painful. I was hoping it would be fast enough, or wouldn't care if interrupts happen, and would "just work"...assuming we can get it built, that is! So, the x86 linux player built with zero problems, but crashes when I try to play 5 different random mp3's from my collection. I used gdb to see where it is crashing, but it seems to be in the decoding itself, which it never quite finishes. No idea why, and it will take some debugging to figure it out, but it looks like it is reading past an array, and would take some understanding of how mpeg's work to figure it out. For grins, I was able to compile the lib and demo player with Retro68 (using the included Makefiles with no changes) and it builds. In theory it would even run, but there's no point in trying since the x86 one crashes, its almost certain this would crash too. The result is a mac player with no user interface. It expects a filename on "the command line", which doesn't exist on a Mac! This is all just C and not using the assembly language files at all. Speaking of which, tried both the gcc/gas assembler that comes with Retro68 and cross m68k for x86 linux on the assembly language files and they couldn't make head or tails of the syntax. So it is possible THOSE assembly files are ColdFire specific, and the src archive we have doesn't have the Mac assembly ones at all. ---- I then created a Makefile for the "mac" folder and there are problems with parameters where it calls a couple decode functions, mismatches between pointers to ints and pointers to pointers to ints. I think it is the duplicate file issue I mentioned before. There are maybe mac versions of a couple decoder files that override the lib? Will need to do more sleuthing. But...did find clues to the compiler, but a bit confusing. There's the obvious "consolempw.h" file, and "getargs.c" seems to refer to MPW functions...BUT..."mpegmac.c" includes SIOUX.h and calls SIOUX functions, which is a standard io lib that is part of CodeWarrior. So...did it originally use MPW and then they switched to CodeWarrior? I'm going to revisit codewarrior and the assembly language files. As far as I know you can't use it to just assemble naked assembly language files, but only do it inline, but I might be mistaken. ---- It's strange, because the C files DO build in CodeWarrior, but seem to refer to functions in the assembly language files. But then the x86 linux (and Retro68!) builds don't seem to use the assembly files. So, what did they use to build them? Are we missing Mac versions for CodeWarrior? Or is there a flag I can set to make it not use them that I'm missing? And what about the duplicate files in the "mac" and "lib" folders? In the x86 and Retro68 builds I'm not using the "mac" folder at all, so are they needed, or maybe just mac optimized versions? Is the src archive incomplete? Can we find the actual mac source for the 3.x decoder?
|
lauland
|
512 MB ![]() ![]() ![]() ![]() ![]() Posts: 674 Symtes 7 Mewconer!
Reply #12 on: September 08, 2025, 16:04
|
Ok, just a couple derps on my part: There are separate assembly language files in the "mac" folder. Those, and the duplicate C files I see, probably are meant to override parts of what is in the "lib" folder. I was so focused on the lib, if they were a snake, they woulda' bit me. They very well may be MPW assembly and I'll try building them with it. (But I'm still confused by the reference to codewarrior's SIOUX...and how/if they used codewarrior to assemble the files if not MPW...did they use BOTH?!?) So, instead of building the full lib, parts of it may be overridden by things in "mac". So I should build what is in "mac" FIRST, and then only link in parts of the lib that include funcs that it refers to. ie remove all the lib .c files from the codewarrior project, and only add them back as absolutely needed, etc. This again brings up the point that if you don't have a makefile or project file, it can be very hard to know which files are actually used, as project maintainers will commonly leave extra files around. They may be variations, things for one compiler vs another, for one platform and not another, or even things they are testing etc. ---- And a note about the "command line only" demo player (not using "mac" at all) I was able to build using Retro68...obviously it would have no UI, but I neglected to note that there were no errors about audio output. Which begs the question, how does it actually do audio output? Obviously the Mac version uses Sound Manager funcs in "mpegmac.c", but how does the linux one do it? Probably by writing to a unix/linux "/dev/audio" file or something like that. So, what I built not only doesn't have a UI, but it also wouldn't play anything! ---- Also, tried building command line demo player for MacOS X on modern Apple Silicon, and resulting executable also crashes like the x86 linux one does, in same place. Don't know what THAT means. Is the lib source bad? Just too old for modern systems? (Possibly it is not 64-bit clean). Or am I somehow compiling wrong, even though using the supplied makefile.
Last Edit: September 08, 2025, 16:49 by lauland
|
wove
|
1024 MB ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1363
Reply #13 on: September 08, 2025, 17:41
|
I do not know anything about programming so if my kibitzing is distracting and/or annoying, feel free to tell me to just shut up. In an mp3 player the decoding is handled via a chip, whose output is routed to the sound out via wires. Since the software decoder is used instead of a chip, I would guess that the output of the software decoder would be piped to sound out software subsystem (ALSA, Jack, Pipewire?) on a command line system. Since the Classic Mac always seems to need a GUI, I just visualize a player that only opens to a dialog box requiring the user to enter a path to the file/folder/URL to start playing. With the volume being controlled via Control Strip or Sound Control Panel. Start and stop handled via "Command Q"
|
cballero
|
1024 MB ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1176 System 7, today and forever
Reply #14 on: September 09, 2025, 06:24
|
Yikes, oh my! I know the least of programming, and by the way, thanks Cached for digging up the references you found! I wonder if maybe the player itself might hold any clues as to how or with what it was built? I know often times Sidd and other MG friends look under the hood to undemo software routinely. Could a similar approach be used for MpegDec, maybe if just for analysis? My thoughts initially were something like this: for the equalizer to see if maybe it's deactivated like an on/off switch of some sort. Similarly, maybe the 20k at size limit code could be located somehow. Again, most of what I've seen Sidd and others do is nothing short of miraculous, but I haven't the slightest clue as to what they actually do to pull the things they do off, but it sounds somewhat 'programmy' ![]() My geo location rn isn't letting me access the MG at the moment, but Sidd does publish his software fixing solutions on his blog, which he has a link to in his MG profile/guestbook page; hey, leave no stone unturned, right? whatever little I can offer I do so gladly and appreciatively, especially for this valiant coding challenge and the case of the missing source code!
Last Edit: September 09, 2025, 06:27 by cballero
|
|
Pages: [1] 2
|
| |||||||||||||||
|
© 2021 System7Today.com. |


I had no clue this programming challenge adventure would turn out to be a real hornet’s nest as far as the sheer obscurity of the programming!


