Why not a ".TSX" Format for MSX Tapes???

Page 3/12
1 | 2 | | 4 | 5 | 6 | 7 | 8

By wouter_

Champion (384)

wouter_'s picture

11-06-2014, 00:09

jltursan wrote:

I'm lost here. An 8bits-8000Hz-mono WAV is about 1,4MB uncompressed. Even packed can't be compared with a TZX file, usually they're not bigger than 50KB oO

Sorry, I wasn't clear (but I also didn't want to repeat everything I already said in this thread last year). When you compare (g)zipped WAV files with the corresponding CAS file, the file size difference is only a factor 2x-3x ('clean' cassette WAV files compress _very_ well). So that's only a few dozen kBs (I assume TZX is roughly comparable in file size to CAS).
And openMSX can work directly with WAV.gz and WAV.zip files.

By saccopharynx

Expert (94)

saccopharynx's picture

11-06-2014, 02:30

This thread resembles the discussion we are having here: http://www.msx.org/downloads/dsk-pro-520

Basically, we debate about the creation of a new format when there is actually one that is fully (or almost fully) sufficient:

1. DMK & PDI (for floppy images)
2. WAV & TZX (for tapes)

In my opinion, openMSX developers are right and it does not make much sense to add support to a new format that it is not popular and does not bring significant advantages in comparison to those currently in use. I am not saying that it is useless or a bad idea, but is the development effort worthwhile? Take into account that openMSX is not maintained by a battalion (in sense of the number of people).

S.

By AlesteDX

Resident (53)

AlesteDX's picture

11-06-2014, 13:54

wouter_ wrote:

And if you do want to help emulator developers (openMSX or other) make progress on this front, it would be useful if you could point us to a good open source tool that can convert TZX back to WAV. Because something like this is needed internally in the emulator.

For example, PlayTZX from Tomaz Kac (ftp://ftp.worldofspectrum.org/pub/sinclair/tools/pc/playtzx.zip) a tool from a few with source code avalaible.

wouter_ wrote:

Sorry, I wasn't clear (but I also didn't want to repeat everything I already said in this thread last year). When you compare (g)zipped WAV files with the corresponding CAS file, the file size difference is only a factor 2x-3x ('clean' cassette WAV files compress _very_ well). So that's only a few dozen kBs (I assume TZX is roughly comparable in file size to CAS).

A 'clean' Wav, so on the extraction you must do additional work to reduce size. With the proper tool, you can make a TSX file in one step, as it only stores real data (as it does CAS format). Wav is a digital representation of an analogue media that contains digital data, so it's redundant and imperfect for preservation purposes.

I agree that it's not worth implementing a new format before that format becomes popular. What I want is to make popular that format. Later it will be time to add support for it on emulators.
But for it to become popular, we need proper tools to create and handle its files. And there is where we can take advantage of all work that has been done on other systems.

Of course, I'm not asking you to develop those tools, but I hope someone, not necessary from OpenMSX team, can do it.

Regards.

By NYYRIKKI

Enlighted (4763)

NYYRIKKI's picture

11-06-2014, 15:26

Indeed CAS-files are very bad way of storing cassette data. It does not even make difference between long header and short header not to talk about empty space between data blocks and headers (Some games may leave motor on while moving graphics to screen or do something else) This makes it quite unreliable format to convert back to WAV and almost certainly the WAV will have different length than original game had. This is also why I think it is not good idea to take the "detour" to convert CAS back to WAV in emulator. This conversion can not be perfect and even if the CAS-file works when emulator patches the BIOS-routines (the original way CAS-files were meant to be used) it may fail after going trough WAV-conversion because of these timing problems.

CAS-files were very bad idea from the start and WAV-files are just clever trick to overcome the limitations of CAS-files. WAV-files are good at storing audio, but long way from optimal for this kind of use. WAV-files are "perfect" copy of pretty much everything on tape. This includes also all the analog noise and such that is not needed or wanted and makes compressing of the files very ineffective. If you load such a file in emulator and then save again as WAV-file then it compresses a lot better... (Maybe someone could make a tool to "clean" analog WAV-files for MSX?) In WAV-file we typically store 16bits while 1bit representation would be needed = 16x too big file automatically.

Something like suggested TSX-file would be "the right thing to do", but is there enough will to improve cassette routines and implement a totally new file format in to MSX-emulation world... I don't know... How ever I would like to vote: YES, please fix this very old problem properly... but no need for high priority. We have seen such improvements lately in disk emulation, so why not for cassettes as well?

By Manuel

Ascended (13554)

Manuel's picture

11-06-2014, 18:02

If TSX files are getting popular, I think we (openMSX team) will definitely look at the provided code to convert TSX back to WAV and use that to load TSX files in openMSX.

Note: CAS to WAV is a perfect conversion, if the CAS file was a good representation of the original audio. If not, it will just be as bad as using the CAS file directly.

By wouter_

Champion (384)

wouter_'s picture

11-06-2014, 18:55

NYYRIKKI wrote:

... even if the CAS-file works when emulator patches the BIOS-routines (the original way CAS-files were meant to be used) it may fail after going trough WAV-conversion because of these timing problems.

You're right, good point. Though we haven't yet seen any examples of such CAS files.

NYYRIKKI wrote:

... WAV-files are good at storing audio, but long way from optimal for this kind of use. WAV-files are "perfect" copy of pretty much everything on tape. This includes also all the analog noise and such that is not needed or wanted and makes compressing of the files very ineffective. If you load such a file in emulator and then save again as WAV-file then it compresses a lot better... (Maybe someone could make a tool to "clean" analog WAV-files for MSX?) In WAV-file we typically store 16bits while 1bit representation would be needed = 16x too big file automatically.

Note that I'm not proposing plain .WAV as an alternative for .TZX but _clean_ _compressed_ WAV. That is a WAV file with only two possible values for the signal. So that is indeed a redundant file format (as you say 16 bits instead of 1), but after compression almost all this redundancy disappears! It almost doesn't matter whether you start from a 8-bit or 16-bit, stereo or mono, 8kHz or 44kHz WAV, after compression you end up with WAV.gz files of all about the same size (only a couple of kilobytes difference)!

Of course the WAV file has to be clean for this compression to work so well, and indeed you need to make a tool to clean them. But such a tool is very easy to make, and _MUCH_ easier than a tool to convert WAV to TZX. Existing WAV editors can probably already do the job, but a dedicated tool might be more convenient.

NYYRIKKI wrote:

Something like suggested TSX-file would be "the right thing to do", ...

To anyone who suggests using TZX: please take a detailed look at the TZX specification and at the example code required to decode such files. I did that last night, and now I'm even more convinced TZX is NOT the way to go! It's a very complex beast! And that 2000+ lines of code decoder program cannot even handle the latest version of the spec. I'm sure such a decoder can be written in a cleaner way, but it will always remain orders of magnitude more complex than a simple WAV.

So to repeat/summarize my position:
- TZX is very complex
- TZX has no technical advantage over WAV
- TZX has a file size advantage over WAV.gz, but we're only talking about 10s of kilobytes
- AFAIK (correct me if I'm wrong) there are no existing tools to convert MSX cassette dumps to TZX
- With WAV.gz you have a working solution today with lots of existing tools to manipulate WAV(.gz) files

So I'd discourage anyone from working on TZX for MSX (I hope I was able to convince you why). But, as I said before, if for some strange reason TZX does become popular on MSX we may still add support for it in openMSX.

By Grauw

Enlighted (6405)

Grauw's picture

11-06-2014, 21:58

Wav is also exactly how cassette tapes actually work on an MSX. I can connect my Mac’s audio out to my MSX, take a wav image file of some cassette game, play it back in any software I want, and it will work on my MSX.

Also vice versa, all I need to image a cassette tape is connect a cassette deck to my Mac’s line input, and record using whatever tool I want.

Cas and tzx however require special-purpose tools to do this… It’s more complicated without a good reason for it I think.

Actually now that I think of it, it may even be a pretty good alternative to Nowind or RS232-based loading. I guess now I understand why WAVer is popular! :)

By DrWh0

Hero (570)

DrWh0's picture

11-06-2014, 22:25

For people that doesn´t know anything about TZX format and wants to knows why we should use it and understand better why where talking about it:

http://www.worldofspectrum.org/TZXformat.html

Easy solution to convert wav to tzx format an viceversa:

http://www.retroisle.com/sinclair/zxspectrum/software.php (use maketzx and playtzx)

Official page of maketzx (with the source code of version 1.02)

http://ramsoft.bbk.org.omegahg.com/maketzx.html

By the way, Amstrad & Commodore (64VOCTZX for example) users are using tzx too for perfect preservation, why? ;)

P.D.:

I am only showing you the reasons why some of us are pointing to use TZX format style (for sake of exact preservation purpose)

By Grauw

Enlighted (6405)

Grauw's picture

12-06-2014, 00:53

But I have a Mac! So there’s the first problem with maketzx: there is no Mac version.

And what if I want to record files on a mobile device? Connecting a phone to your MSX as a tape-recorder replacement makes a lot of sense. Rather than simple and common audio recording and playback tools, which directly matches the original (audio stream-based) medium, tzx needs special-purpose tools not available on all platforms.

Also if I look at the MakeTZX feature list, it seems like a complicated piece of technology. Source code for recent versions is not available, so there seems to be a large dependency on a closed-source piece of software to generate these tzx files, last updated 11 years ago, which is not easy to replicate due to the afore mentioned complexity. Also I see a UI with a lot of options I do not understand, I get lost looking at it already. Compare to the big red RECORD and PLAY buttons on an audio recorder program.

I don’t understand the “exact preservation purpose” argument. Wav is a digital format, it does not deteriorate over time, and preserves the original data in great detail. With tzx I just see unnecessary extra steps, and dependencies on a small number of conversion tools on a limited set of platforms.

If new tools are being developed, I think the effort is better spent on a wav clean-up tool which just outputs the cleaned-up wave in a zip file rather than locking you into an unnecessary new format.

By NYYRIKKI

Enlighted (4763)

NYYRIKKI's picture

12-06-2014, 09:41

Manuel wrote:

Note: CAS to WAV is a perfect conversion, if the CAS file was a good representation of the original audio. If not, it will just be as bad as using the CAS file directly.

No, it is not and it can't be... As I explained, there is simply not enough information available. It is very easy to create a WAV-file that can be loaded on OpenMSX and real MSX. You can convert it to CAS-file and load it on fMSX, but you can't load the CAS-file anymore on OpenMSX. You only need to forget to call "stop motor"-routine while you display your nice animated "I made this, please wait while loading".

I kind of understand your solution as a programmer. Patching ROM's or inserting emulation breakpoints is a big "No, NO!". It sucks a big time but I think you have to understand that CAS-files are not MSX-files. They were not meant to be used as a format to transfer games back to cassette although this kind of solutions have been created afterwards. (Although they can not be perfect) The format was created to be able to play MSX cassette games on emulators and the first emulators defined the format and how it should be used... but now you are reinventing a wheel... It is like if you take a 24fps movie film, do a 3:2 pulldown conversion and put it to VHS tape. Then you take the VHS tape and convert it to DVD before displaying. By doing this you are not removing the artifacts created by original conversion, but instead adding some digital artifacts. Does it matter at that point anymore? Not likely... but it still does not make it better solution compared to displaying the VHS tape directly.

Maybe CAS-files should not be even supported, but you can't get rid of them as they are still the most used cassette format for storing games. If you would not be so stubborn you would listen what users want and add "the normal emulator way" of loading CAS-files... Maybe not as default setting but something that can be turned on if needed... I hope you understand that you can keep your left leg even if you do so. It is not your fault that the emulation world was not trying to be perfect from the start as you are now trying.

Page 3/12
1 | 2 | | 4 | 5 | 6 | 7 | 8
My MSX profile