Otto1980 Posted February 25, 2013 Share Posted February 25, 2013 Hi all, ever someone tryed to code a simple ogg/mp3 sound engine on the jag? greets Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 25, 2013 Share Posted February 25, 2013 Neither format is simple to implement because you'd need to find a fixed point implementation and then recode it in assembler to run on the DSP. Each algorithm would not fit entirely in the DSP's local RAM so you'd lose performance by accessing main RAM for data tables, constants and the audio data stream. 2 Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted February 25, 2013 Share Posted February 25, 2013 mp3s on jaguar seems to make no sense. The obvious question is where would you store them? On CD? Just burn an audio CD and leave the Jaguar free to work on the stuff it's good at :-) Quote Link to comment Share on other sites More sharing options...
Otto1980 Posted February 25, 2013 Author Share Posted February 25, 2013 The idea is to open much more sources of sounds for jag... millions of sound/samples out there are mp3/ogg and mods are really hard to create with old tools or without musik knowledge and and and... maybe a maximal 16kbits and very basic routine would be possible on dsp without using the bus that much and if, it would be unbelivable helpfull on new games i recive my skunk these days and will give it a try bye Quote Link to comment Share on other sites More sharing options...
GroovyBee Posted February 25, 2013 Share Posted February 25, 2013 The idea is to open much more sources of sounds for jag... millions of sound/samples out there are mp3/ogg and mods are really hard to create with old tools or without musik knowledge and and and... If you aren't an expert in sound/music then that is all the more reason to form a small team. That way the programmer is left to code what they like, the artists does what they want and the sound person gets to express themselves as well. Trying to be master of all 3 "arts" is going to be difficult at best. maybe a maximal 16kbits and very basic routine would be possible on dsp without using the bus that much and if, it would be unbelivable helpfull on new games If you use something like MAD as a basis for your MP3 CODEC then you'll still have plenty of tables in RAM. If you can't fit the whole algorithm in the DSP's local RAM you'll have to break it down even further and page code in and out as necessary. i recive my skunk these days and will give it a try I look forward to seeing your progress. 2 Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted February 25, 2013 Share Posted February 25, 2013 The idea is to open much more sources of sounds for jag... millions of sound/samples out there are mp3/ogg and mods are really hard to create with old tools or without musik knowledge and and and... maybe a maximal 16kbits and very basic routine would be possible on dsp without using the bus that much and if, it would be unbelivable helpfull on new games Any music creation is difficult without knowledge or a gift for it, I know that only too well :-) Something like adpcm allows for 4:1 compression and is pretty resource light, compare that to mp3 @ 128kbps, something like 3 times smaller files but a huge disparity when it comes to decoding resources required. I have no idea what 16kbps .mp3 would sound like, but I think I'm scared to find out The Jaguar only has 2mb of memory and limited cart space if that's the kind of game you're making, so there are only certain types of game that would suit adpcm audio. I think .mod music is a nicely balanced trade-off between size in memory and replay resource requirements and there are 100s of mod musicians out there and quite a large library of existing mods that many authors are only too happy to let you use if you ask nicely :-) I remember NoCrew made an MP2 player for the Falcon, I don't know anything about the format or compression ratios, but maybe you could look at how easy that might be to implement? Or would that go against your idea of opening up a large library of free sounds to game makers? It'd only be a few clicks to convert files. i recive my skunk these days and will give it a try Have fun and good luck 2 Quote Link to comment Share on other sites More sharing options...
Otto1980 Posted February 25, 2013 Author Share Posted February 25, 2013 (edited) < Edited February 25, 2013 by Otto1980 Quote Link to comment Share on other sites More sharing options...
GT Turbo Posted February 25, 2013 Share Posted February 25, 2013 I remember NoCrew made an MP2 player for the Falcon, I don't know anything about the format or compression ratios, but maybe you could look at how easy that might be to implement? Or would that go against your idea of opening up a large library of free sounds to game makers? It'd only be a few clicks to convert files. Have fun and good luck I think it's a Falcon's DSP code, this DSP is most powerful than the Jag one... A pain in the ass to port. GT Quote Link to comment Share on other sites More sharing options...
sh3-rg Posted February 25, 2013 Share Posted February 25, 2013 I think it's a Falcon's DSP code, this DSP is most powerful than the Jag one... A pain in the ass to port. Of course, the Falcon has a real DSP. I wasn't suggesting he attempt to port the Falcon one, only that.mp2 might be more suitable for what he intends to do (although anything at all like that seems rather unsuitable for the Jaguar anyway, but...) Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted February 25, 2013 Share Posted February 25, 2013 I don't think MP2 is possible on the Jaguar DSP, but I may be wrong. MP3 is right out, since even the Falcon's DSP is not powerful enough to decode in real time (and as GT Turbo's said, it is more powerful than the Jaguar's DSP) ; MP3 players on the Falcon use both the DSP and the 68030. And at 16 kbps, even MP3 sounds horrible... I think it's possible to run a frequency domain-based codec on the DSP (I wrote some Fast Fourier Transform code for the DSP a few years ago, and the performance was okay), but it would probably need to be simpler. On the other hand, ADPCM on the DSP has been done and works fine, just ask Orion_ (I don't remember if his decoder was publicly released or not, but he definitely used it in his games) 4 Quote Link to comment Share on other sites More sharing options...
Matthias Posted February 25, 2013 Share Posted February 25, 2013 Hello! Hi all, ever someone tryed to code a simple ogg/mp3 sound engine on the jag? I can remember that Bastian Schick (who gave us BLL for Lynx and BJL for Jaguar) forwarded an OggVorbis-player to me several years ago, i think he mentioned that that format required less resources than MP3. Kind regards Matthias 3 Quote Link to comment Share on other sites More sharing options...
Otto1980 Posted February 25, 2013 Author Share Posted February 25, 2013 (edited) yes seems ogg doesnt need that much performance as mp3 it has simplyer routine around 40 kb/s would be a really great result for jag (i tested different ogg kb/s quality and from 38 on it sounds okay) how ever.. i will mess around with that stuff @Matthias: do you have anyting of this oggplayer you wrote or can you ask for it? Edited February 25, 2013 by Otto1980 3 Quote Link to comment Share on other sites More sharing options...
Chilly Willy Posted February 26, 2013 Share Posted February 26, 2013 I was able to get Tremor working on the SH2 in the 32X for mono sound up to 48kbps. Better than that would be possible, but was more assembly than I was willing to do at the time. I recommend either the lowmem branch of Tremor, or SirenAC (g722.1) as both have fairly low resource requirements. 3 Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted February 27, 2013 Share Posted February 27, 2013 Interesting. But the bitrate seems quite low... How good does it sound? Quote Link to comment Share on other sites More sharing options...
Chilly Willy Posted February 27, 2013 Share Posted February 27, 2013 Better than the equivalent ADPCM compressed sound. Ogg has gotten VERY good at really low bitrates, and SirenAC was designed from the get-go for ultra-low bitrates. SirenAC is mono, though - even their "stereo" setting is actually pseudo-stereo. For my experiment, I actually did two custom formats: in one, I just encoded each channel as separate g722.1 mono streams mixed together; in the other, I took the sum channel and encoded that at one rate, then took the difference channel and encoded at a lower bitrate. That second one worked pretty well on the 32X. I posted various Ogg demos for the 32X over at Sega-16. This is one of those things I'd probably work on for the Jag if I had more spare time. 5 Quote Link to comment Share on other sites More sharing options...
Otto1980 Posted February 28, 2013 Author Share Posted February 28, 2013 (edited) why not keep focus on ogg (all coders together) its a compromise and an advance by using uptodate-tools (converting sounds, mp3 etc.) also lot availability of free sounds out there and finaly the result could be merged with some existing soundengine in a library available for all coders.. that would be like worldpeace for jag coders got my skunk now for a day.. setting up env hardware (big 16:9 TV, Jag, PC) took a look at helloworld but i dont like the mix of C and asm :-( took also a look at u-235 but i dont like the use of the old tools now i having my trouble scanning all the tools out there for functionality on uptodate windows machine (win8 eg.) long way till i make any progress.. but will Edited February 28, 2013 by Otto1980 Quote Link to comment Share on other sites More sharing options...
Zerosquare Posted February 28, 2013 Share Posted February 28, 2013 Chilly Will : can you give the URL to the Sega-16 topic please? Quote Link to comment Share on other sites More sharing options...
+CyranoJ Posted February 28, 2013 Share Posted February 28, 2013 took also a look at u-235 but i dont like the use of the old tools You don't need to use them, just link the .o file and you are done. 1 Quote Link to comment Share on other sites More sharing options...
Chilly Willy Posted February 28, 2013 Share Posted February 28, 2013 Chilly Will : can you give the URL to the Sega-16 topic please? How about the files? That's all that matters at the moment. http://www.mediafire.com/download.php?f77xoxoyd9tww0d http://www.mediafire.com/download.php?9acgq3givvi8kvd The first link was the last compile I did, but doesn't have the Tremor lib since that didn't change. The second link is a little older, but has the Tremor code as well. Both compiles use low bitrate mono tracks from Dark Side of Phobos. They are playable on a real 32X with a flash cart, or Gens/GS r7 with my DMA PWM code changes, or Fusion 3.64 (supposedly - I've never been able to get the sound to work on my computer in 3.64, so I use 3.63 which doesn't play DMA PWM correctly). I think it sounds best on real hardware. 3 Quote Link to comment Share on other sites More sharing options...
Chilly Willy Posted February 28, 2013 Share Posted February 28, 2013 Oh, here's the libs that go with that first arc - this has Tremor, and the two memory allocator libs I use in the demo. http://www.mediafire.com/download.php?owe4vcpu8c2kftd 3 Quote Link to comment Share on other sites More sharing options...
LinkoVitch Posted February 28, 2013 Share Posted February 28, 2013 IMHO I think the power of the Jag's sound will come more from synthesis of sounds. If done well, this would pretty much get the DSP off the bus for a large portion of the time and give clean 16bit high frequency audio out. Granted this isn't going to work well for speech, and probably a lot of sound effects, but a blend of synth and sample should allow for some good sound. You need to look at what you are trying to achieve, and then see what options you have for solving that requirement and then whittle those down to what is possible. I don't think there is much benefit to having 16bit stereo Ogg/MP3 audio for say an explosion or some speech, an 8bit mono sample would probably sound fine and give you greater flexibility in terms of CPU and system resources. If you are wanting to use streamed music then at this moment CD is really the best choice, MP3/Ogg are just too large to hold on cart (you could probably get 1 3-4 minute track). Unless you want to start looking at perhaps building custom cart hardware to provide increased storage and possibly offload some of the processing.. RE the U235 SE.. as CJ said, you only need to link in the .obj file, you can use SMAC/SLN if you like. Myself I use MAC/ALN under Dosbox (I run Windows 7), but that doesn't mean that you have to. Good luck with your coding adventures. 5 Quote Link to comment Share on other sites More sharing options...
Christos Posted March 2, 2013 Share Posted March 2, 2013 I don't think MP2 is possible on the Jaguar DSP, but I may be wrong. MP3 is right out, since even the Falcon's DSP is not powerful enough to decode in real time (and as GT Turbo's said, it is more powerful than the Jaguar's DSP) ; MP3 players on the Falcon use both the DSP and the 68030. MP2 is about twice the size of an MP3. The track in the falcon demo Beams is an MP2 @ 32KHz and it sounds OK. The falcon can play a 64KBps MP3 with about 5% cpu usage but I guess that's because of resampling. It should be OK if you have a 44.1KHz clock on the DSP. 2 Quote Link to comment Share on other sites More sharing options...
Chilly Willy Posted March 2, 2013 Share Posted March 2, 2013 Yeah, I've had better luck with libmad on the 32X than any mp2 decoder. In any case, I think the main issues are code size and buffers - the lowmem branch of Tremor is perhaps the most efficient codec I've run across, and you're looking at about 400KB of code on a very space-efficient ISA, and it requires 48KB of ram for buffers, mainly codebooks. The SH2 has an actual cache, not just local ram, which helps with code and data on a slow bus. The DSP doesn't have this, so I think you'd spend more time trying to efficiently handle this by hand than in actually porting the codec itself. One thing I was wondering about - those rules for running the JRISC from main ram... does that apply to the DSP as well as the GPU, or is it only the GPU? The majority of the time spent in most codecs of this type is spent in the MDCT routines. In Tremor, the next biggest time is spent unpacking the codebooks - which is something I wanted to mention as well: Vorbis gets a lot of its quality by using floating point in the codebooks. When xiph worked on an integer based codec, they originally tried using fixed point numbers for those, but the loss of quality was too big, so what Tremor does currently is to unpack the floats into separate exponents and mantissas, then perform very limited software floating point until a point is reached where fixed point numbers are fine. This part of Tremor would is targeted for assembly on most platforms. While I didn't redo that whole section as assembly for the SH2, I did do a number of optimizations to the C that I knew would result in better code on the SH2 (mostly related to the shifts in the normalization code). When I get more time, I'll probably do the whole thing over as asm - better speed there would allow for higher bitrates as higher bitrates mean more codebook unpacking. On the subject of codecs in general, I was playing with Opus the other day. If you aren't familiar with Opus, it's SILK from Skype crammed together with CELT from xiph, and then optimized and extended. It gives INCREDIBLE results at extremely low bitrates. I'll probably try to make a port for the 32X. 3 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.