LinkoVitch #176 Posted November 29, 2020 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. Quote Share this post Link to post Share on other sites
matmook #177 Posted November 29, 2020 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... 1 Quote Share this post Link to post Share on other sites
matmook #178 Posted November 30, 2020 Okay, got it: U235SE_sfxplaylist_ptr 1 Quote Share this post Link to post Share on other sites
swapd0 #179 Posted March 12, 2021 _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 Quote Share this post Link to post Share on other sites
swapd0 #180 Posted March 12, 2021 By the way I'm playing a sample in loop mode. Quote Share this post Link to post Share on other sites
LinkoVitch #181 Posted March 12, 2021 Does the value in the status reg change at all? Quote Share this post Link to post Share on other sites
swapd0 #182 Posted March 12, 2021 1 hour ago, LinkoVitch said: Does the value in the status reg change at all? I need to test that. Quote Share this post Link to post Share on other sites
swapd0 #183 Posted March 13, 2021 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 Quote Share this post Link to post Share on other sites
swapd0 #184 Posted March 13, 2021 Anyway the sound is stopped and I don't upload anything to the DSP until I load and run the selected game. Quote Share this post Link to post Share on other sites
LinkoVitch #185 Posted March 13, 2021 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? Quote Share this post Link to post Share on other sites
swapd0 #186 Posted March 13, 2021 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. Quote Share this post Link to post Share on other sites
LinkoVitch #187 Posted March 13, 2021 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) Quote Share this post Link to post Share on other sites
swapd0 #188 Posted March 13, 2021 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. Quote Share this post Link to post Share on other sites
LinkoVitch #189 Posted March 13, 2021 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. Quote Share this post Link to post Share on other sites
swapd0 #190 Posted March 17, 2021 One question, can I change the value in U235SE_playbackmode (for stereo or mono sound) in realtime? without rebooting the sound engine. Quote Share this post Link to post Share on other sites
LinkoVitch #191 Posted March 17, 2021 Yes. This is queried every time the sample is sent to the DAC. 1 Quote Share this post Link to post Share on other sites
swapd0 #192 Posted September 13, 2021 I've problems if I init the sound engine but I don't play any music or sound fx. Is really weird. Quote Share this post Link to post Share on other sites
dilinger #193 Posted November 12, 2021 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 1 Quote Share this post Link to post Share on other sites