Jump to content
LinkoVitch

U-235 SoundEngine released!

Recommended Posts

Sounds like you have sorted it? One thing to be aware of is if you stop a mod that has looping samples, these will continue to play after the mod processing stops, which is where sending stop commands or volume commands to voices 0-3 is needed too.

 

 

Share this post


Link to post
Share on other sites

Well, I'm still confused how to stop all 4 module channels.

I know how to deal with the general volume (writing to U235SE_music_vol).

 

I understand the 4 commands CJ wrote (I suppose I can use "Stop Voice" too) but I don't know where to write those commands...

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
_stop_sound_system::
	lea playlist,a0							; The address of the sound effect playlist

	moveq #15,d0
	move.l d0,(a0)+
	clr.l (a0)+

	move.l #playlist,U235SE_sfxplaylist_ptr

	lea U235SE_status_reg,a0
.wait:
	move.w #0,BG
    move.l (a0),d0
	move.w #3456,BG
    cmp.l #U235SE_SRMSK_ALL_STOPPED,d0
    bne.s .wait
	rts

My routine to stop the u235 sound system, the move BG it's to see what is going... why it never return? it's copy&paste from the sample code

Share this post


Link to post
Share on other sites

This is the code, I've just inserted the print_d0:

_stop_sound_system::
	lea playlist,a0							; The address of the sound effect playlist

	moveq #15,d0
	move.l d0,(a0)+
	clr.l (a0)+

	move.l #playlist,U235SE_sfxplaylist_ptr

	lea U235SE_status_reg,a0
.wait:
	move.w #0,BG
    move.l (a0),d0
	jsr _skunk_print_d0			; ***
	move.w #3456,BG
    cmp.l #U235SE_SRMSK_ALL_STOPPED,d0
    bne.s .wait
	rts

And this is the output.

 

00000000
30303030
33303330
33333330
33333333
33333333
33333333

 

Share this post


Link to post
Share on other sites

I'm confused.  So you say you now have it working?

 

Regarding the output, is each line a hex representation of what is in D0? as that doesn't look right at all?

Share this post


Link to post
Share on other sites

Sorry, the sound is stopped but it waits forever in the wait loop, but I think that I can remove that wait because I don't upload anything into the DSP for about one second later.

 

And yes, that is the output of the d0 register, I send the value to the skunk board after reading it.

 

Share this post


Link to post
Share on other sites

The All stop stops the entire sound engine so that the DSP can safely have the code replaced, not just stopping all sounds (just to be clear).

 

That doesn't look right for the value of the status register.  Whatever is doing the conversion to hex looks wrong.

 

If the Pad read and RNG are enabled and everything is running I would expect that register to look like:
C0000000

possibly

C0000010

 

3 would only appear if stop had been issued and the I2C had stopped but Timers 1 and 2 were still running.  Fully stopped *SHOULD* look like

C000000F

(Assuming pad and RNG enabled, and a render request not active at that time)

 

Share this post


Link to post
Share on other sites

I want to stop all playing sounds, the sound engine & the DSP, maybe it's better if I turn off all voices, and then turn off the sound engine?

 

I'm not using any pad reading neither random number generator, in the setup code I don't touch U235SE_ctrl_reg register.

 

I doubt that the conversion is wrong because I did some test with $12345678 and it worked.

 

Anyway I think that I can remove the wait loop, it's called in a menu to select a game and launch it. I thought that the DSP was still running so it makes the games hang.

 

 

Share this post


Link to post
Share on other sites

Might be that the DSP has stopped before writing the final update to the status register (3 would indicate I2C has stopped).  Doesn't matter if the voices are running, once it stops, it will stop everything.

 

Might possibly be that there is some issue reading the value from DSP RAM.. but you shouldn't be seeing a lot of 3s.

Share this post


Link to post
Share on other sites

One question, can I change the value in U235SE_playbackmode (for stereo or mono sound) in realtime? without rebooting the sound engine.

 

Share this post


Link to post
Share on other sites
On 9/29/2019 at 1:13 PM, LinkoVitch said:

I *think* there may be some issues with the ELF build, I haven't had time to dig into it further so it is hanging around as an issue I am afraid.

I know this is an old topic, but the new rmac 2.1.13 has a fix for exported symbols in ELF object. It may solve the reference to the previously reported undefined symbols:

U235SE_playback_rate
U235SE_playback_period
U235SE_ptr_sample_bank
U235SE_playmod
U235SE_pad1
U235SE_sfxplaylist_ptr

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...