Menu

#1024 ADSR bug not emulated correctly in 3.2, works with same config in 3.1

v3.2
closed-fixed
nobody
None
x64sc
2018-11-14
2018-07-03
No

This tune: https://csdb.dk/release/?id=165909

Sounds correct in Vice 3.1, but incorrect in Vice 3.2. The same vicerc file is used. In 3.2, two frames of white noise is heard at the attack of every note.

This probably affects many other tunes as well.

My playroutine makes use of double hard-restart. This means that the envelope counters are reset during two frames (ADSR=0000, normal hard-restart), and then the counter is deliberately allowed to escape by switching to a slow rate for a sufficient number of cycles, before switching back to the desired attack rate (which is 0 or 1 in these instruments). On real hardware (and in Vice 3.1), this delays the note onset by a further 1.67 frames, so I can play a very brief burst of white noise in the remaining 0.33 frames. If the counter overflow doesn't work as expected, the white noise plays for the full two frames.

Both versions of Vice were built from source, specifying only --enable-cpuhistory.

Discussion

  • gpz

    gpz - 2018-07-03

    would you please look here: https://sourceforge.net/projects/vice-emu/files/old-versions/

    and try to find the revision that broke it? that would help a lot

    rereading what you wrote... it must have been r34721 that broke it? can you provide a small test case?

     

    Last edit: gpz 2018-07-03
  • Linus Åkesson

    Linus Åkesson - 2018-07-03

    I can confirm that it happened in r34721. It sounds fine in r34720.

     
  • Linus Åkesson

    Linus Åkesson - 2018-07-03

    I have created and attached a small test program.

     
  • Leandro Nini

    Leandro Nini - 2018-07-04

    Thank you for the test! It seems that commenting out line 381 in envelope.h (where state is set to FREEZED) fixes the problem. Not sure why though, probably because rate_period isn't updated on registers write during FREEZE state, will check later.

     
  • Leandro Nini

    Leandro Nini - 2018-07-05

    Confirmed! All envelope tests work now, patch attached.

     
  • gpz

    gpz - 2018-07-08

    applied in r35199 - thanks for the patch!

    please retest :)

     
  • gpz

    gpz - 2018-07-08

    leandro: i noticed that SID/envelope/testADSRDelayBug.prg fails randomly on subsequent runs... cant tell atm if that is because of a bug in the test, or a bug in the emulation - maybe you want to have a look

    edit: that one was easy. fixed it. cheers :)

    i guess we can close this?

     

    Last edit: gpz 2018-07-08
  • gpz

    gpz - 2018-08-06

    "i guess we can close this?" ? :)

     
  • gpz

    gpz - 2018-08-31

    yeah? :)

     
  • Lasse Öörni

    Lasse Öörni - 2018-09-07

    Great to see this fixed, for me the bug manifested as an unwanted sharp HR, when I intentionally wanted a full or "ugly" first frame of sound :)

     
  • gpz

    gpz - 2018-11-14

    no comlaints... closing :)

     
  • gpz

    gpz - 2018-11-14
    • status: open --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB