Getting BBB working with pyAudio and USB Audio card

I’m trying to get pyAudio operational with a C-media mic/speaker card on a beaglebone black running ubuntu 13.04.
After many permutations of attempts, I’m seeking help here - as I simply cannot get the combination of configuration and pyAudio to play nice here.

I’ve disabled the HDMI by modifying uEnv.txt: optargs=quiet capemgr.disable_partno=BB-BONELT-HDMI,BB-BONELT-HDMIN

And I see my sound card listed:

root@ubuntu-armhf:/home/ubuntu# cat /proc/asound/devices
2: [ 1- 0]: digital audio playback
3: [ 1- 0]: digital audio capture
4: [ 1] : control
33: : timer


root@ubuntu-armhf:/home/ubuntu# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 1: Set [C-Media USB Headphone Set], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

Simple python code fails:

import pyaudio

with the following errors:

root@ubuntu-armhf:/home/ubuntu# python
ALSA lib confmisc.c:768:(parse_card) cannot find card ‘0’
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory

Attempts to change the default card to ‘0’ have failed as well. 2 Examples:

  1. Per:, adding

root@ubuntu-armhf:/etc/modprobe.d# tail -1 alsa-base.conf
options snd-card-usb-caiaq index=0

does not seem to set the default card to 0 (this is the setting used above)

  1. Changing asound.conf per:
    Similar failure is observed from pyAudio.

Any ideas? I suspect I’m missing something really obvious here.

I don’t know why this traceback is printed, but it does not seem to affect performance. Try to use the soundcard dispite the traceback.