Re: Squeak and the SoundPlugin in cog VM

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Squeak and the SoundPlugin in cog VM

patrick.rein

Hi Christian,

just a wild guess (I can not check it right now) but you might have a SoundPlayer with activated reverb?

You can stop it from doing that with:

SoundPlayer stopReverb

Bests
Patrick


05.12.2019 08:40:55 Christian Kellermann <[hidden email]>:

> Dear Lists!
>
> I have written a VM SoundPlugin for OpenBSD's native sound system
> sndio. Which means that now I have sound in Squeak on this platform.
> However I am a bit struggling with the sound quality of SampledSound's
> like in the eToys SoundLibrary. Those produce an echo effect when
> played and I have been unable to determine the cause. However the
> Bach fugue Tests sound perfect so I am suspecting some miscalculations
> in sample data somewhere on the way.
>
> As I have been trying to confirm the 'normal' behaviour on Linux I
> stumbled over issues with the sound plugins on my ArchLinux box:
> None of them work.
>
> ALSA, OSS or Pulse Audio plugins error out in different stages of
> the drivers.
>
> Am I the only one? What's the last known good state of those? What's
> the last known good state of sound output for the SoundLibrary
> SampledSounds?
>
> I have tried with latest master and trunk of both opensmalltalk-vm
> and Squeak.
>
> I am grateful for any hints. Once that works I will propose patches
> to the opensmalltalk-vm code base.
>
> Thanks,
>
> Christian
>
>
> --
> May you be peaceful, may you live in safety, may you be free from
> suffering, and may you live with ease.
>


Reply | Threaded
Open this post in threaded view
|

Re: Squeak and the SoundPlugin in cog VM

Stéphane Rollandin
> I have written a VM SoundPlugin for OpenBSD's native sound system
> sndio. Which means that now I have sound in Squeak on this platform.
> However I am a bit struggling with the sound quality of SampledSound's
> like in the eToys SoundLibrary. Those produce an echo effect when
> played and I have been unable to determine the cause. However the
> Bach fugue Tests sound perfect so I am suspecting some miscalculations
> in sample data somewhere on the way.

You may try your VM on the muO image available at:
http://www.zogotounga.net/comp/squeak/sqgeo.htm
(the direct link is http://www.zogotounga.net/comp/squeak/muo/muO347.zip)

I have tweaked the sound settings there, including the default reverb,
and made a couple fixes too pretty much all over the place.

Try for example
        SampledSound playSoundNamed:'laugh'
        SampledSound playSoundNamed:'motor'
        SampledSound playSoundNamed:'coyote'

Or:
        FMSound flute2 play: Mode A minor upwardRun
        FMSound mellowBrass play: Mode E mixolydian stepwiseWalk
        FMSound pluckedElecBass play: Mode C2 minor timeSong
        NFunction sound3 playWithDeclickingFrom: 0 to: 5
        BeeThree new playASong
        FluteSansDCOffset new playASong
        Vibraphone new playASong
        Drone new playASong

These sounds should all be clean (no click, no echo)

Stef

Reply | Threaded
Open this post in threaded view
|

Re: Squeak and the SoundPlugin in cog VM

Eliot Miranda-2
In reply to this post by patrick.rein
Hi Christian, please consider contributing your code to open Smalltalk vm (if you haven’t already).  We can happily add a platforms/openbsd if required.

_,,,^..^,,,_ (phone)

> On Dec 4, 2019, at 11:40 PM, Christian Kellermann <[hidden email]> wrote:
>
> Dear Lists!
>
> I have written a VM SoundPlugin for OpenBSD's native sound system
> sndio. Which means that now I have sound in Squeak on this platform.
> However I am a bit struggling with the sound quality of SampledSound's
> like in the eToys SoundLibrary. Those produce an echo effect when
> played and I have been unable to determine the cause. However the
> Bach fugue Tests sound perfect so I am suspecting some miscalculations
> in sample data somewhere on the way.
>
> As I have been trying to confirm the 'normal' behaviour on Linux I
> stumbled over issues with the sound plugins on my ArchLinux box:
> None of them work.
>
> ALSA, OSS or Pulse Audio plugins error out in different stages of
> the drivers.
>
> Am I the only one? What's the last known good state of those?  What's
> the last known good state of sound output for the SoundLibrary
> SampledSounds?
>
> I have tried with latest master and trunk of both opensmalltalk-vm
> and Squeak.
>
> I am grateful for any hints. Once that works I will propose patches
> to the opensmalltalk-vm code base.
>
> Thanks,
>
> Christian
>
>
> --
> May you be peaceful, may you live in safety, may you be free from
> suffering, and may you live with ease.
>

Reply | Threaded
Open this post in threaded view
|

Re: Squeak and the SoundPlugin in cog VM

Christian Kellermann
In reply to this post by patrick.rein
* Patrick Rein <[hidden email]> [191205 09:21]:
>
> Hi Christian,
>
> just a wild guess (I can not check it right now) but you might have a SoundPlayer with activated reverb?
>
> You can stop it from doing that with:
>
> SoundPlayer stopReverb

Oh indeed! Wow, that was quite a surprise. Why would the default
SoundPlayer have a reverb effect switched on by default?

Thanks, it seems to work now. Next step is to provide a non-(vm)-blocking interface.
Does anyone know how the semaphore mechanism is supposed to be used on the plugin side?
How is concurrent sound output handled in the Squeak image?

Thanks!

Christian

--
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.

Reply | Threaded
Open this post in threaded view
|

Re: Squeak and the SoundPlugin in cog VM

Christian Kellermann
In reply to this post by Stéphane Rollandin
Hi Stéphane!

* Stéphane Rollandin <[hidden email]> [191205 11:41]:

> > I have written a VM SoundPlugin for OpenBSD's native sound system
> > sndio. Which means that now I have sound in Squeak on this platform.
> > However I am a bit struggling with the sound quality of SampledSound's
> > like in the eToys SoundLibrary. Those produce an echo effect when
> > played and I have been unable to determine the cause. However the
> > Bach fugue Tests sound perfect so I am suspecting some miscalculations
> > in sample data somewhere on the way.
>
> You may try your VM on the muO image available at:
> http://www.zogotounga.net/comp/squeak/sqgeo.htm
> (the direct link is http://www.zogotounga.net/comp/squeak/muo/muO347.zip)

I will try it, thanks! It seems the default reverb has been the
cause of my troubles!  I will use your image as a test bench too.
Is there a reason why your modifications haven't made it into the
mainline image?

All the best!

Christian

--
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.

Reply | Threaded
Open this post in threaded view
|

Re: Squeak and the SoundPlugin in cog VM

David T. Lewis
In reply to this post by patrick.rein
Hi Christian,

On Thu, Dec 05, 2019 at 08:40:41AM +0100, Christian Kellermann wrote:

> Dear Lists!
>
> I have written a VM SoundPlugin for OpenBSD's native sound system
> sndio. Which means that now I have sound in Squeak on this platform.
> However I am a bit struggling with the sound quality of SampledSound's
> like in the eToys SoundLibrary. Those produce an echo effect when
> played and I have been unable to determine the cause. However the
> Bach fugue Tests sound perfect so I am suspecting some miscalculations
> in sample data somewhere on the way.
>

It is good to hear that you are working on this :-)


 
> As I have been trying to confirm the 'normal' behaviour on Linux I
> stumbled over issues with the sound plugins on my ArchLinux box:
> None of them work.
>
> ALSA, OSS or Pulse Audio plugins error out in different stages of
> the drivers.

On my Ubuntu Linux laptop, the Pulse audio VM module works, and the
others do not. I have to explicitly ask for vm-sound-pulse, otherwise
no sound. So for me, the command line is (on my system, the 64-bit
Spur VM is run from /usr/local/bin/spur64):

  $ spur64 -vm-sound-pulse squeak.image


>
> Am I the only one? What's the last known good state of those?  What's
> the last known good state of sound output for the SoundLibrary
> SampledSounds?
>
> I have tried with latest master and trunk of both opensmalltalk-vm
> and Squeak.
>

It may be that you are missing some runtime libraries on you Linux
system. I am not sure what the actual requirements are, but for
reference here is what is currently installed on my Ubuntu system:

lewis@lewis-Gazelle-Pro:~$ dpkg --list | grep pulse
ii  gstreamer1.0-pulseaudio:amd64                 1.8.3-1ubuntu0.4                                amd64        GStreamer plugin for PulseAudio
ii  libcanberra-pulse:amd64                       0.30-2.1ubuntu1                                 amd64        PulseAudio backend for libcanberra
ii  libpulse-dev:amd64                            1:8.0-0ubuntu3.10                               amd64        PulseAudio client development headers and libraries
ii  libpulse-mainloop-glib0:amd64                 1:8.0-0ubuntu3.10                               amd64        PulseAudio client libraries (glib support)
ii  libpulse0:amd64                               1:8.0-0ubuntu3.10                               amd64        PulseAudio client libraries
ii  libpulse0:i386                                1:8.0-0ubuntu3.10                               i386         PulseAudio client libraries
ii  libpulsedsp:amd64                             1:8.0-0ubuntu3.10                               amd64        PulseAudio OSS pre-load library
ii  libpulsedsp:i386                              1:8.0-0ubuntu3.10                               i386         PulseAudio OSS pre-load library
ii  pulseaudio                                    1:8.0-0ubuntu3.10                               amd64        PulseAudio sound server
ii  pulseaudio-module-bluetooth                   1:8.0-0ubuntu3.10                               amd64        Bluetooth module for PulseAudio sound server
ii  pulseaudio-module-x11                         1:8.0-0ubuntu3.10                               amd64        X11 module for PulseAudio sound server
ii  pulseaudio-utils                              1:8.0-0ubuntu3.10                               amd64        Command line tools for the PulseAudio sound server

> I am grateful for any hints. Once that works I will propose patches
> to the opensmalltalk-vm code base.
>

You will want to join the vm-dev mailing list for discussion of VM
and plugin contributions:

  http://lists.squeakfoundation.org/mailman/listinfo/vm-dev

Dave

> Thanks,
>
> Christian
>
>
> --
> May you be peaceful, may you live in safety, may you be free from
> suffering, and may you live with ease.
>

Reply | Threaded
Open this post in threaded view
|

Re: Squeak and the SoundPlugin in cog VM

Tobias Pape
In reply to this post by Eliot Miranda-2
Hi Eliot, Christian,

> On 05.12.2019, at 19:33, Eliot Miranda <[hidden email]> wrote:
>
> Hi Christian, please consider contributing your code to open Smalltalk vm (if you haven’t already).  We can happily add a platforms/openbsd if required.

I at one point considered that,
but up until now, it has worked quite ok with the Unix-flavoured builds in linuxXX.xxx.

Indeed, it should be as simple as adding a folder
        vm-sound-sndio to platforms/unix
and adding a file for autoconf, and maybe cmake, as well as your plugin source.
Examples can be found in vm-sound-Sun, vm-sound-NAS and so on.

Then, someone should regenerate the configure file in platforms/unix/config
and the linux builds will happily pick up the new plugins.

Best regards
        -Tobias



>
> _,,,^..^,,,_ (phone)
>
>> On Dec 4, 2019, at 11:40 PM, Christian Kellermann <[hidden email]> wrote:
>>
>> Dear Lists!
>>
>> I have written a VM SoundPlugin for OpenBSD's native sound system
>> sndio. Which means that now I have sound in Squeak on this platform.
>> However I am a bit struggling with the sound quality of SampledSound's
>> like in the eToys SoundLibrary. Those produce an echo effect when
>> played and I have been unable to determine the cause. However the
>> Bach fugue Tests sound perfect so I am suspecting some miscalculations
>> in sample data somewhere on the way.
>>
>> As I have been trying to confirm the 'normal' behaviour on Linux I
>> stumbled over issues with the sound plugins on my ArchLinux box:
>> None of them work.
>>
>> ALSA, OSS or Pulse Audio plugins error out in different stages of
>> the drivers.
>>
>> Am I the only one? What's the last known good state of those?  What's
>> the last known good state of sound output for the SoundLibrary
>> SampledSounds?
>>
>> I have tried with latest master and trunk of both opensmalltalk-vm
>> and Squeak.
>>
>> I am grateful for any hints. Once that works I will propose patches
>> to the opensmalltalk-vm code base.
>>
>> Thanks,
>>
>> Christian
>>
>>
>> --
>> May you be peaceful, may you live in safety, may you be free from
>> suffering, and may you live with ease.
>>
>



Reply | Threaded
Open this post in threaded view
|

Re: Squeak and the SoundPlugin in cog VM

Stéphane Rollandin
In reply to this post by Christian Kellermann
> Is there a reason why your modifications haven't made it into the
> mainline image?

There are many little (or important) modifications in the muO image,
which is basically my own version of Squeak, and it is not easy to break
them into coherent patches to be submitted for inclusion into trunk.

Also, attempting to contribute to Squeak has been for me a rather
frustrating experience overall, which leaves me unmotivated to push by
code forward.

For example I just recently made several fixes in the AbstractSound
hierarchy so that volume scaling works properly everywhere. This was
triggered by this thread here on squeak-dev:
http://forum.world.st/Adjusting-the-volume-of-a-sound-as-it-s-playing-td5102562.html.


In that thread I proposed some code, but I did not formally ask for
inclusion in trunk because I felt someone else should review it first,
but in fact the topic just died at this point, with not even the OP
responding.

So at the moment those fixes are in muO only.


Stef

Reply | Threaded
Open this post in threaded view
|

Re: Squeak and the SoundPlugin in cog VM

Christian Kellermann
In reply to this post by Tobias Pape
* Tobias Pape <[hidden email]> [191206 11:11]:

> Hi Eliot, Christian,
>
> > On 05.12.2019, at 19:33, Eliot Miranda <[hidden email]> wrote:
> >
> > Hi Christian, please consider contributing your code to open Smalltalk vm (if you haven’t already).  We can happily add a platforms/openbsd if required.
>
> I at one point considered that,
> but up until now, it has worked quite ok with the Unix-flavoured builds in linuxXX.xxx.
>
> Indeed, it should be as simple as adding a folder
> vm-sound-sndio to platforms/unix
> and adding a file for autoconf, and maybe cmake, as well as your plugin source.
> Examples can be found in vm-sound-Sun, vm-sound-NAS and so on.
>
> Then, someone should regenerate the configure file in platforms/unix/config
> and the linux builds will happily pick up the new plugins.

That's what I did. I'll prepare a pull request as it is basically
working, I will add concurrent and non blocking access later.


--
May you be peaceful, may you live in safety, may you be free from
suffering, and may you live with ease.