English Amiga Board


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

 
 
Thread Tools
Old 24 April 2023, 21:22   #201
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,397
Quote:
Originally Posted by paraj View Post
Yeah, wasn't too bad actually. Had to fiddle a little bit with it, which is why I didn't use your format - wanted to get a normal sample working correctly first, and try a few out different ones and didn't want to encode etc.


One small suggestion - if plain 68000 is on the table - is to store volume as a word. Decode will be then be very easy/fast, e.g.:
Code:
.loop:
    move.w (a0)+,(a1)+ ; store volume
    bne.b   .copy
    add.w   #FRAME_SIZE,a2 ; no need to store samples
    bra.b   .iter
.copy:
    rept FRAME_SIZE/4
    move.l  (a0)+,(a2)+  ; samples
    endr
.iter:
    dbf d0,.loop

Though you may already have had that in mind. Happy experimentation, maybe you'll end up with 512 sample frame size
I hadn't fully decided on the frame length tbh. Ultimately mine is an 8 bit sample replay. Obviously shorter frame size is better for quality but you begin to increase the data size to the point were objectively it's a comparable size to 12 bit but lacking the resolution. I picked a frame length of 16 as a starting point because it seemed like it would allow fast enough response to volume transients without adding too much size.
Karlos is online now  
Old 24 April 2023, 22:11   #202
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Uploaded to the Zone an optimized 'normal' version.

IRQ code:
Code:
start_ptr	ds.l	1
end_ptr		ds.l	1    ; do not move
audio_ptr	ds.l	1    ; do not move
...
irq4	movem.l	a0/a1,-(sp)
	lea	$dff09c,a1
	movea.l	(audio_ptr,pc),a0
	move.w	#%0000011110000000,(a1)
	move.w	(a0),($aa-$9c,a1)
	move.w	(a0)+,($ba-$9c,a1)
	lea	(end_ptr,pc),a1
	cmpa.l	(a1)+,a0
	bne.b	.ok
	movea.l	(start_ptr,pc),a0
.ok	move.l	a0,(a1)
	movea.l	(sp)+,a0
	movea.l	(sp)+,a1
	rte
Before anyone grumbles:
- Yes, I want 'start_ptr' and 'end_ptr' as variables;
- Yes, I want it compatible with higher processors;
- Yes, I know that the writing of AUDxDAT can be slightly early;
- No, I do not want to share registers with 'main' code;
- No, I do not want to make the code larger (optimize branch).

~55/56KHz reachable.

Last edited by ross; 24 April 2023 at 23:16. Reason: a/b hints
ross is offline  
Old 24 April 2023, 22:32   #203
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,053
Nice bait :P.
Code:
;	movem.l	(sp)+,a0/a1
 move.l	(sp)+,a0
 move.l	(sp)+,a1
	rte
You could also save 4 cycles if you place audio_ptr right after end_ptr (end_ptr -> a1, cmpa (a1)+,a0).
a/b is online now  
Old 24 April 2023, 22:35   #204
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by a/b View Post
Nice bait :P.
Code:
;	movem.l	(sp)+,a0/a1
 move.l	(sp)+,a0
 move.l	(sp)+,a1
	rte
Right
I always forget that

Quote:
You could also save 4 cycles if you place audio_ptr right after end_ptr (end_ptr -> a1, cmpa (a1)+,a0).
Yeah, it would have been better if I had also wrote the memory location of the variables
I edit the message. Thanks!

Last edited by ross; 24 April 2023 at 22:47.
ross is offline  
Old 24 April 2023, 22:58   #205
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,867
Quote:
Originally Posted by meynaf View Post
Not without good accelerator board, but why not.
Goal is lowest common denominator - relaxed anyway expectations so 68020 allowed but still - accelerator board is more expensive than sound board

Quote:
Originally Posted by meynaf View Post
I wasn't serious...
To complex?

Quote:
Originally Posted by meynaf View Post
If you don't want to kill OS you can still do it under jitted emulation.
Emulation is not funny, is boring, more than disabled multitasking in Amiga.

Quote:
Originally Posted by meynaf View Post
You can bet on this if you want.
Well - i only expressed my hope that we will be able to live more on this world...

Quote:
Originally Posted by meynaf View Post
If you want to use their RT ability, i'm afraid i have to tell you they stop at 1khz.
Well this is usual minimal time interval but probably you can have 20..10uS (only this will be insane waste of CPU cycles - ditto Copper can be beneficial).
pandy71 is offline  
Old 24 April 2023, 23:21   #206
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,650
It's not a burning question for me. Other factors affect sound quality more. Some ideas.

Mind DRAM refresh cycle which cannot be blocked AFAIK + exact #cycles/frame unless aliased to same granularity as IRQ trigger cycles per CPU.

There should also be a tiny delay between 2 same ear channels? Probably difficult to abuse since it should be well above hearing.
Photon is offline  
Old 24 April 2023, 23:34   #207
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 54
Posts: 4,488
Quote:
Originally Posted by Photon View Post
There should also be a tiny delay between 2 same ear channels? Probably difficult to abuse since it should be well above hearing.
Yes, all channels have a small unavoidable phase shift.
ross is offline  
Old 25 April 2023, 00:40   #208
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,029
Quote:
Originally Posted by ross View Post
Uploaded to the Zone an optimized 'normal' version.

IRQ code:
Code:
start_ptr	ds.l	1
end_ptr		ds.l	1    ; do not move
audio_ptr	ds.l	1    ; do not move
...
irq4	movem.l	a0/a1,-(sp)
	lea	$dff09c,a1
	movea.l	(audio_ptr,pc),a0
	move.w	#%0000011110000000,(a1)
	move.w	(a0),($aa-$9c,a1)
	move.w	(a0)+,($ba-$9c,a1)
	lea	(end_ptr,pc),a1
	cmpa.l	(a1)+,a0
	bne.b	.ok
	movea.l	(start_ptr,pc),a0
.ok	move.l	a0,(a1)
	movea.l	(sp)+,a0
	movea.l	(sp)+,a1
	rte
Before anyone grumbles:
- Yes, I want 'start_ptr' and 'end_ptr' as variables;
- Yes, I want it compatible with higher processors;
- Yes, I know that the writing of AUDxDAT can be slightly early;
- No, I do not want to share registers with 'main' code;
- No, I do not want to make the code larger (optimize branch).

~55/56KHz reachable.
If You will be using SetIntVector, this routine can be shortest, but maybe slowest.
Don_Adan is offline  
Old 25 April 2023, 07:48   #209
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
Quote:
Originally Posted by pandy71 View Post
Goal is lowest common denominator - relaxed anyway expectations so 68020 allowed but still - accelerator board is more expensive than sound board
Yes but accelerator board can serve many purposes where sound board is only for sound.


Quote:
Originally Posted by pandy71 View Post
To complex?
Too slow.


Quote:
Originally Posted by pandy71 View Post
Emulation is not funny, is boring, more than disabled multitasking in Amiga.
Right, but it allows doing things that are otherwise not possible.


Quote:
Originally Posted by pandy71 View Post
Well this is usual minimal time interval but probably you can have 20..10uS (only this will be insane waste of CPU cycles - ditto Copper can be beneficial).
Current "modern" machines routinely waste incredible amounts of cpu cycles (among other things), so where is the problem. These OSes know nothing about Copper anyways.
meynaf is offline  
Old 25 April 2023, 13:32   #210
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,867
Quote:
Originally Posted by meynaf View Post
Yes but accelerator board can serve many purposes where sound board is only for sound.
Well... many purposes? Web browsing? 1080p movies edition?

Quote:
Originally Posted by meynaf View Post
Too slow.
This level of slowness?
http://www.visual6502.org/JSSim/index.html


Quote:
Originally Posted by meynaf View Post
Right, but it allows doing things that are otherwise not possible.
Perhaps... but still it is boring.

Quote:
Originally Posted by meynaf View Post
Current "modern" machines routinely waste incredible amounts of cpu cycles (among other things), so where is the problem. These OSes know nothing about Copper anyways.
Well, but at the same this is compensated by clocks almost 1000 times higher and multiple cores... For Copper we don't need OS, we need OS for file operations.
pandy71 is offline  
Old 25 April 2023, 14:28   #211
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
Quote:
Originally Posted by pandy71 View Post
Well... many purposes? Web browsing? 1080p movies edition?
So now i need to prove that accelerator boards are useful. This is becoming preposterous.


Quote:
Originally Posted by pandy71 View Post
Slowness that makes it useless.


Quote:
Originally Posted by pandy71 View Post
Perhaps... but still it is boring.
Waiting for copper program that will probably never come is boring, too.


Quote:
Originally Posted by pandy71 View Post
Well, but at the same this is compensated by clocks almost 1000 times higher and multiple cores...
Which have to support an OS that does million times more things, on a very poorly designed architecture.


Quote:
Originally Posted by pandy71 View Post
For Copper we don't need OS, we need OS for file operations.
Of course, but the OS will not let you touch the hardware so easily - provided it even works on a copper-equiped machine.
meynaf is offline  
Old 25 April 2023, 16:46   #212
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,397
Has anyone else lost the plot of this thread? Or is it just me?
Karlos is online now  
Old 25 April 2023, 19:22   #213
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,867
Quote:
Originally Posted by meynaf View Post
So now i need to prove that accelerator boards are useful. This is becoming preposterous.
you don't need to prove anything but simple accelerators are dead end and solutions like PIStorm are not considered by some people as accelerators but rather emulators - semantic from my perspective but still shows real limitations.

Quote:
Originally Posted by meynaf View Post
Slowness that makes it useless.
Sorry but don't share your view, having some HDL description of Agnus, Paula should provide neat way to simulate exactly and quite fast such situation also probably doing Copper audio should be easier...
Currently very complex logic is simulated in reasonable time thanks to modern HW so i think this is not slowness but complexity and lack of details preventing such simulator (WinUAE has embedded some general overview of DMA cycles so some work was already done on this)

Quote:
Originally Posted by meynaf View Post
Waiting for copper program that will probably never come is boring, too.
real life... i'm waiting one year for guys to finish my roof tiling... I can wait longer than year for Copper audio - trust me... no rush on Copper audio from my side.


Quote:
Originally Posted by meynaf View Post
Which have to support an OS that does million times more things, on a very poorly designed architecture.
I agree but still millions and millions are quite happy with results...


Quote:
Originally Posted by meynaf View Post
Of course, but the OS will not let you touch the hardware so easily - provided it even works on a copper-equiped machine.
You told me earlier that 'the OS' is not aware of Copper so this is bit contradictory...
pandy71 is offline  
Old 25 April 2023, 19:49   #214
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,182
Quote:
Originally Posted by Karlos View Post
Has anyone else lost the plot of this thread? Or is it just me?

It's a coming of age story. The young man (Ross) wants to prove himself by showing his father (Meynaf) that he can make a name for himself by creating copper driven audio, but first he has to overcome some challenges/distractions doing CPU driven audio to show his worth. It's one of those artsy movies where it's OK to skip to the third act if you're bored.
paraj is offline  
Old 25 April 2023, 19:58   #215
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
Quote:
Originally Posted by pandy71 View Post
you don't need to prove anything but simple accelerators are dead end and solutions like PIStorm are not considered by some people as accelerators but rather emulators - semantic from my perspective but still shows real limitations.
Being limited does not make them useless.


Quote:
Originally Posted by pandy71 View Post
Sorry but don't share your view, having some HDL description of Agnus, Paula should provide neat way to simulate exactly and quite fast such situation also probably doing Copper audio should be easier...
Currently very complex logic is simulated in reasonable time thanks to modern HW so i think this is not slowness but complexity and lack of details preventing such simulator (WinUAE has embedded some general overview of DMA cycles so some work was already done on this)
The point was about 68000, not about modern HW.


Quote:
Originally Posted by pandy71 View Post
real life... i'm waiting one year for guys to finish my roof tiling... I can wait longer than year for Copper audio - trust me... no rush on Copper audio from my side.
Does not make it less boring.


Quote:
Originally Posted by pandy71 View Post
I agree but still millions and millions are quite happy with results...
I don't think so.


Quote:
Originally Posted by pandy71 View Post
You told me earlier that 'the OS' is not aware of Copper so this is bit contradictory...
These OSes do not know anything about Copper. They will not let you access hardware. They probably don't even run on hardware that has a copper. Nothing contradictory here.
meynaf is offline  
Old 25 April 2023, 19:59   #216
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,867
Quote:
Originally Posted by paraj View Post
It's a coming of age story. The young man (Ross) wants to prove himself by showing his father (Meynaf) that he can make a name for himself by creating copper driven audio, but first he has to overcome some challenges/distractions doing CPU driven audio to show his worth. It's one of those artsy movies where it's OK to skip to the third act if you're bored.
Good one, remains script for Shrek - but perhaps this will be more dramatic:

"Ross, you can destroy the Paula AUDxPER limitations. Jay has foreseen this. Join me and together we can rule the galaxy as father and son."



Sorry, can't resist...
pandy71 is offline  
Old 25 April 2023, 20:13   #217
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,867
Quote:
Originally Posted by meynaf View Post
Being limited does not make them useless.
Never said such thing... but simply there is no real accelerator capable to decode mp3, resample it with sane quality (let say -76dBFS i.e. 12 bit quality in Paula 14 bit mode) and play it in CPU mode to Paula offering at the same time some limited multitasking so you can pretend to working.

Quote:
Originally Posted by meynaf View Post
The point was about 68000, not about modern HW.
I'm talking about HDL simulator using code proven on physical device (for example replacing original Paula, Agnus) and similar for MC68000 - they are accurate MC68000 emulators also clock perfect HDL descriptions. And HDL simulators are reasonably fast so probably whole A500 (nowadays it is not so complex project) probably could be simulated with decent speed.

Quote:
Originally Posted by meynaf View Post
Does not make it less boring.
Waiting IS boring but i hope you not suffer from onychophagia.

Quote:
Originally Posted by meynaf View Post
I don't think so.
Microsoft profits shows something opposite but if you say so...


Quote:
Originally Posted by meynaf View Post
These OSes do not know anything about Copper. They will not let you access hardware. They probably don't even run on hardware that has a copper. Nothing contradictory here.
They can't block access to memory address if they are not forbidden to be accessed (this is my impression but i can be wrong on this)
pandy71 is offline  
Old 25 April 2023, 20:15   #218
Karlos
Alien Bleed
 
Karlos's Avatar
 
Join Date: Aug 2022
Location: UK
Posts: 4,397
Can we get a TLDR on:

1. What is copper audio?
2. What are the proposed advantages of copper audio over regular Paula/DMA or AHI?

Somewhere in all the back and forth I lost it.
Karlos is online now  
Old 25 April 2023, 20:37   #219
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,351
Quote:
Originally Posted by pandy71 View Post
Never said such thing... but simply there is no real accelerator capable to decode mp3, resample it with sane quality (let say -76dBFS i.e. 12 bit quality in Paula 14 bit mode) and play it in CPU mode to Paula offering at the same time some limited multitasking so you can pretend to working.
By itself mp3 is bad enough so that you don't need perfect sound system to play it.
Anyway, vampires (68080) are supposed to have higher audio dma limits and 16-bit sound.


Quote:
Originally Posted by pandy71 View Post
I'm talking about HDL simulator using code proven on physical device (for example replacing original Paula, Agnus) and similar for MC68000 - they are accurate MC68000 emulators also clock perfect HDL descriptions. And HDL simulators are reasonably fast so probably whole A500 (nowadays it is not so complex project) probably could be simulated with decent speed.
I hope this is a misunderstanding.
The point has never been to emulate a 68000. It was about the 68000 itself doing clock-by-clock simulation ! (Which is obviously impossible.)


Quote:
Originally Posted by pandy71 View Post
Waiting IS boring but i hope you not suffer from onychophagia.
It's you who are waiting, not me.


Quote:
Originally Posted by pandy71 View Post
Microsoft profits shows something opposite but if you say so...
You know full well that superior marketing beats out superior products.
Btw. Didn't they have to fire quite a few people recently ?


Quote:
Originally Posted by pandy71 View Post
They can't block access to memory address if they are not forbidden to be accessed (this is my impression but i can be wrong on this)
They probably require working mmu so yes they can forbid anything.



Quote:
Originally Posted by Karlos View Post
1. What is copper audio?
It is about sending audio data to D/A with the copper rather than regular audio DMA (or cpu).


Quote:
Originally Posted by Karlos View Post
2. What are the proposed advantages of copper audio over regular Paula/DMA or AHI?
Well, other people may answer this 'better' because for me it has none
meynaf is offline  
Old 25 April 2023, 20:39   #220
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,182
Quote:
Originally Posted by Karlos View Post
Can we get a TLDR on:

1. What is copper audio?
2. What are the proposed advantages of copper audio over regular Paula/DMA or AHI?

Somewhere in all the back and forth I lost it.

Goal is to play samples at a rate higher than DMA mode allows (way back from start this was set at period ~124/28Khz).
To do that you need to play audio in non-DMA mode, which requires 1) clearing interrupt request bit (in INTREQ) 2) feeding new sample(to AUDxDAT) in time for audio state machine to not exit play loop (see HRM).

Normal way: Setup level 4 interrupt handler to clear interrupt bit(s) and feed new data (latest code by Ross does this). Alternatively just poll interrupt bit instead of having IRQ routine (my last code in this thread does this).
Copper audio: Kill OS and figure out when interrupt needs to be cleared (by write to INTREQ) and write AUDxDAT using copper.

Advantage of copper audio (supposedly): CPU and blitter can be used freely (if you use pure CPU method you run into the issues discussed previously).
Disadvantage: Hasn't been done before, needs Ross to (supposedly) do it, and copper list has to be extremely exact.
paraj 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
"EaglePlayer" playback VS "real" playback chip support.Other 31 27 September 2020 13:14
winuae 3.4.0 - cd playback honx support.WinUAE 10 26 February 2017 00:00
XBox 1 video playback Peter Retrogaming General Discussion 19 18 January 2011 16:33
Q: recording 4-channels sound output and "Playback Rate" jbl007 support.WinUAE 0 07 June 2005 18:23
DivX Playback Echo support.Hardware 10 24 January 2003 18:45

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 11:54.

Top

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