Question about Pyaudio and Linux

152 views
Skip to first unread message

Andrew Francis

unread,
Jun 12, 2023, 3:43:46 PM6/12/23
to Montréal-Python
Hi Montreal Pythonistas:

I am trying to get a Python program to run. I am getting the following error. I
haven't found a good explanation. Does anyone have insights?

Thanks!,
Andrew

ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:869:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

je...@schurger.org

unread,
Jun 12, 2023, 3:49:16 PM6/12/23
to montrea...@googlegroups.com
Hi Andrew,

By any chance, do you have a customized alsa setup (maybe ~/.asoundrc) ?

Do you know what your program is trying to do ?

It looks like it try different way to find a sound card.

Jean

--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "Montréal-Python".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse montrealpytho...@googlegroups.com.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/montrealpython/bf89aa05-ef1b-4d6a-a3df-1c1fa0d25347n%40googlegroups.com.

Andrew Frances

unread,
Jun 12, 2023, 4:13:40 PM6/12/23
to montrea...@googlegroups.com
Hi Jean:

Thanks for the reply! I didn't write the programme. However the code is reading from a Microphone and sending the
information to Google's speech service Dialogflow. I am running the example because I have developing my own and
having problems. My example uses sounddevice.

I don't have ~./asoundrc file on my machine.

Cheers,
Andrew



je...@schurger.org

unread,
Jun 13, 2023, 8:25:14 AM6/13/23
to montrea...@googlegroups.com
Hi Andrew, can you share your example ?

Jean

Andrew Frances

unread,
Jun 13, 2023, 11:33:56 AM6/13/23
to montrea...@googlegroups.com
Hi Jean:

Yes. The example causing the ALSA problem is at:

I don't think it is the code but my Linux settings.

Cheers,
Andrew


je...@schurger.org

unread,
Jun 16, 2023, 10:39:03 AM6/16/23
to montrea...@googlegroups.com
Hi Andrew,

I guess that the pyaudio.PyAudio().open() call is failing (or complaining and blocking).
I suggest to list your also devices (aplay -L), and maybe see if some process are already using the input device (maybe jack, jack2, pulseaudio,…) fuser on /dev/snd/ devices can help.

Jean

Andrew Frances

unread,
Jun 17, 2023, 11:08:51 AM6/17/23
to montrea...@googlegroups.com
Hi Jean:

Thanks for the advice. I was using that program to figure out a mistake in my own code. Fortunately, I found my problem!
If I get enough work done, it will become the topic for a future Montreal Python talk!

Again, thanks for your help!

Cheers,
Andrew

Reply all
Reply to author
Forward
0 new messages