Bugs in Brainworkshop

506 views
Skip to first unread message

Benjamin Wild

unread,
Feb 7, 2010, 6:49:00 AM2/7/10
to Dual N-Back, Brain Training & Intelligence
Hi,

i discovered brainworkshop yesterday and I think it's really amazing,
but I stumbled upon a couple of annoying bugs. I'm using ubuntu and
brainwork trunk (since i had a couple of bugs in 4.4 and i hoped that
they would be fixed in trunk and i wanted to test the saccadic eye
movement feature) and python-pyglet 1.1.2. (the one in the official
ubuntu repository).

- sound problems like described in
http://groups.google.com/group/brain-training/browse_thread/thread/7b0f9339f42b0d6c
i thought i fixed it when i changed pyglet.options['audio'] to
['alsa', ] but now i get this error after like 20-30 trials. Because
of this bug i'm basically unable to complete a session with n>3:

ALSA lib pcm_pulse.c:724:(pulse_prepare) PulseAudio: Unable to create
stream: Too large

Traceback (most recent call last):
File "brainworkshop.pyw", line 4188, in <module>
pyglet.app.run()
File "/usr/lib/pymodules/python2.6/pyglet/app/__init__.py", line
264, in run
EventLoop().run()
File "/usr/lib/pymodules/python2.6/pyglet/app/xlib.py", line 94, in
run
sleep_time = self.idle()
File "/usr/lib/pymodules/python2.6/pyglet/app/__init__.py", line
187, in idle
dt = clock.tick(True)
File "/usr/lib/pymodules/python2.6/pyglet/clock.py", line 696, in
tick
return _default.tick(poll)
File "/usr/lib/pymodules/python2.6/pyglet/clock.py", line 303, in
tick
item.func(ts - item.last_ts, *item.args, **item.kwargs)
File "brainworkshop.pyw", line 4073, in update
else: generate_stimulus()
File "brainworkshop.pyw", line 3545, in generate_stimulus
player.queue(mode.soundlist[mode.current_audio-1])
File "/usr/lib/pymodules/python2.6/pyglet/media/__init__.py", line
797, in queue
self._begin_source()
File "/usr/lib/pymodules/python2.6/pyglet/media/__init__.py", line
893, in _begin_source
self._fill_audio()
File "/usr/lib/pymodules/python2.6/pyglet/media/__init__.py", line
724, in _fill_audio
self._audio.write(audio_data)
File "/usr/lib/pymodules/python2.6/pyglet/media/drivers/alsa/
__init__.py", line 155, in write
raise ALSAException(asound.snd_strerror(samples_out))
pyglet.media.drivers.alsa.ALSAException: File descriptor in bad state

i can't use openal either because of the problem mentioned in the
"sound problems..." thread (works fine for a couple of trials, then
suddenly stops working at all). The pulseaudio plugin doesnt work at
all:

No suitable audio driver could be loaded.

Full text of error:

Traceback (most recent call last):
File "brainworkshop.pyw", line 633, in <module>
import pyglet.media
File "/usr/lib/pymodules/python2.6/pyglet/media/__init__.py", line
1346, in <module>
raise ImportError('No suitable audio driver could be loaded.')
ImportError: No suitable audio driver could be loaded.

- segmentation faults after nearly every session: brainworkshop
crashes _after_ saving the stats of the last session, so this bug is
not that much of a problem because i can just restart brainworkshop
after it crashes, but it's annoying nonetheless...


do you need any more information? hopefully someone can figure out
what's going on, because at the moment brainworkshop is basically
unusable for me...

Ben

Jonathan Toomim

unread,
Feb 7, 2010, 3:35:48 PM2/7/10
to brain-t...@googlegroups.com
Thanks for the feedback. I hear a lot of reports of audio
difficulties on Ubuntu, but very few reports from other distros. It
might be something to do with Ubuntu ALSA's pulse backend driver. (I
think Ubuntu wraps ALSA calls into pulseaudio calls, and there may be
some bugs in that wrapper.) I think OpenAL (usually?) uses ALSA as a
backend on Linux, so choosing OpenAL on Ubuntu would probably result
in audio function calls being wrapped twice (once into ALSA, then once
into pulse).

What Ubuntu release are you using? 64 bit or 32 bit? What is your
computer's audio hardware?

Take a look at https://wiki.ubuntu.com/PulseAudio, and maybe try apt-
getting some of the pulseaudio packages and see if that helps (or
allows the 'pulse' backend driver to work).

Jonathan

> --
> You received this message because you are subscribed to the Google
> Groups "Dual N-Back, Brain Training & Intelligence" group.
> To post to this group, send email to brain-t...@googlegroups.com.
> To unsubscribe from this group, send email to brain-trainin...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/brain-training?hl=en
> .
>

Benjamin Wild

unread,
Feb 8, 2010, 9:01:32 AM2/8/10
to brain-t...@googlegroups.com
Thanks for your reply. I'm using ubuntu 9.10 32bit (pulseaudio
1:0.9.19-0ubuntu4.1, alsa-base 1.0.20+dfsg-1ubuntu5) . I could try it
with arch linux if that's any help, but i'm quite busy at the moment, so
I probably won't get to it until next week...

~$ lspci | grep Audio
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High
Definition Audio Controller (rev 02)

installing the packages mentioned in the wiki article didn't change
anything, unfortunately...

do you have any idea about the segfaults? i had a couple of them when i
tried brainworkshop 4.4, but not nearly as many as after updating to
trunk.

Ben

Jonathan Toomim

unread,
Feb 8, 2010, 1:48:29 PM2/8/10
to brain-t...@googlegroups.com
I think I'll try installing Ubuntu 9.10 32bit to a VMWare virtual
machine to see if I can reproduce the problem. (I also would like to
make some .deb packages for debian and ubuntu, so don't think I'm
doing this just for you.) I'll keep you posted.

I don't think bugs in pure python code is ... "capable" of generating
segfaults. Segfaults occur when a program tries to perform a memory
access (read, write, or execute) to a segment of memory which that
program is not allowed (by the kernel) to access. Since python
doesn't have pointers, it's hard or impossible to produce a segfault
in python without using a library or module written in a different
language, like C. My guess is that there are bugs in pyglet or pulse
or alsa or who knows what which are causing the segfaults. A good
debugger could tell us.

>>> trai...@googlegroups.com.

Cory

unread,
Feb 13, 2010, 5:09:54 PM2/13/10
to Dual N-Back, Brain Training & Intelligence
I had the exact same issue. Sometimes I could get through one or two
sessions before it crashed. I actually even tried running the windows
version via Wine but that failed to run completely. I did however get
the linux/python version to work. I went back to the install page
noticed note about installing the python-openal package if having
sound issues. I installed it, and removed the alsa option from
brainworkshop.pyw completely, so it's:
pyglet.options['audio'] = ('directsound', 'pulse', 'openal',)

So far 18 sessions without crashing. Audio seems to work fine, except
in one session the audio quit/muted and I had to close and restart.

I do get this in the terminal when running though:
bt_audio_service_open: connect() failed: Connection refused (111)

Here is my audio device:
lspci | grep Audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio
Controller (rev 03)

I'm running Ubuntu 9.10 32 bit. If anyone needs any more info I'd
love to help out.

Cory

> >> Take a look athttps://wiki.ubuntu.com/PulseAudio, and maybe try apt-


> >> getting some of the pulseaudio packages and see if that helps (or
> >> allows the 'pulse' backend driver to work).
>
> >> Jonathan
>
> >> On Feb 7, 2010, at 3:49 AM, Benjamin Wild wrote:
>
> >>> Hi,
>
> >>> i discovered brainworkshop yesterday and I think it's really  
> >>> amazing,
> >>> but I stumbled upon a couple of annoying bugs. I'm using ubuntu and
> >>> brainwork trunk (since i had a couple of bugs in 4.4 and i hoped  
> >>> that
> >>> they would be fixed in trunk and i wanted to test the saccadic eye
> >>> movement feature) and python-pyglet 1.1.2. (the one in the official
> >>> ubuntu repository).
>
> >>> - sound problems like described in

> >>>http://groups.google.com/group/brain-training/browse_thread/thread/7b...

> >>> For more options, visit this group athttp://groups.google.com/group/brain-training?hl=en

Jonathan Toomim

unread,
Feb 13, 2010, 8:25:33 PM2/13/10
to brain-t...@googlegroups.com
Thanks for the bug report.

Both of you are running Ubuntu 9.10 32-bit, and both of you use Intel
integrated audio (ICH7 or ICH8). However, you (Cory) are having
trouble with ALSA and success with OpenAL, but Ben did not. As far as
I know, both of you were using pulseaudio as a backend for either ALSA
or OpenAL, since that's what Ubuntu does by default.

I installed Ubuntu 9.10 32-bit on VMWare. Sound did not work properly
in any applications in the stock configuration, which is probably
partially Ubuntu's bug and partially VMWare's bug. I then did sudo
apt-get remove pulseaudio libpulse0, and that made sound work just
fine. (There was a small amount of sound skipping present in the
samples, but it only happened about 10% of the time and did not make
the sounds inaudible, and probably was caused by my virtual machine
being slow.) I didn't continue to test it.

Ubuntu's implementation of pulseaudio seriously sucks. This is not a
problem with BrainWorkshop, it's a problem with Ubuntu. Any further
questions about sound in BrainWorkshop on Ubuntu should probably be
asked first in the Ubuntu support forums.

You could take a look at the suggestions on this page. They might help:

http://ubuntuforums.org/showthread.php?t=789578

Or you could try removing pulseaudio and use ESD or ALSA instead.

Or you could wipe Ubuntu from your hard drive. Real men use Debian,
you know.

Jonathan

Benjamin Wild

unread,
Mar 2, 2010, 8:40:35 AM3/2/10
to brain-t...@googlegroups.com
On 14 February 2010 02:25, Jonathan Toomim <jto...@jtoomim.org> wrote:
> Or you could wipe Ubuntu from your hard drive.  Real men use Debian, you
> know.

I decided to become a real men once again and installed Arch Linux a couple of
days ago because i had a couple of really annoying bugs with ubuntu (the
crappy pulseaudio implementation causing most of them) and everything works
perfectly fine now. no sound problems, no segfaults and there's even a package
for brainworkshop in the arch user repository (aur).

so no more problems for me anymore, but it still sucks that brainworkshop
doesn't work properly for at least some users of the most popular linux
distribution (the pulseaudio tips in the ubuntuforums thread didn't help, by
the way). well, hopefully they will fix their pulseaudio implementation for
the next ubuntu release...

ben

Jonathan Toomim

unread,
Mar 2, 2010, 11:48:08 AM3/2/10
to brain-t...@googlegroups.com
Excellent! That's good to hear.

I wish I could figure out how to get audio to work on Ubuntu too, but
unfortunately my VMWare Ubuntu virtual machine seems to be buggy for
reasons other than Ubuntu's bugginess, and I don't have room on my
hard drive for a separate Ubuntu partition. If anyone has a Macbook
compatible hard drive lying around (SATA, 2.5") and would be willing
to donate or lend it to me, I might be able to work. And I might
not. Dunno.

Ubuntu: Linux for the masses who don't know any better.

Considering that the Ubuntu pulseaudio implementation has been broken
since (I think) 8.04, I wouldn't be surprised if it remains broken for
a few more releases.

I'd like to make a brainworkshop .deb package for Ubuntu soon, but
I've been reluctant to do so until the audio problems are fixed.
Maybe I should give the package a Conflicts dependency with pulseaudio
<= (current version as of 01032010) ... though I bet the Ubuntu staff
probably wouldn't react kindly to that. Meh. Maybe the insult would
give them the impetus to actually fix pulseaudio.

Jonathan

P.S.: Real men may use Debian, but Supermen use Gentoo.

Michael Campbell

unread,
Mar 2, 2010, 2:12:56 PM3/2/10
to brain-t...@googlegroups.com
On Tue, 2 Mar 2010 14:40:35 +0100
Benjamin Wild <ben...@gmx.de> wrote:

> On 14 February 2010 02:25, Jonathan Toomim <jto...@jtoomim.org> wrote:
> > Or you could wipe Ubuntu from your hard drive.  Real men use Debian, you
> > know.
>

> well, hopefully they will fix their pulseaudio implementation for
> the next ubuntu release...


Distro-religion wars aside, BW worked flawlessly for me under Ubuntu 9.10. Could have been I was using a different version or something, however.


--
Michael Campbell <michael....@unixgeek.com>

Jonathan Toomim

unread,
Mar 2, 2010, 2:23:44 PM3/2/10
to brain-t...@googlegroups.com
Were you using Kubuntu, or plain Ubuntu? What audio controller are
you using? (Try lspci if you're unsure.) Are you using pulseaudio?

Michael Campbell

unread,
Mar 2, 2010, 3:56:17 PM3/2/10
to brain-t...@googlegroups.com, Jonathan Toomim
On Tue, 2 Mar 2010 11:23:44 -0800
Jonathan Toomim <jto...@jtoomim.org> wrote:

> Were you using Kubuntu, or plain Ubuntu? What audio controller are
> you using? (Try lspci if you're unsure.) Are you using pulseaudio?

Plain ubuntu 9.10, stock PA. For reasons not relevant here, I'm no longer running it (and don't even have the physical machine anymore) so I can't help with the audio controller. I even looked through my google search history... but it's rolled off. I think it was an intel sound chip though.

Sorry that wasn't very helpful.

--
Michael Campbell <michael....@unixgeek.com>

Reply all
Reply to author
Forward
0 new messages