Development of an AHI audio driver

45 posts / 0 new
Last post
broadblues
broadblues's picture
Offline
Last seen: 1 month 4 days ago
Joined: 2012-05-02 21:48
I guess the S/PDIF bandwidth
I guess the S/PDIF bandwidth can' t handle more than stereo, or?
S/PDIF is a stereo format. It doesn't do 7.1 it's not for that, it for connecting the output of digital src such my Line6 POD Pro (not that I ver used a digital connection with it!) in a lossless manner. Some systems (Dolby Digital for example) can encode the 7.1 into a higher bitrate stereo stream and then decode it at the other end, by Dolby Digital needs a license. HDMI on the other hand is designed for multimedia so makes more sense to send 7.1 over that (might still be encoded though, rather than seperate streams , not sure).
Massi
Massi's picture
Offline
Last seen: 3 years 6 months ago
Joined: 2012-03-28 17:16
@All Do we have OS4
@All Do we have OS4 applications supporting 7.1 HDAudio? Which file formats (audio, media, ...) are actually 7.1 containers?
LyleHaze
LyleHaze's picture
Offline
Last seen: 2 years 7 months ago
Joined: 2011-05-26 03:58
AHI version 6 supports 7.1
AHI version 6 supports 7.1 audio. The HDAudio driver for the X1000 supports 7.1 audio from AHI. Any application that supports 7.1 to AHI should work on the X1000. From Wikipedia:S/PDIF is based on the professional AES3 interconnect standard.[1] S/PDIF can carry two channels of uncompressed PCM audio or compressed 5.1/7.1 surround sound (such as DTS audio codec); it cannot support lossless formats (such as Dolby TrueHD and DTS-HD Master Audio) which require greater bandwidth like that available with HDMI or DisplayPort.
LyleHaze
hypex
hypex's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-09-09 16:20
Just wanted to join the
Just wanted to join the discussion regarding the compiling of a driver. I do concur the OS4 compile of AHI is slightly messed up. In 2007 I was porting a 68K multi-module player to AHI. I did a lot of the testing and programing on my OS4 machine. I was programming the replayer routine in the "proper" way by using an AHI interrupt. On my AmigaOne I noticed a bug where the sound kept stuttering caused by a high speed tempo. I determined that it was due to a fault caused by using an Emu10K AKA SoundBlaster Live5.1 PCI card (which I had) in my AmigaOne, where the driver has to cut down the number of hardware interrupts generated by the card requesting sound data, because the VIA chip holds up the bus. A buffer overflow had occured. Because the driver was being sent data at a faster rate than it could actually send to the card. I had this idea to modify the driver so that at a certain speed, where overflow would occur, it would double the buffer, so to speak, and then call two AHI interrupts in place of one to compensate and fill it so the problem would not occur. And this is where it ends. I found the Emu10K source, that Davy Wentzler compiled for OS4, would not compile out of the box from a standrd SDK install. It was made to compile with an earlier SDK version, IIRC, and expected other things I did not have in my public machine. Eventually with his help, I did manage to compile a driver. My reward? It crashed. Simply crashed. I spent some more time with it but eventually gave up. I connsidered sending Davy my code changes but I wouldn't be able to test them directly. I had to agree with Davy in the end, that compiling an AHI driver is a bitch! :-D
Massi
Massi's picture
Offline
Last seen: 3 years 6 months ago
Joined: 2012-03-28 17:16
@hypex Likewise I found the
@hypex Likewise I found the AHI interrupt "suspicious" under OS4 and wondered if replacing it with a timer obtained from the timer.device would have helped, I am not sure though.
hypex
hypex's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-09-09 16:20
@Massi The AHI player
@Massi The AHI player interrupt most likely uses a soft interrupt and I would use the term "timer" loosely. Sure, it all comes down to timing, but all that particular interrupt does is call a requested routine or player interrupt that can start sounds or modify fequency or volume of an existing sound. The net result being that AHI uses this information to fill a sound buffer for that particular slice of time. And the speed of the interrput thus corresponds to how much of the buffer is filled on each call. So not necessarily a realtime interupt. If you understand the workings of ProTracker or any other tracker, where an interupt is called in realtime, you can understnnd the AHI player interrupt. For example a PT player routine at 50 FPS, corresponding to 125 BPM, can play a note every six interrupts with effects in between. I forget the math but I know it is six. Almost did my head in once dealing with it. :-) So, with this in mind, involving timer.device wouldn't help AHI. Well, not in this particular case anyway. AHI could even call the interrupt several times a second, since the purpose is to fulfill a sound buffer. So AHI could do that, calling the intrerrupt repeatedly, until the buffer was filled and ready for send off. Send that to the sound card for processing via the drvier. And then render the next buffer while the other is playing.. :-)
Massi
Massi's picture
Offline
Last seen: 3 years 6 months ago
Joined: 2012-03-28 17:16
@hypex If you understand the
@hypex
If you understand the workings of ProTracker
I once programmed a ProTracker MOD player for OS3 and that was my speculation about ... :)
hypex
hypex's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-09-09 16:20
@Massi Okay, so you
@Massi Okay, so you certainly know how to program an AHI module player. :-) I just wanted to touch on Tocatta again. So you found the AHI driver depends on another library, but this is nornal. AHI is just used as an interface or transport layer for audio programs. So the AHI drivers pass the real work down to the actual sound card API. It means the card can be supported and with less fuss to produce an AHI driver. Now your intention was to produce a driver that world work in emulation. Knowing that 68K call backs and UAE opcodes don't work under PPC emulation, do the actual Tocatta drivers work, when that card is emulated? Is there a built in UAE driver that works instead?
Massi
Massi's picture
Offline
Last seen: 3 years 6 months ago
Joined: 2012-03-28 17:16
@hypex So the AHI drivers
@hypex
So the AHI drivers pass the real work down to the actual sound card API.
Yes, so in this case you don' t see how the hardware is touched.
do the actual Tocatta drivers work, when that card is emulated?
Interesting question. My personal guess is that Toccata emulation is supposed to work from within OS3.x emulated only.
hypex
hypex's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-09-09 16:20
@MAssi Yes, so in this case
@MAssi
Yes, so in this case you don' t see how the hardware is touched.
You don't as it's cleanly hidden away. All you can assume is that it is mapped somewhere in memory in Zorro space. And that Expansion API can be used to write to it. I don't know if using an MMU program to catch writes on the real thing will tell you what memory is being hit so you can decipher it. Or you could study a disassembly of the API in Monan or ReSource or something similar.
My personal guess is that Toccata emulation is supposed to work from within OS3.x emulated only.
Have you tried it yet? ;-) Well, either way, the emulation has to catch access to memory. So even if PPC mode is on I think it still needs to interpret things like custom chip access. So then, an emulated Toccata sound card hanging off the Zorro bus, should still exist in the virtual memory. And so, should still work. IMO. :-) As to UAE sound driver, I think that might not work, if it uses UAE callbacks ignored under PPC.
Massi
Massi's picture
Offline
Last seen: 3 years 6 months ago
Joined: 2012-03-28 17:16
@hypex Have you tried it
@hypex
Have you tried it yet?
Not yet and you? Few months ago I swapped a few emails with Toni Wilen, author of WinUAE, here is an extract: "Whats wrong with Toccata emulation? It was specifially added to allow hig quality 16-bit sound on non-m68k native operating systems. No sound quality difference vs uae.audio." I am puzzled, wasn' t Toccata specific for M68K AmigaOS? How his words should be interpreted? That OS4 emulated can run Toccata or?
thomas
thomas's picture
Offline
Last seen: 1 month 1 week ago
Joined: 2011-05-16 14:23
Toccata is hardware, it
Toccata is hardware, it cannot be specific to a certain software version. Surely Toccata works in OS4, that's the only reason why Toccata emulation exists, because OS4 only supports real existing hardware.
Massi
Massi's picture
Offline
Last seen: 3 years 6 months ago
Joined: 2012-03-28 17:16
@thomas Toccata is hardware,
@thomas
Toccata is hardware, it cannot be specific to a certain software version.
Toccata is also software and as far as I know its AHI driver only exists for M68K AmigaOS.
Surely Toccata works in OS4, that's the only reason why Toccata emulation exists, because OS4 only supports real existing hardware.
Does a native AHI driver for OS4 exist?
hypex
hypex's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2011-09-09 16:20
@Massi Not yet and
@Massi
Not yet and you?
LOL. :-) No I haven't. I failed to get PPC emulation working on my iBook G4 and haven't tried on my PC which is lacking space.
I am puzzled, wasn' t Toccata specific for M68K AmigaOS?
Well yes, since it is also an actual Amiga sound card.
How his words should be interpreted? That OS4 emulated can run Toccata or?
I haven't read it from the the orginal context, but from the above it looks like Toni is being asked what is wrong with emulating a Tocatta card under normal circumstances in UAE, as if it was pointless, going by the response. Even though in his answer he fails to point out that not all prograns, such as OctaMED, are AHI aware. But, in light of the answer, I think it should be interpreted as you have. That the Tocatta emulation exists so that an OS like OS4, that kills off the 68K and thus any special UAE opcodes and hooks, can actually play sounds.
Does a native AHI driver for OS4 exist?
I looked and didn't see a driver. Anything on the OS4 CD? Given the OS4 AHI drivers are based on the sane sources I suspect not fully if one at all.

Pages

Log in or register to post comments