English Amiga Board


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

 
 
Thread Tools
Old 26 April 2021, 23:03   #1
8bitbubsy
Registered User
 
8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,710
xmaplay - My asm port of FT2's XM replayer for 68020+ Amigas

I'm currently porting Fasttracker II's XM replayer to 68020+ Amigas, using the original source codes.
I know that we have PS3M for HippoPlayer, but its XM support is not only inaccurate, but buggy. It has no channel panning support either.

If anyone wants to try it out, here's the program + source (Asm-Pro syntax):
Lo-fi 68020+ version: https://16-bits.org/etc/xmaplay020_v048.zip
Better-fi 68060/Vampire version: https://16-bits.org/etc/xmaplay060_v046.zip

The 68060 version has about the same output quality as FT2 v2.08/2.09 (linear interpolation + vol ramp + 32-bit mix), though only 14-bit output at 27710Hz. The 14-bit audio is uncalibrated and can sound noisy on some Amigas.

If you see something that is done wrong, or something that can be improved, I'd love to hear from you.

Last edited by 8bitbubsy; 30 June 2023 at 18:11.
8bitbubsy is offline  
Old 27 April 2021, 06:47   #2
koobo
Registered User
 
koobo's Avatar
 
Join Date: Sep 2019
Location: Finland
Posts: 361
A related side note

Now that PS3M (by Jarno Paananen) was mentioned I have to say that it had quite a genius mixing mechanism. It only used interrupts for very light work, that is, to keep track at which position Paula was doing the playback in the mixing (ring) buffers.

The actual grunt work of music playback and mixing was done in a low priority task with no critical timing requirements. This meant that you could play 8 channel modules on an A500 with reasonable quality with not much apparent slow down in system usage, as the task scheduler ensured that only idle time was used for mixing work.

The mixing buffer size was large enough that if the mixing task was interrupted for a while, that didn't matter as it could catch up later.

This is not true for interrupt based mixers, which continuously do heavy mixing operations inside interrupts and create a sluggish overall feeling when using the system. This is why I never used anything other than PS3M (in HippoPlayer) to listen to multi channel modules back in the day
koobo is online now  
Old 27 April 2021, 08:52   #3
Steffest
Registered User
 
Join Date: Jan 2017
Location: Antwerp / Belgium
Posts: 189
Hooray!
Super awesome!
Are you planning to build a full tracker around it?

(I would love to build one but currently that's still out of my league)

I gave your player a spin.
Works perfectly on Vampire.
On my 1200 with Blizzard 1230, it does play nicely but the screen starts glitching like mad. Probably the system resources are drained.
I'm already very pleased with the audio quality of the 020 version.

Excellent work!

Last edited by Steffest; 27 April 2021 at 10:05.
Steffest is offline  
Old 27 April 2021, 11:26   #4
8bitbubsy
Registered User
 
8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,710
Quote:
Originally Posted by koobo View Post
Now that PS3M (by Jarno Paananen) was mentioned I have to say that it had quite a genius mixing mechanism. It only used interrupts for very light work, that is, to keep track at which position Paula was doing the playback in the mixing (ring) buffers.

The actual grunt work of music playback and mixing was done in a low priority task with no critical timing requirements. This meant that you could play 8 channel modules on an A500 with reasonable quality with not much apparent slow down in system usage, as the task scheduler ensured that only idle time was used for mixing work.

The mixing buffer size was large enough that if the mixing task was interrupted for a while, that didn't matter as it could catch up later.

This is not true for interrupt based mixers, which continuously do heavy mixing operations inside interrupts and create a sluggish overall feeling when using the system. This is why I never used anything other than PS3M (in HippoPlayer) to listen to multi channel modules back in the day
Interesting, maybe I should try to copy that specific code from PS3M (and give credits to him, of course).
This would also make the code more system-friendly, as it is not directly taking over Paula, IIRC.

Quote:
Originally Posted by Steffest View Post
Are you planning to build a full tracker around it?
Probably not, but you never know... That would have to be for 68060/Vampire, though, as that's the version of xmaplay I'm the most pleased with.

Quote:
Originally Posted by Steffest View Post
On my 1200 with Blizzard 1230, it does play nicely but the screen starts glitching like mad.
What kind of glitching? All I get on my A1200 68030 when it's playing a too heavy song is delayed mouse pointer movement and a slow system. Your symptoms almost sound like it's doing something very nasty, can you tell me what song you played?

Last edited by 8bitbubsy; 27 April 2021 at 12:45.
8bitbubsy is offline  
Old 27 April 2021, 13:03   #5
Steffest
Registered User
 
Join Date: Jan 2017
Location: Antwerp / Belgium
Posts: 189
Quote:
Originally Posted by 8bitbubsy View Post
What kind of glitching? All I get on my A1200 68030 when it's playing a too heavy song is delayed mouse pointer movement and a slow system. Your symptoms almost sound like it's doing something very nasty, can you tell me what song you played?
It's with all songs, but I've narrowed it down to the rather insane high screen-resolution I use of 1280x720 (with an Indivision)
I made a video showing the glitching:

When I lower the screen resolution to the more common ones, all is fine.
Steffest is offline  
Old 27 April 2021, 13:05   #6
8bitbubsy
Registered User
 
8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,710
Quote:
Originally Posted by Steffest View Post
It's with all songs, but I've narrowed it down to the rather insane high screen-resolution I use of 1280x720 (with an Indivision)
I made a video showing the glitching:

When I lower the screen resolution to the more common ones, all is fine.
That's a bit odd, but maybe it's expected when long-duration interrupts get fired quite often? I don't know.
8bitbubsy is offline  
Old 27 April 2021, 13:33   #7
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
@8bitbubsy:
Sorry, for the unrelated question, but is there any way to get full stereo speration in your genius mac port of Protracker 2.3?
Worked a lot with it, but its a bit tiresome I have to check my tunes in the emu if they sound right...
Tigerskunk is offline  
Old 27 April 2021, 13:35   #8
8bitbubsy
Registered User
 
8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,710
Quote:
Originally Posted by Steril707 View Post
@8bitbubsy:
Sorry, for the unrelated question, but is there any way to get full stereo speration in your genius mac port of Protracker 2.3?
Worked a lot with it, but its a bit tiresome I have to check my tunes in the emu if they sound right...
Please read the included "help.txt" file in the release zip. Read the "* How do I change the stereo separation (panning)?" section.
Also PM me or use the official thread if you have more questions: https://eab.abime.net/showthread.php?t=54323

Last edited by 8bitbubsy; 27 April 2021 at 13:52.
8bitbubsy is offline  
Old 27 April 2021, 14:36   #9
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Quote:
Originally Posted by Steffest View Post
Are you planning to build a full tracker around it?
If you want to compose FT2 modules on Amiga you can use DigiboosterPro. Isn't there a port of Milkytracker for Vampire that can save XMs too.
daxb is offline  
Old 27 April 2021, 15:00   #10
nikosidis
Registered User
 
Join Date: Jan 2020
Location: oslo/norway
Posts: 1,607
Works nice with my Blizzard IV 030 Great sound quality.
The example song that is big in size does not work well but the others does. No screen flicker for me. Productivity screenmode. If you like I can test for 44.1 kHz as Productivity screenmode supports.

Thanks
nikosidis is offline  
Old 27 April 2021, 15:23   #11
Estrayk
Registered User
 
Estrayk's Avatar
 
Join Date: Apr 2015
Location: Spain
Posts: 511
wow! what a surprise! thx 8bitbubsy!
Estrayk is offline  
Old 27 April 2021, 15:27   #12
8bitbubsy
Registered User
 
8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,710
Quote:
Originally Posted by nikosidis View Post
The example song that is big in size does not work well but the others does.
This was actually a bug with converting 16-bit samples to 8-bit in xmaplay020. Fixed: https://16-bits.org/etc/xmaplay_v022b.zip
xmaplay060 can play 16-bit samples without down-converting them, but as said it requires a 68060 (or a Vampire) to be fast.

EDIT: xmaplay020 can actually sound better on some songs (especially chiptune-styled ones) because it uses no resampling interpolation, but xmaplay060 should sound much better on most songs.

Last edited by 8bitbubsy; 27 April 2021 at 15:48.
8bitbubsy is offline  
Old 27 April 2021, 16:18   #13
Amiga68k
Registered User
 
Amiga68k's Avatar
 
Join Date: Oct 2017
Location: Amsterdam
Posts: 231
Quote:
Originally Posted by 8bitbubsy View Post
I'm currently porting Fasttracker II's XM replayer to 68020+ Amigas, using the original source codes.
Great sound quality on the 060 here

I rebooted the Amiga with all the debugging (MuForce/MuGA) stuff enabled to understand if some serious issues could be found and I stumbled on something when MuGA is active. All songs (that otherwise work with the debugging stuff disabled), will refuse to load with the following message:

Code:
Opening module...
Loading pattern data...
Error: Out of memory, or corrupt/unsupported XM!
Error: Couldn't open file for reading!
The following MuGA hit is seen:

Code:
Bad_Program!
27-Apr-21  16:06:29
FreeMem of NULL pointer attempted, ignored.
PC  : 78602d68  USP: 7846044c ( )( )  Name: DATA:Downloads/xmaplay060
----> 78602d68 - "DATA:Downloads/xmaplay060"  Hunk 0 Offset 00000228
Data: 00020000 ffffffff 00000009 00000bcc 00000040 1e144e97 00000000 78600040
Addr: 786069bc 00000000 7860aa31 7846327e 7846317e 7bf6c208 SysBase  --------
Stck: 00020000 ffffffff 00000009 00000bcc 00000040 1e144e97 00000000 78600040
Stck: 786069bc 00000000 7860aa31 7846327e 7846317e 7bf6c208 000051dc 78606522
PC-8: 48e77ffe 2c780004 72024eae ff3a4cdf 7ffe4e75 48e7fffe 2c780004 4eaeff2e
PC *: 4cdf7fff 4e7548e7 40404219 04810000 000166f6 4cdf0202 4e7548e7 7ffe4ab9
78602d48 :  48e7 7ffe                  movem.l d1-a6,-(a7)
78602d4c :  2c78 0004                  movea.l $4.w,a6
78602d50 :  7202                       moveq.l #$2,d1
78602d52 :  4eae ff3a                  jsr -$c6(a6)
78602d56 :  4cdf 7ffe                  movem.l (a7)+,d1-a6
78602d5a :  4e75                       rts
78602d5c :  48e7 fffe                  movem.l d0-a6,-(a7)
78602d60 :  2c78 0004                  movea.l $4.w,a6
78602d64 :  4eae ff2e                  jsr -$d2(a6)
78602d68 : *4cdf 7fff                  movem.l (a7)+,d0-a6
78602d6c :  4e75                       rts
78602d6e :  48e7 4040                  movem.l d1/a1,-(a7)
78602d72 :  4219                       clr.b (a1)+
78602d74 :  0481 0000 0001             subi.l #$1,d1
78602d7a :  66f6                       bne.s $78602d72
78602d7c :  4cdf 0202                  movem.l (a7)+,d1/a1
78602d80 :  4e75                       rts
78602d82 :  48e7 7ffe                  movem.l d1-a6,-(a7)
78602d86 :  4ab9 7860 2c20             tst.l $78602c20
Amiga68k is offline  
Old 27 April 2021, 17:37   #14
nikosidis
Registered User
 
Join Date: Jan 2020
Location: oslo/norway
Posts: 1,607
Quote:
Originally Posted by 8bitbubsy View Post
This was actually a bug with converting 16-bit samples to 8-bit in xmaplay020. Fixed: https://16-bits.org/etc/xmaplay_v022b.zip
xmaplay060 can play 16-bit samples without down-converting them, but as said it requires a 68060 (or a Vampire) to be fast.

EDIT: xmaplay020 can actually sound better on some songs (especially chiptune-styled ones) because it uses no resampling interpolation, but xmaplay060 should sound much better on most songs.
Works now

This one crash my machine.

https://api.modarchive.org/downloads...mans_potion.xm
nikosidis is offline  
Old 27 April 2021, 20:28   #15
8bitbubsy
Registered User
 
8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,710
Quote:
Originally Posted by Amiga68k View Post
I rebooted the Amiga with all the debugging (MuForce/MuGA) stuff enabled to understand if some serious issues could be found and I stumbled on something when MuGA is active. [...]
Fixed. MuGA was taking over _LVOFreeMem and messing with the CPU flags, so my dirty way of not testing the pointer returned (but instead just doing "beq.s error") didn't work. Did it the correct way now.

Quote:
Originally Posted by nikosidis View Post
Fixed. It's an EVIL module though! It uses Dxx (pattern break) where xx is higher than the length of the next pattern. I made a patch to clear the current row if that happens. MilkyTracker and OpenMPT seems to do the same. Real FT2 doesn't, so it will sound slightly different, but this is the safest approach.
Also, that little burst of sound you hear in the beginning of this XM is actually how it sounds in real FT2 as well. It has to do with volumes not being updated in the current tick when it's setting the global volume to 0.

New version: https://16-bits.org/etc/xmaplay_v024b.zip

Last edited by 8bitbubsy; 27 April 2021 at 22:42.
8bitbubsy is offline  
Old 27 April 2021, 22:08   #16
colourspace
Registered User
 
colourspace's Avatar
 
Join Date: Apr 2020
Location: CHICAGO / USA
Posts: 32
great work! such low CPU usage compared to the XM players i've used in eagleplayer!
colourspace is offline  
Old 27 April 2021, 22:42   #17
8bitbubsy
Registered User
 
8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,710
Quote:
Originally Posted by colourspace View Post
great work! such low CPU usage compared to the XM players i've used in eagleplayer!
Thanks.

Released a new version now that supports a command line argument with quotes in it (f.ex. from Dopus).
https://16-bits.org/etc/xmaplay_v025b.zip
8bitbubsy is offline  
Old 28 April 2021, 00:12   #18
nikosidis
Registered User
 
Join Date: Jan 2020
Location: oslo/norway
Posts: 1,607
8bitbubsy:

Can you try this one? I get some error message.

https://amp.dascene.net/downmod.php?index=149869
nikosidis is offline  
Old 28 April 2021, 10:43   #19
spoUP
Registered User
 
Join Date: Dec 2002
Location: sweden
Age: 46
Posts: 430
Wow! Love you bubby! I hope my bouncer gets well soon so i can return to irc!
spoUP is offline  
Old 28 April 2021, 11:12   #20
8bitbubsy
Registered User
 
8bitbubsy's Avatar
 
Join Date: Sep 2009
Location: Norway
Posts: 1,710
Quote:
Originally Posted by nikosidis View Post
8bitbubsy:

Can you try this one? I get some error message.

https://amp.dascene.net/downmod.php?index=149869
It has more than 32 channels. FT2 doesn't support that.
8bitbubsy 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
Tool to convert asm to gnu asm (gas) Asman Coders. Asm / Hardware 13 30 December 2020 11:57
ASM: Asm-ONE or AsmPro - how to set a Hello amiga coders, I hope it is ok to hijack ? Fireball Coders. Asm / Hardware 2 24 April 2020 21:16
Asm: 4 bitplanes starfield (68020+) alkis Coders. Asm / Hardware 20 06 September 2013 07:30
Replayer archive? absence Coders. General 4 17 March 2011 14:24
Best MOD replayer RickyD-II Coders. General 8 09 July 2007 03:04

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 17:50.

Top

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