jens-maus / yam

:mailbox_with_mail: YAM (short for 'Yet Another Mailer') is a MIME-compliant open-source Internet email client written for Amiga-based computer systems (AmigaOS4, AmigaOS3, MorphOS, AROS). It supports POP3, SMTP, TLSv1/SSLv3 connection security, multiple users, multiple identities, PGPv2/v5 encryption, unlimited hierarchical folders, an ARexx interface, etc...
https://yam.ch
GNU General Public License v2.0
63 stars 18 forks source link

After a soundtest YAM can't quit. #212

Closed jens-maus closed 8 years ago

jens-maus commented 8 years ago

Originally by opionline@yahoo.de on 2010-09-15 05:09:42 +0200


After doing a soundtest in YAMs config YAM can't quit.

Step by step to reproduce:

  1. Run YAM.
  2. go to Config->Neue Post.
  3. Enable the checkbox 'Ton'.
  4. Select a valid soundfile.
  5. Click the soundtest arrow on the right side some times very fast.
  6. Quit YAM.
  7. You sould get a requester like the attached one (YAM_Warning.png).

Note: I think it only happen if you click very fast while the first (or second) sound file is still playing. Maybe you must try to click 3 or 4 times very fast. I don't test it deeper. Clicking so much is not usual but Yam sould handle that without such warning.

A possible solution for that is to disable the button after the first click.

BTW: Maybe it's not a fault of YAM but here the first sound file is playing only on left channel and the second (while the first is still playing) is on the right channel. That was (is) also the cause because i play the sound with play16.

Used Version: YAM 2.7-dev OS3/m68k

jens-maus commented 8 years ago

Originally by opionline@yahoo.de on 2010-09-15 05:10:15 +0200


Attachment added: YAM_Warning.png (3.9 KiB) YAM_Warning.png The YAM Warning Requester

jens-maus commented 8 years ago

Originally by opionline@yahoo.de on 2010-09-15 05:18:26 +0200


I forget to mention: Also after 20 minutes waiting and click 'Nochmals versuchen' i can't quit YAM.

Maybe disabling the button is not the solution? What happen if a user configure YAM like it play a sound for every filter action? Then it may be possible that YAM also try to play some sounds at the same time. but i don't (yet) test it.

tboeckel commented 8 years ago

Originally on 2010-09-15 11:14:41 +0200


In (e92164d):

tboeckel commented 8 years ago

Originally on 2010-09-15 11:20:37 +0200


I must add that disabling the play button is not possible, because it would not be enabled afterwards as the playback might take an arbitrary long time and the main thread cannot get any specific feedback when the playback has finished.

Additionally, and that's even worse, there are many 3rd party implementations of sound.datatype and each of them handles the playback in a different way. Some use a per object playback task, some others seem to use one global task only. The latter is not able to signal the finished playback if a second sample is to be played in the meantime. Although the playback finishes correctly that initiating task is not woken up. This is now worked around by the abort signal, but the truth is that this sound.datatype is simply broken and there is no way for YAM to tell working and broken versions apart.

I did not yet check how all this works with OS4, but I know that OS4's sound.datatype definitely uses a per object playback task and hence should not suffer from this issue.

tboeckel commented 8 years ago

Originally on 2010-09-15 20:56:36 +0200


I just verified that playing a sample multiple times in parallel is absolutely no problem on AmigaOS4. So this is a bug of the specific sound.datatype used on AmigaOS3.

You might want to try this one http://aminet.net/util/dtype/soundDT41.lha

According to the source it uses one playback task per object and hence there should be no interference. I will try tomorrow on my OS3/WinUAE setup.

I also had some thoughts about disabling the play button. This would only work for synchronous playback. I'll see what I can do about that. But asynchronous playback in a thread is something I won't drop again. Playing a sound after receiving some mails should not halt any other action. That's why the threads are necessary.

jens-maus commented 8 years ago

Originally by opionline@yahoo.de on 2010-09-16 00:44:32 +0200


Playing a sample multiple times in parallel is here also no problem. But as i said before with YAM it plays only on the left channel if i get mails.

If the left channel is still playing and i click the test button again the second sound (the same sound) is on the right channel. If i click very fast the 3th, 4th (and so on) is also playing. Some left and some right...

I don't know if it's YAMs fault to play the sound only on the left channel. All i know is with play16 the same sound is playing on booth channels.

I just try your suggested Datatype and with them i can play only one sound and must wait before the second sound start playing. Here the sound is only on the left channel too.

So i switch back to my old (new) sound.Datatype. The Version i use is: sound.datatype 44.25 (18.10.2001) i think it's the version from AOS 3.9 or any BB...

tboeckel commented 8 years ago

Originally on 2010-09-16 07:51:24 +0200


Replying to opiopi:

Playing a sample multiple times in parallel is here also no problem.

Ok, that's good to know.

But as i said before with YAM it plays only on the left channel if i get mails. If the left channel is still playing and i click the test button again the second sound (the same sound) is on the right channel. If i click very fast the 3th, 4th (and so on) is also playing. Some left and some right...

It is up to sound.datatype to decide how mono samples will be played. YAM does in no way instruct sound.datatype to use either left or right channels only.

I don't know if it's YAMs fault to play the sound only on the left channel. All i know is with play16 the same sound is playing on booth channels.

Maybe Play16 converts mono samples to "pseudo" stereo by playing the same sound on the left and the right channel instead of the first free channel only.