Open wolfensg opened 7 years ago
@kode54 this issue seems to be valid. I don't have foobar2000 at hand right now (will have next week), would be nice if you can have a look, if it's interesting to you.
The issue is not a regression, just seems that GME can't play these 3 files correctly.
@wolfensg can you provide an example of an app / library that plays these files correctly? We might be able to find the necessary patches.
Sure. ASAP seems to be most compatible with all sap files (there are also sources available):
Although humanoid.sap seems to be working only on an old winamp plug-in I have. But anyway ASAP is the best choice so far. There should be also some more .sap files which seems to be not playing correctly under current implementation provided by the GME plugin but these are the ones I just grabbed as I knew already that they are 'problematic' ones and I had some issues with them before :)
Game_Music_Emu also plays SAP files, but requires Coleco firmware for files targeting that machine.
Why should it require Coleco Vision firmware as it is totally unrelated (totally different machine)?
SAP (in short) is similar to SID format that contains the music data from Atari 8-bit computers (XL/XE series) in the form of either the memory dump from a game/demo or a music in native format (like Chaos Music Composer, CMC format) encapsulated with some player related information and header with some text info about who was the composer, title, etc.
In order to be played in a player it requires the emulation of the MOS 6502C CPU and POKEY chip.
So in short - the SAP is for Atari the same as SID is for C64. There is also a library (inspired by the Commodore's HVSC) called ASMA which contains most of the Atari tunes.
@kode54 you confused it with SGC? I can't seem to find any way to specify a firmware for SAP emu.
Oops, yeah, I guess you're right.
SAP Emu (if requires one) could require the same "firmware" as the ROM for Atari800 emulator:
https://sourceforge.net/projects/atari800/files/ROM/Original%20XL%20ROM/
@wolfensg the problem is that I can't seem to find a way to load any custom ROM into Sap Emu of GME.
@Alexey-Yakovenko any way of switching plugin for SAP emulation from GME to ASAP?
Someone would have to develop a new plugin for ASAP.
btw, I just checked, the provided SAP files behave exactly the same in foobar2000 + foo_gep.
So I guess most of the plugins share outdated sources for SAP emulation :) http://asap.sourceforge.net/ which I've mentioned already contains also the source code but creating new plug-in seems to be far out of scope for DeadBeef.
You just mentioned, that even ASAP can't play Humanoid.sap, so developing a new plugin for fixing playback of one file seems like an overkill... We should first consider fixing GME.
Well, I only gave 3 examples (unfortunately only 2 were valid). Anyway - there are quite a few songs not being played correctly with this GME plugin.
I can give more examples and upload them here but I wonder if this makes sense.
Its not however that GME plugin does not play the files at all but it has some problems in c/a 5% of files (at least from my favourites ;).
Issues include missing samplings, inability to start playback at all, missing playback on one of four generated channels or sound artifacts during playback (high pitched noise on one song which I briefly checked).
I looked a bit into ASAP library, and it looks that such plugin would bring more value than just SAP playback fix, because of the many file formats it supports. I'll consider this for the future (fairly busy with other stuff for now)
Worth mentioning - the ASAP library supports (via SAP container) various Atari native formats like CMC being a song saved in Chaos Music Composer on Atari 8-bit computer.
I've made some research and it seems there are two widely used libraries for providing support for SAP files.
The first one is the one I've mentioned so far and provides nearly 100% accurate emulation (with some minor flaws depending on version of the sources and complete inability to play humanoid.sap file ;) (maybe some other files as well but not really often having much problems)
libSAP has two "widely available" versions: 1.54 and 2.0 Unfortunately version 1.54 is not compatible with GNU PL and cannot be used. Version 2.0 does not include any license thus also... should not be used... To make things even more complex... It seems the sources were removed and available only via... archive.org Also it doesn't help much that players based on libSAP 2.0 works flawlessly ( playing all files correctly, including also humanoid.sap, etc) :(
Example of the player working with libSAP 2.0: SAP player v2.0 - http://asma.atari.org/bin/sap2.zip (Windows)
Source for information on SAP libraries (in this case for compiling DOSSAP): http://dossap.sourceforge.net/index_pl.html
I wasn't able to find any working link to the libSAP source code..
Funny fact. There are couple of SAP tunes which are only possible to be played under ASAP library, the reason is that they utilize the... graphics chip (GTIA) to produce the audio (I know how weird it sounds ;). Atari SAP 1-bit GTIA tunes.zip
Example how it should sound: https://www.youtube.com/watch?v=gqGOjyOWCMs
Information about using GTIA graphics chip to play sound: http://atariage.com/forums/topic/212810-tritone-gtia-beeper-engine/
Sooo... summing up:
The first one has sources available (but would involve some work to prepare the plug-in). The second one (libSAP) does not have sources available (at least not easily google-able).
Current level of SAP support in DeadBeef is quite satisfactory (but I don't know on which sources GME plug-in is based... I could assume that either older ASAP library or older libSAP.
In this case... well... I guess it's a dead-end for better SAP support...
but I don't know on which sources GME plug-in is based... I could assume that either older ASAP library or older libSAP
From what I can see, there are no references to either ASAP or libSAP in GME sources, so I'm assuming it's not derived from them.
(the code looks very different from libASAP too)
Atari SAP support seems to be handled by the port of outdated sources. While using the players based on older sources I've seen issues like the ones with these example files (attached). They either get skipped or only part of the channels are being played.
Issues on older sourecs: Alley Kat.sap - not playable Humanoid.sap - not playable Das Omen Intro.sap - digitalized percussion missing
Zipped sap files.zip