Jump to content

Photo

U-235 SoundEngine released!


146 replies to this topic

#126 swapd0 ONLINE  

swapd0

    Moonsweeper

  • 414 posts

Posted Mon Apr 15, 2019 7:12 AM

I get an address error when I call any function (offset + 0, offset + 2 or offset + 4).



#127 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Mon Apr 15, 2019 8:10 AM

As I said my brain isn't really working due to lurgy :), realised my mistake after I posting, will sort out an updated inc file or something.


Edited by LinkoVitch, Mon Apr 15, 2019 8:11 AM.


#128 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Mon Apr 15, 2019 1:03 PM

This cold is really destroying my ability to function, sorry I only just read you last message.  That blob is full of fail sorry.  I have a working version in the pipes at the moment now.  Just tidying up complete with appropriate include file etc.  Will get it to you hopefully shortly.



#129 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Mon Apr 15, 2019 1:32 PM

OK, attached a working version, complete with support files and example.

 

If you look at the `reloc-main.s` and compare to the main.s code you can see the difference in calls, also use the `u235se-rel.inc` for referencing the variables in the SE once it is loaded into the DSP.

 

if you have RMAC/RLN installed, running make should build you the main.cof and reloc.cof examples, both just play the ALF.mod, but proves all working ticketyboo

 

I need to update the manual and a few other bits but hopefully this should work fine with any non-RLN builds as the u235-rel.bin is just an ABS binary blob.  (you will need to leave it in place once you init the SE from it, don't reuse the memory or anything as it also contains a timing LUT which may be needed depending on the mod)

 

Previous crash you had was probably due to me being a numpty and leaving a header on the binary blob! oops! :D  Bloody colds!

Attached Files



#130 swapd0 ONLINE  

swapd0

    Moonsweeper

  • 414 posts

Posted Tue Apr 16, 2019 7:54 AM

It works! Thanks!

 

But I've some issues, some sounds are ok, but others sound noisy or like duplicated.


Edited by swapd0, Tue Apr 16, 2019 8:06 AM.


#131 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Tue Apr 16, 2019 9:28 AM

Are all your samples 8bit signed samples?  At the moment there is only support for signed samples.  If you are using 16bit or unsigned samples these can sound pretty terrible.  If you want me to have a look at the samples in question email them over to me.



#132 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Tue Apr 16, 2019 10:00 AM

Also if you use a module that uses the more advanced (Pro-Tracker?) timings (Fxx command with a value => 20) then you will just get silence and possible DSP crash, just found another couple of typo's.  Any mod that uses F values less than that will be fine however :)



#133 swapd0 ONLINE  

swapd0

    Moonsweeper

  • 414 posts

Posted Tue Apr 16, 2019 11:12 AM

For now I've tested it with classic kong (only samples, no mod), and ST-NICCC 2000 just a mod. I only have issues with Classic Kong, all samples played ok with vbcc and older version of u235se. The issues I've found are:

 

1 - game start sample it's noisy.

2 - 'Help me' sample ok, but it's like it plays two times, you can hear "Help... Help me", it's weird.

3 - I've a function that plays a sample in a "ring" (channel 0, channel 1, channel 2... , channel 7, channel 0...) and depending on the channel they sound with a lower volume. It's weird because I've a table with each channel volume and all are set to 64.

 

I've tested that the alignment it's ok, all samples are created into the heap and unpacked from the cartridge, and my malloc routines align the data to 32 bytes.

 

I need to do more testing with other games.

 

PD: yes, all samples are 8bit signed


Edited by swapd0, Tue Apr 16, 2019 11:12 AM.


#134 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Tue Apr 16, 2019 2:25 PM

Here is a patched binary blob for you anyway, should work fine with the inc you have already, but fixes the bugs I mentioned.

 

Your current issues do sound very weird! can't think of a reason for any of those issues if they worked on previous engine versions, I've not made any changes to the core of the engine for the tweaks in the version you have.

Attached Files



#135 dilinger OFFLINE  

dilinger

    Star Raider

  • 65 posts
  • Location:Montreal

Posted Tue Apr 16, 2019 3:22 PM

Hi,

 

I have tried your new package within the ELF format and I have the same issues as the previous package.

 
I got some warnings in u235se.inc, not a big deal but just had the wish to report them.
The symbol <U235SE_sfxplaylist_ptr> is defined 2 times; the remaining warnings are redefinition symboles: U235SE_ptr_sample_bank, U235SE_playmod and a_vde.
There are also various imported symbols not referenced but doesn't prevent the assembly.
 
Unfortunately, I'm not able yet to have a ELF executable due to the reference to undefined symbols:
 
U235SE_playback_rate
U235SE_playback_period
U235SE_ptr_sample_bank
U235SE_playmod
U235SE_pad1
U235SE_playmod
U235SE_sfxplaylist_ptr


#136 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Wed Apr 17, 2019 3:57 AM

The doubly defined symbols are likely due to you having the u235se.inc file included multiple times within your source.  I am not 100% if the ELF object is correctly generated I haven't put much time into looking at that, sorry.

 

You could use the binary blob version instead however, this removes the need for you to link against the SoundEngine and you can just include it as binary.



#137 CyranoJ ONLINE  

CyranoJ

    RAPTOR Wrangler

  • 5,806 posts
  • reBOOTed
  • Location:Adelaide, SA

Posted Wed Apr 17, 2019 4:02 AM

It's weird because I've a table with each channel volume and all are set to 64.

 

Been there, done that - try 63 ;)

Although I find anything above 40-ish can distort if the sample is already quite loud



#138 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Wed Apr 17, 2019 4:29 AM

 

Hi,

 

I have tried your new package within the ELF format and I have the same issues as the previous package.

 
I got some warnings in u235se.inc, not a big deal but just had the wish to report them.
The symbol <U235SE_sfxplaylist_ptr> is defined 2 times; the remaining warnings are redefinition symboles: U235SE_ptr_sample_bank, U235SE_playmod and a_vde.
There are also various imported symbols not referenced but doesn't prevent the assembly.
 
Unfortunately, I'm not able yet to have a ELF executable due to the reference to undefined symbols:

 

Sorry, just noticed I actually have 2 bug cards raised for these exact issues in my bugs list.  So they are still active.  I will try to remove one or both of them with the actual release of 0.24 which hopefully I will do in a shortish amount of time.  I was just posting those zip files here for swapd0's project so they were not holding him back.



#139 swapd0 ONLINE  

swapd0

    Moonsweeper

  • 414 posts

Posted Wed Apr 17, 2019 7:41 AM

I've modified the reloc-main.s to use my sound engine and I've seen the following issues, it should only play sounds with button 1 & button 2.

 

- Press several times 1 and you'll hear the same sound but sightly different.

- If you press 2... nothing happens, I've looked at the code and I haven't found the error, you should hear "Help me".

Attached Files


Edited by swapd0, Wed Apr 17, 2019 7:41 AM.


#140 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Wed Apr 17, 2019 8:00 AM

I will have a proper lookie at this later, but from my 1st quick scan though, why are you defining sample banks with only one sample each time?  That is possibly going to cause weird problems.

 

I would recommend you define 1 sample bank with your samples in, and declare it once, and then make calls to play the samples in that bank when you need them. eg:

.LONG
sample_bank:
    dc.l sample_1
    dc.l sample_2
    dc.l 0
    dc.l 0
    dc.l 64
    dc.l 8000/2
    dc.l sample_2
    dc.l sample_end
    dc.l 0
    dc.l 0
    dc.l 64
    dc.l 8000/2

sample_1:
    incbin "sample20.raw"
sample_2:
    incbin "pauline_help_me.raw"
sample_end:

Then you can call each sample number to play it, either at the freq in the bank or a specified freq (depending on instruction).

The only time you need to set a bank is if you have multiple sample banks and need to switch to another, once it is set, it is not changed.  This isn't terribly clear in the example code, I'll add a note to rectify that.



#141 swapd0 ONLINE  

swapd0

    Moonsweeper

  • 414 posts

Posted Wed Apr 17, 2019 9:02 AM

Ok, I thought that I had to declare a sample bank for each sample, but it's a sample bank, so you can declare many samples in a row. I misunderstood the manual.



#142 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Wed Apr 17, 2019 10:48 AM

It's one of those "Makes perfect sense in my head" kind of things :) alas (fortunately :) ) no one else can know what is going on in my head :)



#143 swapd0 ONLINE  

swapd0

    Moonsweeper

  • 414 posts

Posted Thu Apr 18, 2019 5:06 AM

With an example with two samples on the same bank it's enough to know how it works.



#144 swapd0 ONLINE  

swapd0

    Moonsweeper

  • 414 posts

Posted Thu Apr 18, 2019 9:59 AM

F*ck, I got sound in the test program (asm code) but not in Classic Kong (C code)...



#145 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Yesterday, 3:04 PM

sorry for delay, finally gotten around to playing with this on real hardware.

 

1st issue of only one sample playing (in the case of your example code).  This is due to you using multiple sound banks, in that a sound bank MUST be Double-Phrase aligned (we wipe out the low nibble for the set command).  So your first bank is happening to be OK, but the second isn't. 

 

I am trying to figure out why the pauline sample seems to play at half speed, that is completely bizarre!



#146 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Yesterday, 3:10 PM

And the fix for the slow playback is that the defines for 24KHZ playback rate are significantly out!  If you switch to the default 16kHz, it sounds correct.  I'll add that to the bugs list also.



#147 LinkoVitch OFFLINE  

LinkoVitch

    River Patroller

  • Topic Starter
  • 2,667 posts
  • Location:Manchester UK

Posted Yesterday, 3:32 PM

Actually scratch that sorry.  Took me a while to fathom.. The slow sounding samples is due to you changing the playback_rate and period AFTER the SE code has been started.  These need to be set After the initNTSC/initPAL but before you actually start the DSP.  The values used setup the timers for sample playback and are used to calculate the synthetic frequencies, so if you change them after the timers are set.. weirdness.

 

Sorry it took me so long to get to this. 






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users