libretro / vice-libretro

Versatile Commodore 8-bit Emulator
GNU General Public License v2.0
40 stars 70 forks source link

Datasette volume not changeable ? #378

Closed zzedmore closed 3 years ago

zzedmore commented 3 years ago

Hi, I tried the new Datasette sound (on a Pi 400) but the percentage you choose doesn't seem to make any difference. 5% sounds loud, and the same as 40% etc. I also couldn't hear any loading music while it was switched on.

sonninnos commented 3 years ago

It works perfectly fine, with loading music and all, with ReSID, but apparently not with FastSID. FastSID is not even available by default in the standalone anymore, which means that this will never be fixed here either.

Which means I'll be closing this. I'm pretty sure RPis have enough juice for proper ReSID quality.

zzedmore commented 3 years ago

My Pi is already set to ReSID and 'Resampling' audio. The Datasette Sound is just one loud volume and cannot be lowered or raised. Also happens with x64sc.

What's weird is that if I use FastSID then I get no Datasette sound, but when the loading music starts playing I can hear the datasette sound or some white noise ? If I try to raise or lower the volume in the core options then go back to emulation it crashes.

EDIT: That FastSID Datasette sound bug also seems to happen on Windows. No datasette sound until the loading music plays.

sonninnos commented 3 years ago

Hmm, I just tried with RPi2 and indeed something is weird. 5% is full blast, 10% less loud, 15% less loud, 20% full blast, etc, which makes no sense.. and indeed FastSID just crashes. Something funky with the volume value range then.

I don't think we can do much about FastSID, but volume surely can't act that way.

Edit: Yep, on RPi2 the valid range is 0-100, but on desktop it is nowhere enough, and it needs to be on the same amounts as floppy drive sound volume.. Standalone does not have the volume option, but the volume is 1024 by default.

sonninnos commented 3 years ago

Phew, finally found the reason for the randomness: The classic ARM default unsigned vs signed char when not explicitly stated. So simply forcing this variable to signed did the trick.

-static char datasette_square_sign = 1;
+static signed char datasette_square_sign = 1;

I also fixed the audio mixing so that SID quality stays the same when Datasette sound is enabled, and added a bonus option for muting SID while the tape is playing at max volume. Will be included in the next batch.

zzedmore commented 3 years ago

Nice one!