psychopy.org | Reference | Downloads | Github

PsychoPy not able to use sounddevice on Raspberry Pi?

Hello! I’m new to PsychoPy, I have been using pygame for other projects but it only supports stereo output and I need 4+ output channels.

I’ve recently installed pyschopy on a Raspberry Pi, and I would really like to use the sounddevice backend, but so far in trying to get it to work, it either errors out or uses pyo instead.

In an effort to isolate it as much as possible, I have a test file with just a few lines:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sounddevice
import soundfile
from psychopy import prefs
prefs.general['audioLib'] = ['sounddevice']
from psychopy import sound

print sound.Sound
print("All done!")

Based on the docs I’ve found, it seems like sounddevice should now be the default, but when I comment out the prefs line, it says it’s using pyo. When I run the above code as-is, I get “AttributeError: No audio API found. Try installing pyo…” etc.

Any advice on how to resolve this error? Thanks in advance for your help!

I’ve never used a raspberry pi. Were there other lines to your error message? Are you saying that import sounddevice worked? What version of PsychoPy are you using?