22050 Hz audio on Pandaboard
Jon Abbott (1421) 2651 posts |
Look at the JASPP development site for details on what ADFFS is/does. It’s several things: A 1772 FDC/MEMC/IOC/VIDC/VIDC20 emulator with an ARM3 JIT and a partial hypervisor. I did give a talk about it at ROUGOL earlier in the year, where I went into detail about how it worked. The PowerPoint presentation that went with the talk is on the JASPP site. The thread on the audio stack is here. Forget the filecore.net site, it’s really old and I’ve not managed to get a response from Jason to take it own or get it to redirect to the official JASPP site. |
jim lesurf (2082) 1438 posts |
That’s the closest I found to an actual explanation I could read. (PowerPoint isn’t very useful as I don’t use Windows, so would have to switch to a Linux box to try and read one.) AIUI you’re trying to provide an ‘emulation’ via letting the game or whatever ‘see’ the old SoundDMA/hardware behaviour. However it may be that you need SharedSound in the path if you want it to resample/interpolate, so if you’re bypassing that, you have to do your own resampling. Is that correct? Jim |
Jon Abbott (1421) 2651 posts |
It was only added and released in the past week and I’ve not had a chance to post a further update to the audio thread with a detailed description, so you’ll have to excuse the lack of detail at this time. It’s certainly not covered in the PowerPoint presentation, which covers the 1772/IOC/MEMC/VIDC1/VIDC20 emulation, how ADFFS interacts with RISCOS and how the JIT translates 26bit instructions.
The image in the first post is probably all you need in way of an explanation of how it works, I avoided using SharedSound as it overly complicated things. The only emulation happening is of IOC device 9, which isn’t relevant to the OP, more for legacy games and is only active when games are running under the JIT. What it does do is get the Channel Handlers to fill a back buffer instead of the actual sound buffer, and allow Sound_Configure to be set to sizes/periods that the hardware doesn’t support. When Sound_SampleRate and Sound_Configure are called, ADFFS will proxy the SWI and see what was actually set. It’s level 1 fill which sits between the RISCOS level 1 fill and the Channel Handlers will then make up for the different in buffer size and period when it performs the actual level 1 fill. |
jim lesurf (2082) 1438 posts |
OK, thanks for the info. Because I have a poor memory I can’t recall for sure. (And I’ve never taken any interest in 8-bit sound anyway.) But I’m wondering if SharedSound would have done the resampling for you, whereas bypassing it and going to SoundDMA means you have to DIY resampling. Jim |
Jon Abbott (1421) 2651 posts |
SharedSound wasn’t an option, quoting my first post on that thread:
The resampling is only 11 instructions and handing it off to SharedSound wouldn’t allow me to add an interpolator in the future anyhow. |
David Feugey (2125) 2709 posts |
Probably a dumb idea, but why is it not included in ShareSound (or in the HAL)? |
Jon Abbott (1421) 2651 posts |
8>16bit conversion? From memory, I believe the module includes support for it, but its not coded. |
Mike Freestone (2564) 131 posts |
huh? it’s BSD licensed, at least according to where it is in the risc os open source tree |
Jon Abbott (1421) 2651 posts |
The RO5 version is BSD licensed, the original 26bit version is still copyright ESP so I couldn’t distribute it with ADFFS which pretty much ruled it out as an option. |
Rick Murray (539) 13851 posts |
Could a 26 bit version be backported from the RO5 code? |
Steve Pampling (1551) 8172 posts |
Bit neutral surely? |
David Feugey (2125) 2709 posts |
No. 22>88khZ conversion :) |
Jon Abbott (1421) 2651 posts |
I recently started documenting SharedSound on the Wiki, whilst looking through its source code. Unless I’m mistaken, it should already handle any differences in sample rate. |
David Feugey (2125) 2709 posts |
ShareSound, perhaps, but not the OS. Many existing applications have speed problem with sound (all SDL titles for example). |
Jon Abbott (1421) 2651 posts |
If you shell to the CLI and press CTRL-G is the beep the correct pitch? If not, try loading ADFFS and repeat the process. If it’s still wrong, try “*ADFSoundConfigure” and then CTRL-G I’m trying to figure out where the issue is, it’s still not clear if both 8bit and 16bit are affected. Can you provide a link to an SDL title? I’ll look to see what its doing. |
Jeffrey Lee (213) 6048 posts |
FYI SharedSound is now included in the system resources download. It should work as far back as (at least) RO 3.1, and should softload OK on RO 5/6 too (although I haven’t tested that) |
David Feugey (2125) 2709 posts |
A lot are here: I can’t test them now since my PandaBoard is dedicated to the www.riscos.fr website. I remember that RocksNDiamonds and LBreakout2 did have sound problems.
Great! |
Jon Abbott (1421) 2651 posts |
Whilst browsing to find a copy of the DRenderer module to test RocksNDiamonds, I noted the statement below on the authors site
The version in the ShareUnixLibrary distribution is v0.55 and probably needs updating. What version of DigitalRenderer are you running? Does the audio problem exist with 0.56b8? |
David Feugey (2125) 2709 posts |
I have no way to try it on my Panda now, since it’s dedicated to my web server. I’ll soon have another panda for desktop use. I just can say that there is no sound problem on the Iyonix with DigitalRenderer 0.55. |
Jon Abbott (1421) 2651 posts |
If you can test when your other Panda turns up, that would be grand. I’ve done a fair bit of testing on Iyonix and have seen no issues with any audio that I’ve tried. The issue seems specific to the Panda and is more than likely related to bugs in software, where they’re either not checking that the frequency they’re requesting is valid and when it isn’t, being able to handle the 88k that the Panda offers back. |
David Feugey (2125) 2709 posts |
Yes, that’s exactly the problem. I was just wondering if your software (or over evolutions of RISC OS) could solve this problem… |
Jon Abbott (1421) 2651 posts |
ADFFS can fix 8bit audio, anything that uses SharedSound will need the original source correcting as its a bug in the code. DRenderer obviously had an issue, which was fixed in the latest release and may explain why UnixLib games all exhibit the problem. |
Jeffrey Lee (213) 6048 posts |
Here’s a summary of things from my point of view:
So any remaining problems are likely to be down to games/software asking the OS for a certain sample rate and then not adapting correctly to the rate which they’re given. Whether the correct course of action is to fix the games or add extra oversampling support to the OS is still open for discussion (2x and 4x linear interpolation is certainly easy to support, but there will have to be some improvements made to DMA buffer handling in order to remove the 4KB size limit in order to guarantee that the oversampling can be made available for all current buffer size/channel count combinations) |
Jon Abbott (1421) 2651 posts |
I agree, DRenderer looks to be the issue. DRenderer in ShareUnixLib needs updating for a start – changes since the version it contains specifically mention playback at the wrong speed being fixed. |
David Feugey (2125) 2709 posts |
Yep that would probably solve problems with SDL applications…
… Or not. Nota: StarFighter3000 has also problems with sound on Panda. Not sure it’s exactly the same issue. |