×
Important information

To file a bug, find instructions here: Reporting bugs

Please only post images or files to this forum which you either own the copyright to or you are sure can be distributed under an open source license.

Interrupts and MUSIC_Play()

More
07 May 2018 14:51 #69098 by vlad_vy
Interrupts and MUSIC_Play() was created by vlad_vy
I think we need remove MUSIC_Play() from all interrupts (Mixer and protocols), since MUSIC_Play() read "sound.ini" and can interfere with other flash memory read and write operations.

We can replace it by set of SOUND_SetFrequency() and SOUND_Start(), or by MUSIC_Beep().

Please Log in or Create an account to join the conversation.

More
07 May 2018 15:57 - 07 May 2018 15:57 #69099 by Moeder
Replied by Moeder on topic Interrupts and MUSIC_Play()
I noticed this back when working on implementation of voice (based on mwm's work) and didn't like the concept of rereading sound.ini each time a music is played either. But I didn't want to break anything so I didn't touch it. Actually we cannot easily replace it with SOUND_SetFrequency() etc., as each music consists of several notes and only the current music played is kept in memory. I think we will run into memory issues on devo7e if we try to keep all of sound.ini in memory by parsing sound.ini at startup (where it would make most sense).
Last edit: 07 May 2018 15:57 by Moeder.

Please Log in or Create an account to join the conversation.

More
07 May 2018 16:26 #69100 by vlad_vy
Replied by vlad_vy on topic Interrupts and MUSIC_Play()
Protocols use only MUSIC_Play(MUSIC_DONE_BINDING) 3 notes, mux "beep" MUSIC_Play(MUSIC_SAVING) 2 notes. It can be easily replaced.

But mux "voice" use MUSIC_Play(Model.voice.mixer[mixer->dest].music).

Q303 protocol use MUSIC_Beep("d2", 100, 100, (vtx_channel & 7) + 1) that don't use "sound.ini".

Please Log in or Create an account to join the conversation.

More
07 May 2018 21:07 #69101 by Moeder
Replied by Moeder on topic Interrupts and MUSIC_Play()

vlad_vy wrote: But mux "voice" use MUSIC_Play(Model.voice.mixer[mixer->dest].music).


sound.ini reading does not happen for mux voice alerts, because of // Play audio for switch
if ( music > MUSIC_TOTAL ) {
        if (AUDIO_VoiceAvailable())
            AUDIO_AddQueue(music);
        return;
    }

at the very beginning of MUSIC_Play

Please Log in or Create an account to join the conversation.

Time to create page: 0.220 seconds
Powered by Kunena Forum