English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 27 October 2015, 14:48   #61
demolition
Unregistered User
 
demolition's Avatar
 
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
Read here: https://en.wikipedia.org/wiki/Original_Chip_Set#Audio.

Paula has 4 independent 8 bit DACs where each DAC has a 6 bit analog volume control which can also be modulated. When the 8 bit in the DAC is combined with 6 bit from the volume control, you get something like 14 bit depending on how quickly the volume control can be modulated.

I would also reckon that you could combine the two channels on each side so instead of 4x14 bit, you could get something close to 2x16 bit.
demolition is offline  
Old 27 October 2015, 14:58   #62
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
For playing OctaMed Soundstudio sound you can see the source from Aminet though the rights to use it directly rather than in the original .library form may be dubious now that the rights to OMed SS have been bought out.

Also, the way that 14-bit sounds work is by playing the low 6 bits through a second voice at a volume of 1. Stereo is accomplished by doing this through the other two voices. This means that you can play one voice of 14-bit stereo sound without CPU mixing at all. Anything beyond this is either CPU or added hardware.
Samurai_Crow is offline  
Old 27 October 2015, 15:38   #63
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
Quote:
Originally Posted by Samurai_Crow View Post
the low 6 bits through a second voice at a volume of 1.
No, it's the six upper bits of the low byte. Bits 15-8 are played at volume 63, bits 7-2 are played at volume 1, and bits 1-0 are discarded.
Thorham is offline  
Old 27 October 2015, 15:46   #64
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Quote:
Originally Posted by Thorham View Post
No, it's the six upper bits of the low byte. Bits 15-8 are played at volume 63, bits 7-2 are played at volume 1, and bits 1-0 are discarded.
I was talking about a 14-bit sample but if I had been talking about a 16-bit sample you'd have been right with your correction.
Samurai_Crow is offline  
Old 27 October 2015, 20:11   #65
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by kovacm View Post
I must ask something that is not related strictly to topic but 14bit sound on Amiga is achieved by combining two 8 bit channels but Amiga still have 8bit DAC at output? right? So internally (in memory and CPU) you work with 14bit but at output you have 8bit OR Amiga have 4 separate 8bit DAC connected to stereo output chinches?
Amiga really has two 8bit DAC and not more, yet it can still output 14bit quality. Sounds strange, huh ?

14bit is done by using two channels, one at maximum volume (64) and the other at minimum nonzero volume (1).
Internally (in memory and CPU) it's actually 16bit that's used.

The Amiga DAC do the volume by being muted (turned off) during (64-n) clock ticks out of 64. Then the filtering hardware removes the high frequencies and you get proper volume (i hope my explanation was clear enough ?).
meynaf is offline  
Old 27 October 2015, 20:15   #66
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by demolition View Post
Paula has 4 independent 8 bit DACs where each DAC has a 6 bit analog volume control which can also be modulated.
Paula has only 2 8bit DACs, not 4. Mixing is done by alternating data of each channel at high frequency.


Quote:
Originally Posted by demolition View Post
I would also reckon that you could combine the two channels on each side so instead of 4x14 bit, you could get something close to 2x16 bit.
Nope. Doesn't work this way ; 14bit already takes 2 channels to be done.


Quote:
Originally Posted by Thorham View Post
No, it's the six upper bits of the low byte. Bits 15-8 are played at volume 63, bits 7-2 are played at volume 1, and bits 1-0 are discarded.
Volume 64, not 63
meynaf is offline  
Old 27 October 2015, 23:33   #67
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,751
Quote:
Originally Posted by Samurai_Crow View Post
I was talking about a 14-bit sample but if I had been talking about a 16-bit sample you'd have been right with your correction.
Yeah, I somehow didn't get that

Quote:
Originally Posted by meynaf View Post
Volume 64, not 63
Indeed

Code:
                          Agnus/
                  Read/   Denise/
Register Address  Write   Paula         Function
-------- -------  -----   -------       --------
AUDxVOL    0A8      W       P      Audio channel x volume

                 This register contains the volume setting for
                 audio channel x.  Bits 6,5,4,3,2,1,0 specify 65
                 linear volume levels as shown below.

                 Bit#    Use
                 ----    --------------------------
                  15-07  Not used
                  06     Forces volume to max (64 ones, no zeros)
                  05-00  Sets one of 64 levels (000000=no output
                         (111111=63 1s, one 0)


Shows what I know
Thorham is offline  
Old 30 December 2015, 14:29   #68
Trachu
Registered User
 
Join Date: Dec 2015
Location: Poland
Posts: 189
Quote:
Originally Posted by Don_Adan View Post
First Amiga 7V soundformat was Jochen Hippel 7V, created in 1990 year.
Second Amiga 7V soundformat was TFMX 7V.
Third Amiga 7V soundformat was Mugician II (aka Mugician 7V).
All Amiga 7V soundformats has 3 normal channels and 4 mixed channels.
Many years ago I asked Chris Huelsbeck's about TFMX 7V details, and he wrote
that Jochen Hippel was author (idea and mixing code) of 7V routine (exactly
mixing 4 channels in 1 channel).
Many years ago I asked also Reinier van Vliet (Mugician author), he wrote
that he created Mugician II replay, after Turrican 2 was published.
Turrican 2 TFMX 7V music was inspiration for him.
All Amiga 7V replays with sources code are available on the Wanted Team page.
Well thanx for this info and i have found more information regarding this type of mixing.
Jochen Hippel original routine uses 268 cycles per mixed byte. Optimised code uses 254 (or 246 in non osfriendly way)

Digital Mugician 2 original playing routine uses 272cycles per mixed byte, but optimised code only 211 (or 203 in non os friendly way)!!!
You can find their assembly code here
http://wt.exotica.org.uk/players.html

Overally we have to have more mixed bytes per frame to obtain decent quality, so this limits the possible usefulness of this technology.

On C64 we could see a progres in music quality all the time, but Amiga go stuck in Protracker era. Protracker is great, but maybe someone could find a way to enhance number of channels with very limited cost of CPU.
Trachu is offline  
Old 30 December 2015, 16:50   #69
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,959
Quote:
Originally Posted by Trachu View Post
Well thanx for this info and i have found more information regarding this type of mixing.
Jochen Hippel original routine uses 268 cycles per mixed byte. Optimised code uses 254 (or 246 in non osfriendly way)

Digital Mugician 2 original playing routine uses 272cycles per mixed byte, but optimised code only 211 (or 203 in non os friendly way)!!!
You can find their assembly code here
http://wt.exotica.org.uk/players.html

Overally we have to have more mixed bytes per frame to obtain decent quality, so this limits the possible usefulness of this technology.

On C64 we could see a progres in music quality all the time, but Amiga go stuck in Protracker era. Protracker is great, but maybe someone could find a way to enhance number of channels with very limited cost of CPU.
Thanks, but this is my group page.
Don_Adan is offline  
Old 03 January 2016, 17:10   #70
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by Trachu View Post
Well thanx for this info and i have found more information regarding this type of mixing.
Jochen Hippel original routine uses 268 cycles per mixed byte. Optimised code uses 254 (or 246 in non osfriendly way)

Digital Mugician 2 original playing routine uses 272cycles per mixed byte, but optimised code only 211 (or 203 in non os friendly way)!!!
You can find their assembly code here
http://wt.exotica.org.uk/players.html

Overally we have to have more mixed bytes per frame to obtain decent quality, so this limits the possible usefulness of this technology.
I am a bit surprised by these high numbers. I guess they must mean that these routines are mixing voices with different volumes and frequencies.

This seems like a surprising choice given that the instruments usually selected for mixing are usually percussions and the likes which have mostly constant volume and frequencies. It seems sensible to constrain the trackers to use constant frequencies for mixed voices which should greatly reduce the complexity and time needed for each byte: for n voices, only n adds + one divide (simple table).

Is there such a thing on the market?
ReadOnlyCat is offline  
Old 06 January 2016, 17:42   #71
4mat_
Demoscene musician
 
4mat_'s Avatar
 
Join Date: May 2010
Location: UK
Posts: 55
That's a terrible idea, even with percussion you want a bit of pitch control. Apart from the obvious things like toms and cymbals getting a bit of variance in your drums needs pitch effects.

Even using this to play long sample loops wouldn't work because they all need individual tuning to the master bpm.
4mat_ is offline  
Old 06 January 2016, 20:16   #72
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,742
Quote:
Originally Posted by meynaf View Post
Paula has only 2 8bit DACs, not 4. Mixing is done by alternating data of each channel at high frequency.
Prove it... Based on all Paula descriptions it is quite clear that Volume regulation in Amiga is performed by PWM - as such independent DAC for each channel is almost mandatory... (to simplify design but it is possible with additional muxer switched at 2*CCK but this mean that 8 bit DAC must be capable to convert over 7 Mega samples per second)

If Paula perform sample interleaving then it is possible to increase sample rate by using 2 DAC's and without reprogramming horizontal scan rate, only by proper sample interleaving in memory (accordingly to Your claim - odd samples in first channel, even on second).

I can imagine that cost of silicone may justify to have 4 DAC's (multiplier 8*6 even single, working in sample interleaving mode, probably will occupy maybe even more area on die than whole CPU).
pandy71 is offline  
Old 06 January 2016, 21:18   #73
Mrs Beanbag
Glastonbridge Software
 
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
Quote:
Originally Posted by 4mat_ View Post
That's a terrible idea, even with percussion you want a bit of pitch control. Apart from the obvious things like toms and cymbals getting a bit of variance in your drums needs pitch effects.

Even using this to play long sample loops wouldn't work because they all need individual tuning to the master bpm.
hm i dunno, most of my music, the only percussion instrument i use at different pitches is the tom, and only then in 3 different pitches, which i could resample beforehand if i wanted.

But i'd have thought one of the most popular uses of more channels would be chords.
Mrs Beanbag is offline  
Old 07 January 2016, 00:00   #74
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,742
Quote:
Originally Posted by Mrs Beanbag View Post
hm i dunno, most of my music, the only percussion instrument i use at different pitches is the tom, and only then in 3 different pitches, which i could resample beforehand if i wanted.

But i'd have thought one of the most popular uses of more channels would be chords.

PC audio world is sampling fixed so one sampling rate is not a problem - similar approach can be applied on Amiga - some PC audio hw support only one native sampling frequency... Probably only GUS was somehow comparable to Amiga audio HW (similar principle - variable sampling rate).
pandy71 is offline  
Old 07 January 2016, 10:41   #75
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by pandy71 View Post
Prove it... Based on all Paula descriptions it is quite clear that Volume regulation in Amiga is performed by PWM - as such independent DAC for each channel is almost mandatory... (to simplify design but it is possible with additional muxer switched at 2*CCK but this mean that 8 bit DAC must be capable to convert over 7 Mega samples per second)
The PWM frequency is about 56Khz, not 3.5Mhz.


Quote:
Originally Posted by pandy71 View Post
If Paula perform sample interleaving then it is possible to increase sample rate by using 2 DAC's and without reprogramming horizontal scan rate, only by proper sample interleaving in memory (accordingly to Your claim - odd samples in first channel, even on second).
This is not possible, because you'd have to make the two channels in perfect phase opposition (half-a-sample sync) - something the DMA simply can't do.


Quote:
Originally Posted by Mrs Beanbag View Post
But i'd have thought one of the most popular uses of more channels would be chords.
I'm not a musician but from what i've heard, drums don't use many channels in comparison to tones. So the fixed pitch mixing wouldn't be useful. A fixed per-channel volume can bring a few cpu cycles but i don't think it's worth.
meynaf is offline  
Old 07 January 2016, 13:26   #76
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,742
Quote:
Originally Posted by meynaf View Post
The PWM frequency is about 56Khz, not 3.5Mhz.
56kHz * 64=3.58MHz - DAC must be updated with this frequency (unless DAC_Vref is controlled by PWM but then DAC must be multiplying type which itself affecting significantly DAC bandwith).

My point is - until someone not map Paula silicone or Paula schematics will be available we can only speculate how many DAC's is on Paula.
Block schematics which are available suggest 4 independent DAC's and all channels are combined in analog domain.

Quote:
Originally Posted by meynaf View Post
This is not possible, because you'd have to make the two channels in perfect phase opposition (half-a-sample sync) - something the DMA simply can't do.
Well you suggested sample interleaving (don't get me wrong - this is OK from design perspective and probably i would design Paula in such way to reduce silicone size) - this half sample time offset is not related to DMA but to internal DAC buffer + muxer + ZOH + PWM - relatively easy test.
Stacking to 8 bit DAC's in parallel you should be able to receive 9 bit resolution (if there is no sample interleaving), if there is sample interleaving you should be able double sample rate by using 2 channels where one channel play odd samples and second even samples (maybe with 1 byte offset).

If some one is able to accept some limitations (2 virtual channels must have same sampling rate + sample rate reduced by half i.e. relatively lofi sound) then 8 channels can be created by interleaving odd samples and interleaving even samples in one channel buffer.
pandy71 is offline  
Old 07 January 2016, 13:58   #77
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by pandy71 View Post
56kHz * 64=3.58MHz - DAC must be updated with this frequency (unless DAC_Vref is controlled by PWM but then DAC must be multiplying type which itself affecting significantly DAC bandwith).

My point is - until someone not map Paula silicone or Paula schematics will be available we can only speculate how many DAC's is on Paula.
Block schematics which are available suggest 4 independent DAC's and all channels are combined in analog domain.
Maybe it has 4x8bit DAC after all. But if you can go with just 2x8bit, why not just doing it this way ?
If DACs occupy a large die size, using 2 instead of 4 makes sense.

If i recall correctly - which is dubious - i've read somewhere that the mixing was done this way - which might have been wrong as well.


Quote:
Originally Posted by pandy71 View Post
Well you suggested sample interleaving (don't get me wrong - this is OK from design perspective and probably i would design Paula in such way to reduce silicone size) - this half sample time offset is not related to DMA but to internal DAC buffer + muxer + ZOH + PWM - relatively easy test.
Stacking to 8 bit DAC's in parallel you should be able to receive 9 bit resolution (if there is no sample interleaving), if there is sample interleaving you should be able double sample rate by using 2 channels where one channel play odd samples and second even samples (maybe with 1 byte offset).
If you can have two channels 180 degrees of each other, then you can have double sample rate regardless of the mixing method (because your output level will get updated every half a sample).


Quote:
Originally Posted by pandy71 View Post
If some one is able to accept some limitations (2 virtual channels must have same sampling rate + sample rate reduced by half i.e. relatively lofi sound) then 8 channels can be created by interleaving odd samples and interleaving even samples in one channel buffer.
For 2 channels out of one, with the same replay freq, you'll be better off by simply averaging the two samples with the cpu.

Anyway, for 8 channels or more, i'll always prefer using the cpu. And even an unexpanded A1200 can play many channels with acceptable quality ; for example the menu music in superstardust is a 12-channel S3M.
meynaf is offline  
Old 07 January 2016, 16:00   #78
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,742
Quote:
Originally Posted by meynaf View Post
Maybe it has 4x8bit DAC after all. But if you can go with just 2x8bit, why not just doing it this way ?
If DACs occupy a large die size, using 2 instead of 4 makes sense.

If i recall correctly - which is dubious - i've read somewhere that the mixing was done this way - which might have been wrong as well.
I agree that 2 seem to be cheaper but... it imply to have fast and accurate DAC, for single channel DAC is updated with 3.58MHz speed so for 2 channels it must be updated twice faster. If volume regulation is performed not by selecting sample value vs zero but as a DAC Vref change this means that DAC must be multiplying type and such DAC's are very limited in terms of bandwidth - perhaps few hundreds kHz max.
So from one side silicone designer is focus on reducing die size but on second he is limited by technology available and expected parameters.

Seem that on picture: two large areas are very well visible - one area consist 4 blocks (audio digital part?, audio digital + analog?) second are consist 2 large block utilising roughly 40% of die (flopy + other logic?, audio DAC's?)

Based on this picture still nothing is clear...
And you can imagine even different approach - analog switches controlled by PWM where they switch between DAC output and analog ground - as such PWM is applied in analog domain...
Nothing is clear and after longer picture observation i almost convinced that audio part occupy approx 60% and that there are 4 DAC's and that second large block is probably chipset bus with address decoder + other bus logic.

Picture from http://obligement.free.fr/articles/p...microscope.php but real source is here http://www.tinytransistors.net/index...d=31&Itemid=32

Quote:
Originally Posted by meynaf View Post
If you can have two channels 180 degrees of each other, then you can have double sample rate regardless of the mixing method (because your output level will get updated every half a sample).
Not necessary... imagine that samples from 2 channels are interleaved 1.2.1.2...1.2.1.2 (case for no volume applied i.e. level 65) - if this is performed with 2*3.58 then single DAC can be shared, when level is applied samples from each channel are no longer interleaved in continuous way but they can be replaced by 0 - after averaging analog signal will be restored with level proportional to ratio between time of sample/time of zeros (proportional to level) - this can be easily made with some muxer that switch between sample buffer and 0, another muxer selecting sample from 2 channels (muxing twice faster) and it should work.

Quote:
Originally Posted by meynaf View Post
For 2 channels out of one, with the same replay freq, you'll be better off by simply averaging the two samples with the cpu.

Anyway, for 8 channels or more, i'll always prefer using the cpu. And even an unexpanded A1200 can play many channels with acceptable quality ; for example the menu music in superstardust is a 12-channel S3M.
This means every sample must be multiplied by volume so 8x6 gives us 14 bit, then two 14 bit samples must be added (15 bit product) and shifted down by 7 bits (or only 8 MSB selected). Plain 68k is relatively slow in DSP...

Last edited by pandy71; 07 January 2016 at 16:41.
pandy71 is offline  
Old 07 January 2016, 16:22   #79
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
US Patent 4,829,473 says ""Each of the data registers 29,31 transfers its data into a plurality of audio control counters and registers 33 and 35, which in turn each drive an individual one of the digital to analog (D/A) converters 37,39 of which there are four in all." and FIG 4 shows 4 identical channel blocks and each has single analog out line.
Toni Wilen is offline  
Old 07 January 2016, 16:24   #80
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by pandy71 View Post
This means every sample must be multiplied by volume so 8x6 gives us 14 bit, then two 14 bit samples must be added (15 bit product) and shifted down by 7 bits (or only 8 MSB selected). Plain 68k is relatively slow in DSP...
Multiplication by volume is done with a LUT so no slow multiply is involved.
A good routine can do 4ch on bare 68000 and 32ch with interpolation on 68030 - not what i'd call slow.
meynaf 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
Sound channels switched? bLAZER support.WinUAE 21 28 October 2014 08:43
A600: missing sound channels cosam support.Hardware 28 23 May 2010 06:43
More that 4 Sound Channels??? Dragon3d support.WinUAE 8 01 February 2008 17:30
shufflepuck cafe 4 channels sound is crazy turrican3 support.WinUAE 5 08 November 2007 15:41
help sound 4 channels turrican3 support.WinUAE 37 13 April 2007 09:17

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 21:20.

Top

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