English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 14 July 2016, 21:40   #21
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Sounds like useless "it does not work" comment. I don't like them.

--

Toccata is stupid board. "uaesnd" "board" is coming..
Toni Wilen is offline  
Old 14 July 2016, 21:45   #22
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by Nut View Post
Toni or anyone, could you please write small example code of how to use Toccata in assembly. I want to support this to get perfect audio out of WinUAE.
Could be good to have some Toccata asm.

However it doesn't really solve the problem. Toccata support must be enabled, and it probably isn't in most configs.

Quote:
Originally Posted by Nut View Post
I'm doing software mixing 32bit and getting it out 14bit now using interrupts or copper but this has many problems on the emulator. All kinds of noises appear do to multiple reasons.
I've had no trouble using 14bit with the emulator, as long as it's not calibrated (the d/a output isn't necessarily linear, but the channel mixing is).

My advice is : don't attempt to use the copper for audio. It's useless, as it has no way to get in sync with paula.
If you want to bypass the 28khz limit with interrupts, then you're similarly out of luck. I tried, and channels were always out of sync.

I'm now wondering how complicated it would be to use native code and call the waveout (or whatever api) directly...
meynaf is offline  
Old 15 July 2016, 00:45   #23
chaos
Registered User
 
chaos's Avatar
 
Join Date: Mar 2013
Location: Slovenia
Posts: 138
Quote:
Originally Posted by Toni Wilen View Post
What do you think of this?
That sounds interesting. Maybe I could 'borrow' this hardware for minimig

It would be nice if this was a Zorro device, even nicer if it wouldn't use chipRAM.
chaos is offline  
Old 15 July 2016, 20:34   #24
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Quote:
Originally Posted by chaos View Post
That sounds interesting. Maybe I could 'borrow' this hardware for minimig

It would be nice if this was a Zorro device, even nicer if it wouldn't use chipRAM.
It is Z2/Z3 autoconfig board (of course it is, thats the Amiga way!). Any RAM is supported. But I designed it to be as simple as possible to program from Amiga side which means emulator side logic can be quite complex.

Register design and emulation is already mostly done but I haven't done any testing whatsoever.. Thats the point where interesting becomes boring..

Quote:
Originally Posted by meynaf View Post
Could be good to have some Toccata asm.
Problem is that when I do emulation that only needs to be compatible enough (not timing sensitive etc), I take working driver as an example, then add emulation features until it works (+some extra if it is obvious from chips data sheet).

Reverse operation of writing "driver" is very difficult and complex and extremely boring, at least if you also want it to work with real Toccata. Lots of DAC chip initialization is needed. And because it is PIO (like all non-PCI Amiga sound cards), you need to write samples to card's buffer with CPU in interrupt routine which makes it annoying to use from programmer point of view.
Toni Wilen is offline  
Old 08 October 2016, 16:35   #25
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Very quick and dirty uaesnd example assembly attached that plays single channel 16 word sample with changing frequency.

Maybe it gets better later.. (at least someone should do proper asm and C header files. I don't use asm includes normally, they are only annoying when doing tiny programs)

Current "hardware" documentation is here: https://github.com/tonioni/WinUAE/bl...r/sndboard.cpp

(3.4.0b11+ required)
Attached Files
File Type: s uaesnd_test.s (3.0 KB, 107 views)
Toni Wilen is offline  
Old 29 October 2016, 15:44   #26
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Another example. Plays wav sound file. 44100Hz/stereo/16-bit wave only. No wav-file parsing to keep example as simple as possible.
Attached Files
File Type: s uaesnd_test2.s (5.1 KB, 103 views)
Toni Wilen is offline  
Old 29 October 2016, 17:40   #27
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Would it be possible to have an extra flag in the interrupt status byte that disables EXTER interrupt requests and only handles internal interrupt flag ?
This is for simple polling. For normal Amiga audio INTREQ bits can be read with the relevant interrupt disabled, but here we're not alone on EXTER...

Another thing. What happens if the repeat addr/len are set but the sample has already stopped ? For example, sample is run, second buffer is filled and we then set the repeat... but we were too slow so the sample has already stopped.
This is to avoid buffer repetitions in case of overrun ; i set the sample with silent repeat, then fill the second buffer, then set the repeat. Therefore setting the repeat alone should start it immediately if nothing's currently being played.
meynaf is offline  
Old 30 October 2016, 12:44   #28
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Quote:
Originally Posted by meynaf View Post
Would it be possible to have an extra flag in the interrupt status byte that disables EXTER interrupt requests and only handles internal interrupt flag ?
This is for simple polling. For normal Amiga audio INTREQ bits can be read with the relevant interrupt disabled, but here we're not alone on EXTER...
That flag is only for enabling EXTER interrupt sources, it is not interrupt status flag (sample structure is never written by the emulator).

Check the hardware status register for pending interrupts. It is always valid, with or without enabled interrupts.

Quote:
Another thing. What happens if the repeat addr/len are set but the sample has already stopped ? For example, sample is run, second buffer is filled and we then set the repeat... but we were too slow so the sample has already stopped.
This is to avoid buffer repetitions in case of overrun ; i set the sample with silent repeat, then fill the second buffer, then set the repeat. Therefore setting the repeat alone should start it immediately if nothing's currently being played.
I am not sure if I understood correctly but why not always set empty repeat (with very short size). This way sample never stops and you can write new updated repeat sample pointer and size when needed. (write sample pointer first, make sure first sample is same as previous "idle" sample to prevent pops if size write is delayed by one or more sample periods)
Toni Wilen is offline  
Old 31 October 2016, 08:24   #29
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by Toni Wilen View Post
I am not sure if I understood correctly but why not always set empty repeat (with very short size). This way sample never stops and you can write new updated repeat sample pointer and size when needed. (write sample pointer first, make sure first sample is same as previous "idle" sample to prevent pops if size write is delayed by one or more sample periods)
By doing so I might eventually see spurious interrupt requests triggered by the empty samples (or miss normal ones if i clear the irq after setting repeat).

Btw. As it's the size write that runs normal sample, it seems logic to me that the repeat address should be taken into account only when repeat length is written - this way nothing bad can occur between the two writes. This is how my current audio interface works.
meynaf is offline  
Old 31 October 2016, 11:30   #30
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
What about if there is special repeat length value (for example 0x80000000) that means "when sample ends and replen=0x80000000: pause until repeat length is changed"?

"Normal" sample length can also have same feature if needed.
Toni Wilen is offline  
Old 31 October 2016, 12:01   #31
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
I guess this would work. Looks odd, though.

I'd prefer having a simple global flag indicating that setting the repeat makes it start immediately if no sample is playing. This way, one can set repeat+replen alone for looping samples.

A good way to prevent pops - or any kind of race condition - would be to have some kind of strobe committing the changes. The structure can then be changed safely.
In addition, with this way several streams can be perfectly in sync, which is important for tracker music.
meynaf is offline  
Old 31 October 2016, 13:08   #32
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
Perhaps non-zero address + zero length look more sane. (Address can be freely changed, unpause happens only when length becomes non-zero)

Note that most important feature for me is that each stream can function completely separately, there can be multiple users at the same time without side-effects and without need for single driver software, for example some program(s) can use it via AHI while some other program can access it directly without danger of conflicts by using hardware allocation bits as documented.

Thats why only global setting is stream on/off and play on/off bit masks (can be used to start/stop multiple streams at the exact same time). Do you really need other global options?

There is already "latch" operation, one access to create atomically copy of stream's current parameters, another access to write it back atomically.

Does it help if multiple streams (hopefully those that you allocated..) can be latched/written back simultaneously? (using new global bit mask register)
Toni Wilen is offline  
Old 31 October 2016, 14:07   #33
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
Quote:
Originally Posted by Toni Wilen View Post
Perhaps non-zero address + zero length look more sane. (Address can be freely changed, unpause happens only when length becomes non-zero)
Yes, as long as setting normal size to zero immediately stops playing.


Quote:
Originally Posted by Toni Wilen View Post
Note that most important feature for me is that each stream can function completely separately, there can be multiple users at the same time without side-effects and without need for single driver software, for example some program(s) can use it via AHI while some other program can access it directly without danger of conflicts by using hardware allocation bits as documented.

Thats why only global setting is stream on/off and play on/off bit masks (can be used to start/stop multiple streams at the exact same time). Do you really need other global options?
The only global option that's really needed is the ability to run/stop separate streams in sync.
Most 'global' options are perfectly fine at the stream scope.

One thing that doesn't go well with trackers is the replay frequency. Using Hz isn't precise enough to play exactly like Amiga periods.
A stream "base frequency" value, along with a period, would do the trick : we'd then use (3546895, per) for Amiga hw, (44100, 1) for cd-like, etc (iow the replay freq wouldn't be an int but a fraction).


Quote:
Originally Posted by Toni Wilen View Post
There is already "latch" operation, one access to create atomically copy of stream's current parameters, another access to write it back atomically.
Fine, if of course it doesn't trigger sample restarts when the sample size hasn't been written.


Quote:
Originally Posted by Toni Wilen View Post
Does it help if multiple streams (hopefully those that you allocated..) can be latched/written back simultaneously? (using new global bit mask register)
Yes this is ok.
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
Bypassing the Amiga trademark Anakirob Amiga scene 10 06 March 2012 13:51
Better Paula 8bitbubsy Hardware mods 20 28 November 2011 10:51
Paula output rate snyp Coders. General 5 18 February 2009 02:32
Who designed Paula? thinlega Amiga scene 18 16 September 2005 16:45
Bypassing windows printer drivers mtb support.WinUAE 4 19 September 2002 22:23

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 06:22.

Top

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