Getting BBB working with pyAudio and USB Audio card

438 views
Skip to first unread message

jma...@gmail.com

unread,
Feb 16, 2014, 12:43:56 PM2/16/14
to beagl...@googlegroups.com
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
and:
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
p=pyaudio.PyAudio()
s=p.open(format=pyaudio.paInt16,input_device_index=1,channels=1,rate=44100,input=True,frames_per_buffer=1024)

with the following errors:
root@ubuntu-armhf:/home/ubuntu# python audio_test.py 
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:
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)

Similar failure is observed from pyAudio.

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



andima...@gmail.com

unread,
Dec 4, 2015, 10:28:20 PM12/4/15
to BeagleBoard
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.
Reply all
Reply to author
Forward
0 new messages