Page 1 of 4

XRoar and sound

Posted: Thu Nov 09, 2017 8:37 pm
by pser1
Hi Ciaran,
I have found that after issuing any sound command:
SOUND120,3 or PLAY"CDEFG"
If you minimize the XRoar, or open it again or simply moving it around, a low freq. noise is produced
This doesn't happen before sound/play commands so it is related to the sound emulation.
This happens emulating Dragon-Tano-CoCo and probably the others too.

Testing with older versions, I have found that all of them have the problem untill I got this one
XRoar v0.34.8 snapshot 2017-36436
This is the 'last' one that doesn't suffer this problem.
Maybe you could give them a peek and find out what is causing this behaviour ...
Thanks in advance
cheers
pere

EDIT: Sorry, forgot to say that this happens on a Windows 7

Re: XRoar and sound

Posted: Sun Dec 03, 2017 12:28 am
by pser1
HI,
I have just downloaded snapshot 49442 and tested windows 64bits
The old configurations that produce sound with old snapshots (41907),
don't produce any sound with this new snapshot
Should we change any parameters?
A simple basic command as SOUND150,3 outputs no sound at all
Same with PLAY"CDEFG", no sound is output ...
thanks in advance
pere

Re: XRoar and sound

Posted: Sun Dec 03, 2017 12:42 am
by pser1
for maybe it could help, I attach here the debug windows of both snapshots
The last one fails lading the SDL2 audio ...
regards
pere
OldSnapshot-small.jpg
OldSnapshot-small.jpg (56.52 KiB) Viewed 5077 times
NewSnapshot-small.jpg
NewSnapshot-small.jpg (55.71 KiB) Viewed 5077 times

Re: XRoar and sound

Posted: Sun Dec 03, 2017 10:42 am
by sixxie
Oh now that's interesting. Ron Klein also had issues with sound in recent source, but he was building directly on Windows using MSYS. I'll see what I can see...

The weird thing is I've not actually changed the sound code ;)

But I probably have updated SDL2 locally, so that seems like a good place to start looking!

(Ugh, sound works fine under Wine locally. This might be tricky to debug :/ )

Edit: ok first off, I've updated SDL2 to 2.0.7 - can you try the 2017-49577 snapshot build? Again, works ok locally, so no really good test I can do...

Re: XRoar and sound

Posted: Sun Dec 03, 2017 3:23 pm
by pser1
Hi Ciaran,
sorry for the delay ...
I have downloaded and tested it.
Same ehaviour that previous snapshot
cheers
pere
newSnapshot-small.jpg
newSnapshot-small.jpg (58.92 KiB) Viewed 5065 times

Re: XRoar and sound

Posted: Sun Dec 03, 2017 5:00 pm
by sixxie
Thank you for all the testing here...

Ok, in 2017-49598 that warning is a bit more informative - it definitely still won't work, but let's see what audio format is actually failing here. It *should* be defaulting to the native signed 16-bit format.

Also, as a workaround, maybe try "-ao-format s16" or "-ao-format u8".

Re: XRoar and sound

Posted: Sun Dec 03, 2017 5:35 pm
by pser1
Hello,
not good luck
Atached is the debug window.
None of the two possible workarounds do generate sound
regards
pere
lastSnap-small.jpg
lastSnap-small.jpg (57.24 KiB) Viewed 5059 times

Re: XRoar and sound

Posted: Sun Dec 03, 2017 7:20 pm
by sixxie
Ok... 0x8120 means floating point audio. XRoar is requesting 16-bit signed native-endian by default, and is being told to use floating point. Interesting! I wonder why that has started happening...

So the core already supported floating point, I've hacked in support to the SDL driver. See how 2017-49609 goes?

Re: XRoar and sound

Posted: Sun Dec 03, 2017 10:41 pm
by pser1
Hello,
now it outputs sound, but awfully
sound has spikes and when no sound commands is entered the output is making
randomly low frq noise
kind regards
pere

Re: XRoar and sound

Posted: Sun Dec 03, 2017 11:07 pm
by Alastair
Pere,
have you tested both the 32-bit and 64-bit versions of XRoar? I'm using 32-bit Windows so I cannot try 64-bit XRoar, however none of the 32-bit XRoar versions that I have tried has failed to produce sound so it may be a problem specific to 64-bit XRoar.