audio error "PyAudioDevice 2 doesn't support output format (Int16, 2-channel at 44100 Hz)"

615 views
Skip to first unread message

Tim Sievers

unread,
May 16, 2016, 12:53:35 PM5/16/16
to Jasper Support Forum
Hello,

I am running jasper-dev on a Raspberry Pi 3 with the "Jabra SPEAK 510 USB" as a microphone/speaker.

Recently I ran into the following audio error, which I can't solve despite extensive search online and also looking into the code itself:

//Error message of --debug
INFO:jasper.mic:Keyword HELLO JASPER has been uttered
CRITICAL:pyaudio_1_0_0.pyaudioengine:PyAudioDevice 2 (Jabra SPEAK 510 USB: Audio (hw:1,0)) doesn't support output format (Int16, 2-channel at 44100 Hz)
Traceback (most recent call last):
  File "./Jasper.py", line 5, in <module>
    jasper.main()
  File "/home/pi/jasper-client/jasper/__main__.py", line 55, in main
    app.run()
  File "/home/pi/jasper-client/jasper/application.py", line 251, in run
    self.conversation.handleForever()
  File "/home/pi/jasper-client/jasper/conversation.py", line 40, in handleForever
    input = self.mic.listen()
  File "/home/pi/jasper-client/jasper/mic.py", line 191, in listen
    return self.active_listen()
  File "/home/pi/jasper-client/jasper/mic.py", line 196, in active_listen
    self.play_file(paths.data('audio', 'beep_hi.wav'))
  File "/home/pi/jasper-client/jasper/mic.py", line 214, in play_file
    add_padding=self._output_padding)
  File "/home/pi/jasper-client/jasper/audioengine.py", line 110, in play_file
    self.play_fp(f, *args, **kwargs)
  File "/home/pi/jasper-client/jasper/audioengine.py", line 97, in play_fp
    chunksize=chunksize) as stream:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/home/pi/jasper-client/plugins/audioengine/pyaudio-ae/pyaudioengine.py", line 149, in open_stream
    raise plugin.audioengine.UnsupportedFormat(msg)
jasper.audioengine.UnsupportedFormat: PyAudioDevice 2 (Jabra SPEAK 510 USB: Audio (hw:1,0)) doesn't support output format (Int16, 2-channel at 44100 Hz)
//Error end

That happens AFTER it recognices the keyword (in my case "Hello Jasper") and AFTER Jasper already announced "How can I be of service?" over the microphone. So my microphone/speaker setting should be working. Looking into the former behavior it should only play a beep sound in that instance, shouldn't it?
I think it is true that my speaker doesn't support 2-channel output (at least I think that references to mono/stereo? and since it is a mono speaker...). And the 44100 sample rate is also questionable. As one can see in the --debug output below, the first speach message is played with different audio settings
(48000 Hz, 1 channel, 16 bit)

//start
DEBUG:jasper.mic:Input sample rate: 16000 Hz
DEBUG:jasper.mic:Input sample width: 16 bit
DEBUG:jasper.mic:Input channels: 1
DEBUG:jasper.mic:Input chunksize: 1024 frames
DEBUG:jasper.mic:Output chunksize: 1024 frames
DEBUG:jasper.mic:Output padding: no
DEBUG:urllib3.connectionpool:"GET /process?VOICE=cmu-slt-hsmm&LOCALE=en_US&INPUT_TYPE=TEXT&OUTPUT_TYPE=AUDIO&AUDIO=WAVE_FILE&INPUT_TEXT=How+can+I+be+of+service%2C+Tim%3F HTTP/1.1" 200 196844
DEBUG:pyaudio_1_0_0.pyaudioengine:output stream opened on device 'jabra-speak-510-usb-audio' (48000 Hz, 1 channel, 16 bit)
DEBUG:pyaudio_1_0_0.pyaudioengine:output stream closed on device 'jabra-speak-510-usb-audio'
DEBUG:jasper.conversation:Starting to handle conversation.
INFO:jasper.mic:Waiting for keyword 'HELLO JASPER'...
DEBUG:pyaudio_1_0_0.pyaudioengine:input stream opened on device 'jabra-speak-510-usb-audio' (16000 Hz, 1 channel, 16 bit)
DEBUG:pyaudio_1_0_0.pyaudioengine:input stream closed on device 'jabra-speak-510-usb-audio'

//end

How is the output format defined anyway? And how could I change it?

By the way, is there a documentation available for all possible parameters in profile.yml of the jasper-dev branch? I think there were quite a few changes.

Thanks a lot for every help !

Tim



Tim Sievers

unread,
May 19, 2016, 2:39:05 PM5/19/16
to Jasper Support Forum
Hallo,

niemand eine Idee was ich noch versuchen könnte? Bzw. wo ansetzen?

Grüße.

Tim

Matthew Curry

unread,
May 20, 2016, 3:09:08 PM5/20/16
to Jasper Support Forum
I don't see the error, is it just not picking up audio?
Did you try to record/playback audio to make sure your mic is working? Also check alsamixer.


Matthew Curry

unread,
May 20, 2016, 3:09:22 PM5/20/16
to Jasper Support Forum
In english please if you can.

Tim Sievers

unread,
May 21, 2016, 12:43:29 PM5/21/16
to Jasper Support Forum
Hello Matthhew,

thank you for your answer. And I am very sorry for writing in German in an English forum, I just didn't realize I was writing in german when I did it. Again my apologies!

Yes, my audio is working fine. I can record and play that or any other audio file back, and alsmixer is also ok. As I wrote in my first post, Japser IS recognizing my keyword "Hello Japer" (meaning mic/recording is ok) and also JApser is answering via speakers with "How can I be of service?". My problems starts after that when Japser should play the "beep" to indicate it is ready to record an order. Jasper just crashes with the ouput:

//Error message of --debug
//Error end


Thank you for your help,

Tim

Matthew Curry

unread,
Jun 3, 2016, 10:52:23 AM6/3/16
to Jasper Support Forum
Ok, I posted a repo of tools on the main page.  Download that and try the audiotest.sh, also you might try the usbaudio.sh as well. (its case sensitive for now, have to update the code)

Also, be sure you check your levels in 'alsamixer'

Tim Sievers

unread,
Oct 9, 2016, 12:26:24 PM10/9/16
to Jasper Support Forum
Hi Matthew,

after I wasn't able to solve the sound issues on my own I did a full reinstall of the system today using your "jasper-all-in-one" image v1.5.
I choose the jasper-dev branch.

It worked quite well out of the box. I just had to additionally install the mad package and one other package, which name I can't remember at the moment. But maybe you wan't to include them into your image as well? But nevermind, the other small hickup was the the standard configuration file did not work in my case for defining the sst_engine:
    stt_engine: witai
    witai-stt:
    access_token: KEY_HERE_NO_QUOTES
I always got the error message "plugin witai not found".  I had to change the configuration file to
    stt_engine: witai-stt
    witai-stt:
    access_token: KEY_HERE_NO_QUOTES
With that change, I got it running. I just mention these small points in case someone else is running in the same issues.

My bigger problem is, I am still (or again) stuck with my audio output error:
- Jasper starts, it says "How can I be of service" out of my speakers with the output format (48000 Hz, 1 channel, 16 bit)
- It records my key phrase "Hello Jasper" (input format 16000 Hz, 1 channel, 16 bit) and then crashes while trying to play a soundfile with the (appearently not supported) format (Int16, 2-channel at 44100 Hz)
see my --debug log for details:
//Error message of --debug
DEBUG:pyaudio_1_0_0.pyaudioengine:Found 10 PyAudio devices
DEBUG:pyaudio_1_0_0.pyaudioengine:Found 10 PyAudio devices
DEBUG:pyaudio_1_0_0.pyaudioengine:Found 10 PyAudio devices
DEBUG:pyaudio_1_0_0.pyaudioengine:Found 10 PyAudio devices
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): query.yahooapis.com
DEBUG:requests.packages.urllib3.connectionpool:"GET /v1/public/yql?q=SELECT+%2A+FROM+geo.places+WHERE+text%3D%22Munich%22&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&format=json HTTP/1.                                                                                                     1" 200 None
INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.2.11
DEBUG:requests.packages.urllib3.connectionpool:"GET /voices HTTP/1.1" 200 92
INFO:mary_tts_1_0_0.marytts:Available voices: cmu-slt-hsmm
DEBUG:jasper.mic:output_padding not configured,using default.

DEBUG:jasper.mic:Input sample rate: 16000 Hz
DEBUG:jasper.mic:Input sample width: 16 bit
DEBUG:jasper.mic:Input channels: 1
DEBUG:jasper.mic:Input chunksize: 1024 frames
DEBUG:jasper.mic:Output chunksize: 1024 frames
DEBUG:jasper.mic:Output padding: no
DEBUG:requests.packages.urllib3.connectionpool:"GET /process?VOICE=cmu-slt-hsmm&LOCALE=en_US&INPUT_TYPE=TEXT&OUTPUT_TYPE=AUDIO&AUDIO=WAVE_FILE&INPUT_TEXT=How+can+I+be+of+service%2C+Tim%3F HTTP/1                                                                                                     .1" 200 196844

DEBUG:pyaudio_1_0_0.pyaudioengine:output stream opened on device 'jabra-speak-510-usb-audio' (48000 Hz, 1 channel, 16 bit)
DEBUG:pyaudio_1_0_0.pyaudioengine:output stream closed on device 'jabra-speak-510-usb-audio'
DEBUG:jasper.conversation:Starting to handle conversation.
INFO:jasper.mic:Waiting for keyword 'HELLO JASPER'...
DEBUG:pyaudio_1_0_0.pyaudioengine:input stream opened on device 'jabra-speak-510-usb-audio' (16000 Hz, 1 channel, 16 bit)
DEBUG:jasper.mic:Started recording on device 'jabra-speak-510-usb-audio'
DEBUG:jasper.mic:Triggered on SNR of 35.72691458dB
DEBUG:jasper.mic:Recording's SNR dB: 37.308848
DEBUG:jasper.mic:Recording's SNR dB: 35.051943
DEBUG:jasper.mic:Recording's SNR dB: 30.519396
DEBUG:jasper.mic:Recording's SNR dB: 33.441957
DEBUG:jasper.mic:Recording's SNR dB: 35.029981
DEBUG:jasper.mic:Recording's SNR dB: 35.106606
DEBUG:jasper.mic:Recording's SNR dB: 35.106606
DEBUG:jasper.mic:Recording's SNR dB: 35.117497
DEBUG:jasper.mic:Recording's SNR dB: 35.438046
DEBUG:jasper.mic:Recording's SNR dB: 36.334293
DEBUG:jasper.mic:Recording's SNR dB: 36.604439
DEBUG:jasper.mic:Recording's SNR dB: 36.586075
DEBUG:jasper.mic:Recording's SNR dB: 36.277336
DEBUG:jasper.mic:Recording's SNR dB: 34.065828
DEBUG:jasper.mic:Recording's SNR dB: 31.530118
DEBUG:jasper.mic:Recording's SNR dB: 31.296702
DEBUG:jasper.mic:Recording's SNR dB: 31.279787
DEBUG:jasper.mic:Recording's SNR dB: 31.262839
DEBUG:jasper.mic:Recording's SNR dB: 30.370279
DEBUG:jasper.mic:Recording's SNR dB: 24.498797
DEBUG:jasper.mic:Recording's SNR dB: 11.397506
DEBUG:jasper.mic:Recording's SNR dB: 2.652511
DEBUG:jasper.mic:Recorded 42 frames
INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): api.wit.ai
DEBUG:requests.packages.urllib3.connectionpool:"POST /speech?v=20160526 HTTP/1.1" 200 103
INFO:witai_stt_1_0_0.witai:Transcribed: [u'HELLO JASPER']

INFO:jasper.mic:Keyword HELLO JASPER has been uttered
DEBUG:pyaudio_1_0_0.pyaudioengine:input stream closed on device 'jabra-speak-510-usb-audio'
CRITICAL:pyaudio_1_0_0.pyaudioengine:PyAudioDevice 2 (Jabra SPEAK 510 USB: Audio (hw:1,0)) doesn't support output format (Int16, 2-channel at 44100 Hz)
Traceback (most recent call last):
  File "./Jasper.py", line 5, in <module>
    jasper.main()
  File "/home/pi/jasper-client/jasper/__main__.py", line 55, in main
    app.run()
  File "/home/pi/jasper-client/jasper/application.py", line 251, in run
    self.conversation.handleForever()
  File "/home/pi/jasper-client/jasper/conversation.py", line 40, in handleForever
    input = self.mic.listen()
  File "/home/pi/jasper-client/jasper/mic.py", line 201, in listen
    return self.active_listen()
  File "/home/pi/jasper-client/jasper/mic.py", line 206, in active_listen

    self.play_file(paths.data('audio', 'beep_hi.wav'))
  File "/home/pi/jasper-client/jasper/mic.py", line 224, in play_file

    add_padding=self._output_padding)
  File "/home/pi/jasper-client/jasper/audioengine.py", line 110, in play_file
    self.play_fp(f, *args, **kwargs)
  File "/home/pi/jasper-client/jasper/audioengine.py", line 97, in play_fp
    chunksize=chunksize) as stream:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/home/pi/jasper-client/plugins/audioengine/pyaudio-ae/pyaudioengine.py", line 149, in open_stream
    raise plugin.audioengine.UnsupportedFormat(msg)
jasper.audioengine.UnsupportedFormat: PyAudioDevice 2 (Jabra SPEAK 510 USB: Audio (hw:1,0)) doesn't support output format (Int16, 2-channel at 44100 Hz)
//Error end

I don't really understand why Japser is playing it's first sentence in an output format which is supported, and the second audio output in an unsupported audio format?
Is there a setting, where I can change that?


Am Freitag, 3. Juni 2016 16:52:23 UTC+2 schrieb Matthew Curry:
Ok, I posted a repo of tools on the main page.  Download that and try the audiotest.sh, also you might try the usbaudio.sh as well. (its case sensitive for now, have to update the code)

Also, be sure you check your levels in 'alsamixer'

- levels in alsamixer a both "in the green"
- usbaudio.sh is I think outdated?
- audiotest.sh:
If I try audiotest.sh, I get the error message:
    "Aufnahme: WAVE '/tmp/3secondtest.wav' : Signed 16 bit Little Endian, Rate: 44100 Hz, stereo
    Überlauf!!! (mindestens 3,580 ms)"
("Überlauf" is german for "overflow")
However, if I run the commands manually WITHOUT the "-d 3" option :
   sudo arecord -f cd /tmp/3secondtest.wav 
   sudo aplay -f cd /tmp/3secondtest.wav
I can record and play the file without any problems and the audio recording and playback is quite good.

Everykind of help is appreciated!

Regards,

Tim



Matthew Curry

unread,
Oct 9, 2016, 7:34:16 PM10/9/16
to Jasper Support Forum
yes, some of those have been removed from the repo.  I would just pull a new copy.

Also, yeah the usbaudio is old. I thought I had removed that.  I also install libmad and libmad0 on the latest image.  Which one did you install specifically so I an ensure it is there.

You are also correct in that the jasper-dev branch has a slightly different configuration for wit, I am trying to capture all these things, and I am writing an installer that will take care of it all for you.  I should have an early copy sure.

Thanks for the updates.  I will update my code to reflect, and ensure the repo is cleaned up.  I may have just done that after you posted this. Honestly I don't remember exactly when off the top of my head.

I also have a few things I am making variable for the master branch.  That will fix many issues with rate/chunk/etc...

Matthew Curry

unread,
Oct 9, 2016, 7:35:25 PM10/9/16
to Jasper Support Forum
however, the short/sweet answer with the dev branch I am not sure.  If you want to try the master branch I am sure I can help get you going pretty quickly.

Tim Sievers

unread,
Oct 10, 2016, 3:09:28 PM10/10/16
to Jasper Support Forum
Hello MAtthew,

thanks for answering so quickly.

Yes, I just did pull a new copy, but I can't remember the exact packages :-( It was just at the beginning of my try-outs of that day...
I used the command "sudo pip install mad" (as found on google) and it worked, but I can't remember the exact packages it installed. Same for "sudo pip install slugify", which was the second package missing.

My reason for using the dev branch is that I really need the multi language support. Or at least was hoping to use. Since the master branch doesn't have that, I kind of hesitate to switch. But maybe I just try out, if I get the same audio errors like in the dev branch.

With your repo installed, can I just use
jasper-repo-installer.sh
to switch to the master branch? Or do I have to do a complete reinstall of a new image?

Thanks for your help!

Tim

Matthew Curry

unread,
Oct 11, 2016, 11:49:45 AM10/11/16
to Jasper Support Forum
no you can just use the installer, and move the one you have
just move jasper-client to jasper-master
then run it again and select dev.  You will have both.  Dev has a little different config for wit.ai
change to witai-stt as type instead of witai in your profile.yml if you use dev. 

Keep in mind they both read the same profile.

Matthew Curry

unread,
Oct 11, 2016, 12:11:57 PM10/11/16
to Jasper Support Forum
I think I will update it so you dont have to do that.  Thanks for the tip!


Tim Sievers

unread,
Oct 11, 2016, 2:51:00 PM10/11/16
to Jasper Support Forum
ok thanks!  I am now on jasper-dev (jasper-client) and will run the installer again and choose master branch? Then I have both system running, correct? (I understand that they both will use the same profile.yml and that the sst definition is differently).


I will do that on the weekend. Thanks for your support!

REgards,

Tim

peer.v...@gmail.com

unread,
Apr 21, 2017, 11:35:07 AM4/21/17
to Jasper Support Forum
Hi All,
I was looking through this post because i have a similar problem with Jasper Dev brach.
I had Jasper working from the main branch, but i wanted to take it a step further and go to the DEV branch fore most because i love the possibilty for better configuration options in profile.yml.

Now my problem :
Every time i try to start Jasper.py i get the following error :
*******************************************************
*             JASPER - THE TALKING COMPUTER           *
* (c) 2015 Shubhro Saha, Charlie Marsh & Jan Holthuis *
*******************************************************
WARNING
:jasper.application:language not specified in profile, using 'en-US'
INFO
:jasper.application:audio_engine not specified in profile, using defaults.
INFO
:jasper.application:Using keyword 'Jasper'
WARNING
:jasper.pluginstore:Plugin at '/home/pi/jasper-client/plugins/tts/espeak-tts' skipped! (Reason: espeak executable not found!)
WARNING
:jasper.pluginstore:Plugin at '/home/pi/jasper-client/plugins/tts/festival-tts' skipped! (Reason: Executables "text2wave" and/or  "festival" not found!)
WARNING
:jasper.pluginstore:Plugin at '/home/pi/jasper-client/plugins/tts/osx-tts' skipped! (Reason: Invalid platform!)
INFO
:pyaudio_1_0_0.pyaudioengine:Initializing PyAudio. ALSA/Jack error messages that pop up during this process are normal and can usually be safely ignored.
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.front.0:CARD=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.surround51.0:CARD=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.surround51.0:CARD=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.surround40.0:CARD=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.surround51.0:CARD=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.surround51.0:CARD=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.surround51.0:CARD=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.surround71.0:CARD=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.iec958.0:CARD=2,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.iec958.0:CARD=2,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc
.c:1286:(snd_func_refer) Unable to find definition 'cards.HifiberryDacp.pcm.iec958.0:CARD=2,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf
.c:4259:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf
.c:4738:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm
.c:2239:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
INFO
:pyaudio_1_0_0.pyaudioengine:Initialization of PyAudio engine finished
WARNING
:jasper.application:output_device not specified in profile, defaulting to 'default' (Possible values: usb-pnp-sound-device-audio, snd-rpi-hifiberry-dacplus-hw-2-0, sysdefault, dmix, default)
WARNING
:jasper.application:Plugin 'weather' skipped! (Reason: Weather location not configured!)
CRITICAL
:pyaudio_1_0_0.pyaudioengine:PyAudioDevice 4 (default) doesn't support output format (Int32, 1-channel at 24000 Hz)

Traceback (most recent call last):
  File "./Jasper.py", line 5, in <module>
    jasper.main()
  File "/home/pi/jasper-client/jasper/__main__.py", line 55, in main
    app.run()
  File "/home/pi/jasper-client/jasper/application.py", line 250, in run
    self.conversation.greet()
  File "/home/pi/jasper-client/jasper/conversation.py", line 27, in greet
    self.mic.say(salutation)
  File "/home/pi/jasper-client/jasper/mic.py", line 231, in say
    self._output_device.play_fp(f)

  File "/home/pi/jasper-client/jasper/audioengine.py", line 97, in play_fp
    chunksize=chunksize) as stream:
  File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/home/pi/jasper-client/plugins/audioengine/pyaudio-ae/pyaudioengine.py", line 149, in open_stream
    raise plugin.audioengine.UnsupportedFormat(msg)
jasper.audioengine.UnsupportedFormat: PyAudioDevice 4 (default) doesn't support output format (Int32, 1-channel at 24000 Hz)

It is about this one :   File "/home/pi/jasper-client/plugins/audioengine/pyaudio-ae/pyaudioengine.py", line 149, in open_stream
    raise plugin.audioengine.UnsupportedFormat(msg)
jasper.audioengine.UnsupportedFormat: PyAudioDevice 4 (default) doesn'
t support output format (Int32, 1-channel at 24000 Hz)


To come back to initial questiobn in this thread, where are the defaults set for the bits/channels and sample rate, or are they configurable from the profile.yml file?

With regards
Peter van Hoek


peer.v...@gmail.com

unread,
Apr 26, 2017, 1:48:29 PM4/26/17
to Jasper Support Forum
Hi after some testing i change the audio_engine: pyaudio to alsa, in the .profile.yml.
and now it is throwing this error : 


DEBUG
:jasper.pluginstore:Found valid plugin: weather 1.0.0

Traceback (most recent call last):
 
File "./Jasper.py", line 5, in <module>
    jasper
.main()

 
File "/home/pi/jasper-client/jasper/__main__.py", line 48, in main
    batch_file
=p_args.batch_file)
 
File "/home/pi/jasper-client/jasper/application.py", line 133, in __init__
    device_type
=audioengine.DEVICE_TYPE_INPUT)]
 
File "/home/pi/jasper-client/plugins/audioengine/alsa-ae/alsaaudioengine.py", line 30, in get_devices
    devices
.update(set(alsaaudio.pcms(alsaaudio.PCM_CAPTURE)))
AttributeError: 'module' object has no attribute 'pcms'

peer.v...@gmail.com

unread,
May 2, 2017, 8:06:16 AM5/2/17
to Jasper Support Forum
Hello,
I found the problem (but not a solid sloution) for the error : File "/home/pi/jasper-client/plugins/audioengine/pyaudio-ae/pyaudioengine.py", line 149, in open_stream
    raise plugin.audioengine.UnsupportedFormat(msg)
jasper.audioengine.UnsupportedFormat: PyAudioDevice 4 (default) doesn't support output format (Int32, 1-channel at 24000 Hz)

In plugin.py, there's this section : 

    def mp3_to_wave(self, filename):
        print("Temp File name : %s" % filename)
        mf = mad.MadFile(filename)
        print(("bitrate %lu bps" % mf.bitrate()))
        print(("samplerate %d Hz" % mf.samplerate()))
        print("channels : %s " % mf.mode())
        with tempfile.SpooledTemporaryFile() as f:
            wav = wave.open(f, mode='wb')
            #wav.setframerate(mf.samplerate())
            wav.setframerate(44100)
            wav.setnchannels(1 if mf.mode() == mad.MODE_SINGLE_CHANNEL else 2)
            #wav.setnchannels(2)
            # 4L is the sample width of 32 bit audio
            wav.setsampwidth(2)
            frame = mf.read()
            while frame is not None:
                wav.writeframes(frame)
                frame = mf.read()
            wav.close()
            f.seek(0)
            data = f.read()
        return data

The red line's i had to adjust, so 
            #wav.setframerate(mf.samplerate()) becomes wav.setframerate(44100) and
            # 4L is the sample width of 32 bit audio
           
wav.setsampwidth(4) becomes wav.setsampwidth(2)

This results in an acceptable (but lower voice) output with no errors.
It seems that the detected 24000 frame rate is not suported by my audiocard.....

Regards
Peer
Reply all
Reply to author
Forward
0 new messages