Menu

#553 Loading record_channels generated cassette games not working

Next_release
open
nobody
None
5
2014-09-08
2014-09-07
No

Not sure this is a bug... but I think it should work. The idea was to load a cas file while recording it's output to a .WAV with record_channel command. The generated .WAV file does not load correctly. I've tried with many .cas files and talked about it at the MSX IRC channel. They suggested me to open this ticket.

How to reproduce:

  1. Turn autorun off > set autoruncassettes off
  2. Record cassette player output > record_channels cassetteplayer -prefix myfile
  3. Insert the cass file > cassetteplayer insert myfile.cas
  4. Load the game: RUN"CAS:
  5. Wait until the game shows up
  6. Stop recording > record_channels stop
  7. Stop machine > set power off
  8. Start machine > set power on
  9. Load .WAV file > casseteplayer insert myfile_whatever.wav
  10. Load the game: RUN"CAS:
  11. It won't work.

Thanks.

Related

Bugs (DISABLED): #553

Discussion

  • Wouter Vermaelen

    Hi, thanks for your report. This is indeed something you could expect to work. Unfortunately it doesn't for the following reason:

    The cassette player code actually deals with two cassette data streams:

    • one that goes to the emulated MSX
    • one that is used as audio
      The former must be perfectly synchronized with the emulated machine, the latter must preferably be synchronized with the host time. In ideal circumstances both are the same because the emulator-time is 100% in sync with the host time. But in case you set the emulator speed to something else than 100% or in case the host machine is too slow (or there is a spike in CPU usage, maybe of another application) it's not always 100% the case.

    I don't remember all the details (it's been many years since I wrote this code). But I see comments in the source that that say we get better cassette player sound quality when we don't re-synchronize the above two streams too often. So in the current implementation the first stream is exact, but the audible stream is only a good approximation.

    I'm sure this is a solvable problem. Though for me personally this has low priority. But maybe you can convince me to give this higher priority if you can give a useful scenario where you'd like to use this?

     
    • Maarten ter Huurne

      I think there is more going on than slightly inaccurate sound generation.

      I reproduced the commands that Francesc posted and it seems all bytes are
      correct except the last two before each pause (when the motor is turned
      off). And when I replace step 4 by the "motor on" command instead of
      actually loading, the conversion works perfectly.

      I think the problem might be that when the motor is turned off, the audio
      stream is cut off at the consumer side. So no more audio is delivered, even
      if there is still some buffered audio. I think the audio should be cut off
      at the producer side instead: that way no new samples are generated, but the
      ones already buffered are still played.

       
      • Francesc Vendrell

        Thanks for your answers.

        First of all let me say that openMSX it's an amazing piece of software and
        that I'm honored to talk to both of you. Thanks for your amazing talents
        and efforts to make this project a reality.

        So... I've been playing around with my real MSX machines and openMSX
        emulator trying to discover all it's features and squeeze the most out of
        it. So far so good!

        Then it came to my mind the idea of converting .CAS files to .WAV. I wanted
        to copy the .WAV audio file to a cassette tape and see if It worked on a
        real MSX1 machine (with no disk drive). Just for the fun of it... but it
        could also be useful for people with no other way of loading games to a
        real MSX machine than through the cassette player port.

        I tried it and it didn't work. I played with the output volumes, I tried
        with the "soundlog" command and other stuff with no luck. Then I searched
        the net wondering if nobody had ever had the same need, and indeed, some
        people did. I found similar projects like this ones:

        Searching the net I found some old projects

        On Mon, Sep 8, 2014 at 9:11 PM, Maarten ter Huurne mthuurne@users.sf.net
        wrote:

        I think there is more going on than slightly inaccurate sound generation.

        I reproduced the commands that Francesc posted and it seems all bytes are
        correct except the last two before each pause (when the motor is turned
        off). And when I replace step 4 by the "motor on" command instead of
        actually loading, the conversion works perfectly.

        I think the problem might be that when the motor is turned off, the audio
        stream is cut off at the consumer side. So no more audio is delivered,
        even
        if there is still some buffered audio. I think the audio should be cut off
        at the producer side instead: that way no new samples are generated, but
        the
        ones already buffered are still played.


        Status: open
        Group: Next_release
        Created: Sun Sep 07, 2014 11:52 AM UTC by Francesc Vendrell
        Last Updated: Mon Sep 08, 2014 06:34 PM UTC
        Owner: nobody

        Not sure this is a bug... but I think it should work. The idea was to load
        a cas file while recording it's output to a .WAV with record_channel
        command. The generated .WAV file does not load correctly. I've tried with
        many .cas files and talked about it at the MSX IRC channel. They suggested
        me to open this ticket.

        How to reproduce:

        1. Turn autorun off > set autoruncassettes off
        2. Record cassette player output > record_channels cassetteplayer
          -prefix myfile
        3. Insert the cass file > cassetteplayer insert myfile.cas
        4. Load the game: RUN"CAS:
        5. Wait until the game shows up
        6. Stop recording > record_channels stop
        7. Stop machine > set power off
        8. Start machine > set power on
        9. Load .WAV file > casseteplayer insert myfile_whatever.wav
        10. Load the game: RUN"CAS:
        11. It won't work.

        Thanks.

        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/openmsx/bugs/553/

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/

         

        Related

        Bugs (DISABLED): #553

        • Francesc Vendrell

          Ups... my email was sent while I was trying to copy-paste some urls. sorry.
          The projects:

          http://www.finnov.net/~wierzbowsky/caslink.htm
          http://www.finnov.net/~wierzbowsky/caslink2.htm
          http://home.kabelfoon.nl/~vincentd/

          I've tried Maarten suggestion and it does work, which is great! So
          apparently sound synchronization is not an issue...but I really liked the
          explanation. Thanks.

          Sorry for the long email... I am quite exited to talk to you both and to
          have it working!

          Good night.

          Francesc.

          On Mon, Sep 8, 2014 at 10:47 PM, Francesc Vendrell xescoo@gmail.com wrote:

          Thanks for your answers.

          First of all let me say that openMSX it's an amazing piece of software and
          that I'm honored to talk to both of you. Thanks for your amazing talents
          and efforts to make this project a reality.

          So... I've been playing around with my real MSX machines and openMSX
          emulator trying to discover all it's features and squeeze the most out of
          it. So far so good!

          Then it came to my mind the idea of converting .CAS files to .WAV. I
          wanted to copy the .WAV audio file to a cassette tape and see if It worked
          on a real MSX1 machine (with no disk drive). Just for the fun of it... but
          it could also be useful for people with no other way of loading games to a
          real MSX machine than through the cassette player port.

          I tried it and it didn't work. I played with the output volumes, I tried
          with the "soundlog" command and other stuff with no luck. Then I searched
          the net wondering if nobody had ever had the same need, and indeed, some
          people did. I found similar projects like this ones:

          Searching the net I found some old projects

          On Mon, Sep 8, 2014 at 9:11 PM, Maarten ter Huurne mthuurne@users.sf.net
          wrote:

          I think there is more going on than slightly inaccurate sound generation.

          I reproduced the commands that Francesc posted and it seems all bytes are
          correct except the last two before each pause (when the motor is turned
          off). And when I replace step 4 by the "motor on" command instead of
          actually loading, the conversion works perfectly.

          I think the problem might be that when the motor is turned off, the audio
          stream is cut off at the consumer side. So no more audio is delivered,
          even
          if there is still some buffered audio. I think the audio should be cut
          off
          at the producer side instead: that way no new samples are generated, but
          the
          ones already buffered are still played.


          Status: open
          Group: Next_release
          Created: Sun Sep 07, 2014 11:52 AM UTC by Francesc Vendrell
          Last Updated: Mon Sep 08, 2014 06:34 PM UTC
          Owner: nobody

          Not sure this is a bug... but I think it should work. The idea was to
          load a cas file while recording it's output to a .WAV with record_channel
          command. The generated .WAV file does not load correctly. I've tried with
          many .cas files and talked about it at the MSX IRC channel. They suggested
          me to open this ticket.

          How to reproduce:

          1. Turn autorun off > set autoruncassettes off
          2. Record cassette player output > record_channels cassetteplayer
            -prefix myfile
          3. Insert the cass file > cassetteplayer insert myfile.cas
          4. Load the game: RUN"CAS:
          5. Wait until the game shows up
          6. Stop recording > record_channels stop
          7. Stop machine > set power off
          8. Start machine > set power on
          9. Load .WAV file > casseteplayer insert myfile_whatever.wav
          10. Load the game: RUN"CAS:
          11. It won't work.

          Thanks.

          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/openmsx/bugs/553/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Bugs (DISABLED): #553

MongoDB Logo MongoDB