English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 15 December 2014, 08:27   #1
xxxxx
Registered User
 
Join Date: Jan 2012
Location: N/A
Posts: 38
Questions about 14 bit audio playback

An experiment I am considering is based on 14 bit audio playback, but without hardware testing capabilities, it's hard to verify that things are actually correct, so I have a few questions:
1. If you are trying to do 14 bit audio (DMA driven, with 2 channels - one at volume 64 and one at volume 1), it's super important that the 2 channels are fully in sync, right?. But is it precise enough to just turn the DMA on for the 2 channels at the same time? Will they be fully in phase? Are there any internal counters to worry about being off?
2. Specifically, do each of the channels wait for the DMA to actually return the word before the channel's period counter starts ticking - or do they start simply when the DMA is enabled?
3. Are there any edge cases to worry about? such as the period of the previous sounds, or at what time the DMA is turned on.
4. Is there any definitive code sample that people look at for how to start the buffers correctly?
5. Writing to AUDxDAT resets the volume counter - is that also true in DMA driven audio whenever the DMA delivers a new word? if so, should the period be a multiple of 64 for a volume of 1 to actually be 1/64th of the volume of 64? Or, put another way, if you put the period as 129, would it be on 3 of every 129 cycles (on for 1 cycle, off for 63, on for 1, off for 63, on for 1, repeat) rather than 1 of every 64 cycles (on for 1 cycle, off for 63, repeat)
xxxxx is offline  
Old 15 December 2014, 11:59   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,546
Quote:
Originally Posted by xxxxx View Post
1. If you are trying to do 14 bit audio (DMA driven, with 2 channels - one at volume 64 and one at volume 1), it's super important that the 2 channels are fully in sync, right?. But is it precise enough to just turn the DMA on for the 2 channels at the same time? Will they be fully in phase? Are there any internal counters to worry about being off?
They should be in phase.

Quote:
2. Specifically, do each of the channels wait for the DMA to actually return the word before the channel's period counter starts ticking - or do they start simply when the DMA is enabled?
Period counting starts when sample gets moved from AUDxDAT to 8-bit output buffer. "percntrld" in audio state diagram. DMA enable vs first word going to AUDxDAT can take more than 1 scanline.

Quote:
3. Are there any edge cases to worry about? such as the period of the previous sounds, or at what time the DMA is turned on.
Should not be any. DMA is not 100% directly related to period/volume counting. It is also not possible to "delay" or "miss" some channel's DMA startup by one scanline by writing to DMACON in "bad" horizontal position. (Which would have been really annoying.. Some other DMA channels can have this problem)

Quote:
5. Writing to AUDxDAT resets the volume counter - is that also true in DMA driven audio whenever the DMA delivers a new word? if so, should the period be a multiple of 64 for a volume of 1 to actually be 1/64th of the volume of 64? Or, put another way, if you put the period as 129, would it be on 3 of every 129 cycles (on for 1 cycle, off for 63, on for 1, off for 63, on for 1, repeat) rather than 1 of every 64 cycles (on for 1 cycle, off for 63, repeat)
According to audio state diagram it is only reset when first DMA word or CPU word comes. ("volcntrld" in audio state diagram). And I think I confirmed this in my oscilloscope tests some time ago.

Audio state diagram in HRM explains nearly everything, it really only lacks description of Agnus/Paula DMA request interface.
Toni Wilen is offline  
Old 15 December 2014, 14:54   #3
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
i was wondering lately about the possibility of putting them *deliberately* out of sync in order to "fake" a doubled sample frequency.
Mrs Beanbag is offline  
Old 15 December 2014, 18:02   #4
xxxxx
Registered User
 
Join Date: Jan 2012
Location: N/A
Posts: 38
Thank you for the detailed answers Toni. I looked at the audio state diagram already, but I don't know how to read it properly. This sounds pretty straightforward, then :-)

Yeah, I was also considering the doubled sample frequency idea, after reading the thread about it. If they were playing in two channels (one with the odd samples and one with the even samples), with a period of 124, and were offset 62 clock cycles, then it may be an improvement. Then it would always overlap two samples at a time:
cycle 0-61: sample 1+2
cycle 62-123: sample 2+3
cycle 124-185: sample 3+4
Not as good as a true double frequency, but probably an improvement. Maybe it is possible to do some filtering to improve it further?

I was also wondering if it was possible instead to benefit from the idea of playing at half volume, due to way the volume control works on amiga. If, say, you run at a period of 128 (conveniently a multiple of 64), volume of 32, and you have the second channel offset by 32, it would be
cycle 0-31 sample 1
cycle 32-63 sample 2
cycle 64-95 sample 1
cycle 96-127 sample 2
cycle 128-159 sample 3
cycle 160-193 sample 4
This may also be an improvement?
xxxxx is offline  
Old 15 December 2014, 20:32   #5
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by Mrs Beanbag View Post
i was wondering lately about the possibility of putting them *deliberately* out of sync in order to "fake" a doubled sample frequency.
http://eab.abime.net/showthread.php?...la+audio+phase
mc6809e is offline  
Old 17 December 2014, 12:55   #6
Vot
Registered User
 
Join Date: Aug 2012
Location: Australia
Posts: 651
Quote:
Originally Posted by mc6809e View Post

Seriously every time I read threads with conjecture like that about the inner workings of the chips I wonder why the Amiga community doesn't get together to fundraise to have the chipset decapped and photographed.
Vot is offline  
Old 18 December 2014, 09:20   #7
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
Probably because we already understand enough about the chip to be able to enable almost 100% compatible emulation. If the Amiga community was going to contribute a large amount of money to a project, this wouldn't be the most beneficial one.
Hewitson is offline  
Old 18 December 2014, 09:42   #8
Vot
Registered User
 
Join Date: Aug 2012
Location: Australia
Posts: 651
Questions about 14 bit audio playback

Quote:
Originally Posted by Hewitson View Post
Probably because we already understand enough about the chip to be able to enable almost 100% compatible emulation. If the Amiga community was going to contribute a large amount of money to a project, this wouldn't be the most beneficial one.

I didn't mean just paula, hence I said chipset.,and the decapping and photographing is probably not as expensive as you think.
Vot is offline  
Old 18 December 2014, 10:04   #9
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,810
Quote:
Originally Posted by Hewitson View Post
If the Amiga community was going to contribute a large amount of money to a project, this wouldn't be the most beneficial one.
It would be if the whole chipset would be reverse engineered. With those printable chips we're going to have in the near future, we would be able to print Amiga chips!
Thorham is offline  
Old 18 December 2014, 12:56   #10
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
Quote:
Originally Posted by Thorham View Post
It would be if the whole chipset would be reverse engineered. With those printable chips we're going to have in the near future, we would be able to print Amiga chips!
There would be little demand for that as they rarely fail and there's already a decent supply of most of them.

Surely reproducing the 060 would be a far more beneficial project.
Hewitson is offline  
Old 18 December 2014, 17:36   #11
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by Hewitson View Post
There would be little demand for that as they rarely fail and there's already a decent supply of most of them.

Surely reproducing the 060 would be a far more beneficial project.
It would be nice to see how the blitter is designed, though.

There may even been some some new tricks made possible by knowing what happens when switching modes, channel use, etc while the blitter is running.

For example, there is one situation known where D channel writes can occur back-to-back. It happens at the conclusion of a sequence that uses all channels.

Perhaps there's some way by timing a mode switch just right to get a full speed clear.

It's difficult to know if that's possible, though, without a better characterization of the blitter's internal logic.
mc6809e is offline  
Old 18 December 2014, 23:58   #12
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,810
Quote:
Originally Posted by Hewitson View Post
There would be little demand for that as they rarely fail and there's already a decent supply of most of them.
Except for the fact we'd be able to produce new Amigas. New REAL Amigas.
Thorham is offline  
Old 19 December 2014, 10:17   #13
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,859
So anyone to set kickstarter/other fundraising?
I will put money as current way of emulation doesn't solve all problems (like GCR mode in Paula, Line mode in blitter etc), there is plenty we don't know about Amiga HW, side to this decapping 68060 have no sense, better target is 68020 as there is full MB68k ISA representative (bitfield instructions removed after 020) - 030,040,060 are 020 after castration and on steroids (cache, pipeline etc).

All them use should be relatively easy to map to schematics as none of them (AFAIK) use anything bellow 600nm so visible light is sufficient.

Then one chip ASIC can be created (with improved for example RAM bus thus 50+ old CHIP bandwidth).

http://www.degate.org/

btw 8520 is already available... http://siliconpr0n.org/map/mos/8520/top_metal_mit20x/

Last edited by pandy71; 19 December 2014 at 10:22.
pandy71 is offline  
Old 19 December 2014, 10:42   #14
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,546
I am only interested with Agnus internals: blitter, bitplane and copper state machines (in order of importance).

Some little interest also in Denise's bitplane/sprite priority logic. (Why invalid priority values do that strange color selection effect, used for example in SWIV)

I also don't see point in decapping higher CPU models. You only need to know internal logic if you want to make 100% timing compatible CPU and that kind of compatibility is only needed for something like basic A1200. Hardware or emulation.
Toni Wilen is offline  
Old 19 December 2014, 11:23   #15
Vot
Registered User
 
Join Date: Aug 2012
Location: Australia
Posts: 651
Quote:
Originally Posted by pandy71 View Post
So anyone to set kickstarter/other fundraising?
I will put money as current way of emulation doesn't solve all problems (like GCR mode in Paula, Line mode in blitter etc), there is plenty we don't know about Amiga HW, side to this decapping 68060 have no sense, better target is 68020 as there is full MB68k ISA representative (bitfield instructions removed after 020) - 030,040,060 are 020 after castration and on steroids (cache, pipeline etc).

All them use should be relatively easy to map to schematics as none of them (AFAIK) use anything bellow 600nm so visible light is sufficient.

Then one chip ASIC can be created (with improved for example RAM bus thus 50+ old CHIP bandwidth).

http://www.degate.org/

btw 8520 is already available... http://siliconpr0n.org/map/mos/8520/top_metal_mit20x/

I personally would put some cash into such a project, it would be great for you guys to get the final pieces of the puzzle to help fix those last few winuae bugs, and for others to do all sorts of crazy asic's/fpga's projects.

It might be interesting asking guru from (http://members.iinet.net.au/~lantra9...cap/index.html) if he would be interested in sharing his contact for decapping as he gets good rates. (Not that other places don't do it). He might want a copy of the die shots as he seems to have the keyboard encoders for decapping already.

He however seems a bit of a prickly pear to deal with any email could have you added to his stupid email list lol.
Vot is offline  
Old 21 December 2014, 14:43   #16
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,773
Quote:
Originally Posted by Thorham View Post
Except for the fact we'd be able to produce new Amigas. New REAL Amigas.
For the chip decapping, chip design and manufacturing, case manufacturing, and other costs, youd be looking at several hundred thousand dollars.
Hewitson is offline  
Old 22 December 2014, 19:30   #17
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,859
Quote:
Originally Posted by Hewitson View Post
For the chip decapping, chip design and manufacturing, case manufacturing, and other costs, youd be looking at several hundred thousand dollars.

Perhaps less but everything depends how many high quality work can be performed voluntarily.

Example prices are for example on: http://cmp.imag.fr/products/ic/?p=prices

Seem that 180 - 130nm are reasonable priced and should allow to design 68060 like with clock around 1GHz.

It should be possible to decap and collect photo for each layer for most of Amiga custom chips well bellow 10 - 20k E. With such pictures real schematics can be achieved relatively easy, partially automatic way.

It must be clear to everyone that achieving clocks for FPGA 68060 like implementation higher than 300 - 500MHz probably will be not possible.

CPU ASIC can be interesting not only for Amiga community but i assume Atari and perhaps Mac's. IP of Motorola need to be also solved.

Most challenging task is design verification...
pandy71 is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
15 bit 44 khz audio idea. Thorham Coders. General 33 15 September 2021 06:22
High Quality reproduction of Audio on 8 bit. pandy71 Amiga scene 0 01 July 2013 15:08
REQ: 17-Bit Artwork 2 (1988-04)(17-Bit Software) Sea7 request.Demos 5 13 May 2011 01:07
8 bit to optimized 6 bit palette histogram improvements needed NovaCoder Coders. General 0 14 April 2011 02:13
Simple 14 bit audio question... Thorham Coders. General 7 06 June 2010 10:55

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:52.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09852 seconds with 13 queries