Squeak sound on Unix; potential improvement found in old code

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

Squeak sound on Unix; potential improvement found in old code

timrowledge
I’ve been doing some swiki-cleaning and stumbled upon
http://wiki.squeak.org/squeak/263
wherein Lex Spoon had written some code to drive the /dev/dsp sound device doohickey on unix. Since it claimed to be able to support low-latency sound playing, this may be useful to those of you interested in making noises.

It’s old, possibly wrong, but it’s there awaiting attention from someone with a bit of appropriate knowledge.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
What passes for common sense is always revisable





Reply | Threaded
Open this post in threaded view
|

Re: Squeak sound on Unix; potential improvement found in old code

David T. Lewis
On Wed, Mar 22, 2017 at 02:55:17PM -0700, tim Rowledge wrote:
> I???ve been doing some swiki-cleaning and stumbled upon
> http://wiki.squeak.org/squeak/263
> wherein Lex Spoon had written some code to drive the /dev/dsp sound device doohickey on unix. Since it claimed to be able to support low-latency sound playing, this may be useful to those of you interested in making noises.
>
> It???s old, possibly wrong, but it???s there awaiting attention from someone with a bit of appropriate knowledge.
>

Nice find. A lot of what Lex did is worth a second look :-)

Quite a bit has changed in the intervening years with respect to sound on
Squeak and Linux. For example, there is no longer such a thing as /dev/dsp
on my Ubuntu box, or on my Raspberry Pi. I think that device was associated
with an older sound system (OSS). Nevertheless, the basic idea of the mmap
driver interface may be applicable to something.

Just a sanity check - do you have sound with whatever VM you are using? I
have some VMs that seem to have trouble finding -vm-sound-pulse, possibly
due to build system issues.

Dave
 

Reply | Threaded
Open this post in threaded view
|

Re: Squeak sound on Unix; potential improvement found in old code

Hannes Hirzel
On 3/23/17, David T. Lewis <[hidden email]> wrote:

> On Wed, Mar 22, 2017 at 02:55:17PM -0700, tim Rowledge wrote:
>> I???ve been doing some swiki-cleaning and stumbled upon
>> http://wiki.squeak.org/squeak/263
>> wherein Lex Spoon had written some code to drive the /dev/dsp sound device
>> doohickey on unix. Since it claimed to be able to support low-latency
>> sound playing, this may be useful to those of you interested in making
>> noises.
>>
>> It???s old, possibly wrong, but it???s there awaiting attention from
>> someone with a bit of appropriate knowledge.
>>
>
> Nice find. A lot of what Lex did is worth a second look :-)
>
> Quite a bit has changed in the intervening years with respect to sound on
> Squeak and Linux. For example, there is no longer such a thing as /dev/dsp
> on my Ubuntu box, or on my Raspberry Pi. I think that device was associated
> with an older sound system (OSS). Nevertheless, the basic idea of the mmap
> driver interface may be applicable to something.
>
> Just a sanity check - do you have sound with whatever VM you are using? I
> have some VMs that seem to have trouble finding -vm-sound-pulse, possibly
> due to build system issues.

No, for the current setup I am using on Ubuntu 14.04 and a recent
all-in-one (Squeak 6.0a trunk  **) sound does not work. In other
programs sound works on the machine
--Hannes


** http://files.squeak.org/6.0alpha/Squeak6.0alpha-17042-32bit/

'About Squeak gives'

Image
-----
/media/user/data-ext4/Smtk/trunk2/Squeak6.0alpha-16963-32bit-All-in-One.app/Contents/Resources/Squeak6.0alpha-17042-32bit.image
Squeak6.0alpha
latest update: #17058
Current Change Set: Flash Cards
Image format 6521 (32 bit)

Virtual Machine
---------------
/media/user/data-ext4/Smtk/trunk2/Squeak6.0alpha-16963-32bit-All-in-One.app/Contents/Linux-i686/lib/squeak/5.0-201608171728/squeak
Croquet Closure Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-cb.1919]
Unix built on Aug 17 2016 18:35:40 Compiler: 4.6.3
platform sources revision VM: 201608171728
https://github.com/OpenSmalltalk/opensmalltalk-vm.git $ Date: Wed Aug
17 10:28:01 2016 -0700 $ Plugins: 201608171728
https://github.com/OpenSmalltalk/opensmalltalk-vm.git $
CoInterpreter VMMaker.oscog-cb.1919 uuid:
00a8dd2a-bc8d-4552-b400-be781c8aabec Aug 17 2016
StackToRegisterMappingCogit VMMaker.oscog-cb.1919 uuid:
00a8dd2a-bc8d-4552-b400-be781c8aabec Aug 17 2016

Loaded VM Modules
-----------------
B2DPlugin VMMaker.oscog-eem.1886 (i)
BitBltPlugin VMMaker.oscog-eem.1914 (i)
FilePlugin VMMaker.oscog-eem.1851 (i)
FloatArrayPlugin VMMaker.oscog-eem.1891 (i)
ImmX11Plugin VMMaker.oscog-eem.1716 (e)
LargeIntegers v2.0 VMMaker.oscog-eem.1886 (i)
Matrix2x3Plugin VMMaker.oscog-eem.1851 (i)
MiscPrimitivePlugin VMMaker.oscog-eem.1902 (i)
SecurityPlugin VMMaker.oscog-eem.1702 (i)
SocketPlugin VMMaker.oscog-eem.1809 (i)
SoundPlugin VMMaker.oscog-eem.1809 (i)

Reply | Threaded
Open this post in threaded view
|

Re: Squeak sound on Unix; potential improvement found in old code

Ben Coman
In reply to this post by David T. Lewis
On Thu, Mar 23, 2017 at 8:59 AM, David T. Lewis <[hidden email]> wrote:

> On Wed, Mar 22, 2017 at 02:55:17PM -0700, tim Rowledge wrote:
>> I???ve been doing some swiki-cleaning and stumbled upon
>> http://wiki.squeak.org/squeak/263
>> wherein Lex Spoon had written some code to drive the /dev/dsp sound device doohickey on unix. Since it claimed to be able to support low-latency sound playing, this may be useful to those of you interested in making noises.
>>
>> It???s old, possibly wrong, but it???s there awaiting attention from someone with a bit of appropriate knowledge.
>>
>
> Nice find. A lot of what Lex did is worth a second look :-)
>
> Quite a bit has changed in the intervening years with respect to sound on
> Squeak and Linux. For example, there is no longer such a thing as /dev/dsp
> on my Ubuntu box, or on my Raspberry Pi. I think that device was associated
> with an older sound system (OSS).

Interesting backronym
;)

cheers -ben

Reply | Threaded
Open this post in threaded view
|

Re: Squeak sound on Unix; potential improvement found in old code

Milan Vavra
In reply to this post by Hannes Hirzel
To get sound working on Ubuntu 14.04,
try

sudo apt-get install oss-compat

Reboot.

Enjoy.

Best Regards,
Milan Vavra
Reply | Threaded
Open this post in threaded view
|

Re: Squeak sound on Unix; potential improvement found in old code

timrowledge
The particular attraction of this old Lex-code is getting the ‘insertSample…’ stuff working so that low-latency response to playing sounds on the keyboard morph becomes functional. I had a teacher in France trying to use Scratch on a Pi to play music and we simply couldn’t get the latency down to a tolerable level because you end up with an average of slightly over half the SoundPlayer buffer length of delay. It was possible to improve things a bit with a smaller buffer but then the sound rapidly gets to break up levels of choppiness. Not good for playing music…

A related and possibly improvable issue is that setting the ‘stop sounds when there is nothing to play’ preference causes long delays in HDMI sound output because (apparently, according to RPF) the hardware level player has to restart.  Maybe there is nothing we can do beyond not using that preference, but I know little about sound and unix.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Useful random insult:- Suffers from permanent rapture of the deep.  (Nitrogen narcosis.)