22 Replies Latest reply on Jan 20, 2016 4:16 AM by bantammenace

    Wolfson audio card + Jasper ?

    Frederick Vandenbosch

      Hi,

       

      has anyone been able to get Jasper (Jasper | Control everything with your voice ) to work with the Wolfson audio card ?

       

      I tried getting it to work with two different approaches and ended up with the same result (which is something good I suppose).

      • Took the Wolfson image and manually installed Jasper software
      • Took the Jasper image and manually installed Wolfson drivers/kernel

       

      Jasper is working via the command line, but when trying to use voice control, I get some (Alsa related?) errors.

       

      Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2762
      Expression 'r' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2013
      Expression 'PaAlsaStreamComponent_FinishConfigure( &self->capture, hwParamsCapture, inParams, self->primeBuffers, realSr, inputLatency )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2650
      

       

      Full log attached.

       

      Thanks!

      Frederick

        • Re: Wolfson audio card + Jasper ?
          georgpi

          Hi Frederick,

          I did not use jasper on the pi, only on PC. But some time ago I found this. Maybe it works for you.

          http://stevenhickson.blogspot.de/2013/06/voice-command-v30-for-raspberry-pi.html

          1 of 1 people found this helpful
          • Re: Wolfson audio card + Jasper ?
            willondubs

            Hi Frederick,

            Jasper works fine with the Wolfson audio card using the .asoundrc found at the link below. It allows alsa to play/record in any rate format. I also removed the hw: references in boot.py and mic.py. The original error you got is due to the wolfson card throwing an error on the samplerate.

             

            Raspberry Pi and Karaoke Machine (Wolfson Pi Use and its Limitation)

             

            Here is where they admit the unintentional behavior:

            Re: PJSIP/PJSUA with Wolfson audio card

            Element14: "I can confirm your observation on the sample rate limitation. From our perspective it wasn’t the intention to limit the audio ADC and DAC sample rates to above 32k. At the moment we are investigating an update to the drivers which will allow full 8k to 192k support for the analogue inputs and outputs."

              • Re: Wolfson audio card + Jasper ?
                malakai

                I do believe I have it working but I cannot get sound to output. The example Wolfson gave had the sound connected to the SPKOUT and a 5v supply connected to the card. Is this the only way to get Jasper to play sound with Wolfson?

                  • Re: Wolfson audio card + Jasper ?
                    willondubs

                    Hi Todd,

                    Getting Jasper to play requires that you can play a wav file using aplay with no arguments. Once that works, you want to remove the aplay hardware references(-D hw:x,x) in /boot/boot.py and /client/mic.py

                     

                    Try this file:

                    aplay /home/pi/jasper/static/audio/jasper.wav
                    
                    

                     

                    My standard speakers work in the line out (green plug) and from the headphone out (black). Jasper works great with the onboard digital mics.

                      • Re: Re: Wolfson audio card + Jasper ?
                        malakai

                        Thank you I think I am getting closer here's the error without the edits

                         

                         

                        pi@raspberrypi ~ $ aplay /home/pi/jasper/static/audio/jasper.wav

                        ALSA lib pcm_direct.c:1658:(snd1_pcm_direct_parse_open_conf) Unknown field the

                        aplay: main:682: audio open error: Invalid argument

                         

                         

                        OK it plays if I sudo

                         

                        aplay /home/pi/jasper/static/audio/jasper.wav 

                         

                        Is that typical?

                          • Re: Re: Wolfson audio card + Jasper ?
                            malakai

                            Thank you all.

                             

                            It's a hack but I just added sudo aplay to mic.py and boot.py all is well in my world now.

                              • Re: Wolfson audio card + Jasper ?
                                Frederick Vandenbosch

                                Jasper starts up, asks how he can be of service and such, but when I try to give it a command, nothing happens

                                 

                                Edit: ok, I get the beep beep when I say Jasper, and it replies (had to increase input volume for DMIC)

                                But my english must be so bad that it never answers correctly when I ask the time ...

                                  • Re: Wolfson audio card + Jasper ?
                                    Frederick Vandenbosch

                                    Ok, it just seems to have difficulties understanding me, but it works.

                                     

                                    If I repeat nice and slowly, it seems to work! Thanks everyone!

                                    • Re: Wolfson audio card + Jasper ?
                                      theamazingdrew

                                      Frederick

                                       

                                      What did you do to get the Jasper + Wolfson working after you encountered all the error messages? I am encountering similar messages as to what you did, but am not having any luck resolving them. I'm getting the following:

                                       

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

                                      ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

                                      ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

                                       

                                       

                                      ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

                                       

                                       

                                      ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream

                                      ALSA lib pcm_dsnoop.c:551:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream

                                      ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream

                                       

                                       

                                       

                                       

                                      Drew

                                    • Re: Wolfson audio card + Jasper ?
                                      theamazingdrew

                                      For context to my previous post, I followed the RoadTestReview Todd put together. Todd, if you have any thoughts here they'd be appreciated as well.

                              • Re: Wolfson audio card + Jasper ?
                                Frederick Vandenbosch

                                I applied the .asoundrc as you described. The behaviour is now different, but it still crashes.

                                 

                                When running jasper's main.py:

                                 

                                Playing WAVE 'say.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Mono
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
                                ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
                                ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
                                ALSA lib pcm_dsnoop.c:551:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
                                ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
                                ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_rate_samplerate.so
                                ALSA lib pcm_rate.c:1399:(snd_pcm_rate_open) Cannot find rate converter
                                Segmentation fault
                                
                                

                                 

                                When searching for the file, it is indeed not there:

                                 

                                pi@raspberrypi ~/jasper/client $ sudo ls -l /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_rate_samplerate.so
                                
                                ls: cannot access /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_rate_samplerate.so: No such file or directory
                                
                                

                                 

                                When playing out without the "hw" referenc emanually (this is what you removed from the mic.py ?):

                                 

                                pi@raspberrypi ~/jasper/client $ aplay beep_hi.wav
                                Playing WAVE 'beep_hi.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
                                ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_rate_samplerate.so
                                ALSA lib pcm_rate.c:1399:(snd_pcm_rate_open) Cannot find rate converter
                                Segmentation fault
                                
                              • Re: Wolfson audio card + Jasper ?
                                rjones9

                                Hey Frederick,

                                 

                                I'm trying to get voice command by Steven Hickson to work with the Wolfson audio card. It seems like i'm having similar issues to what you experienced with Jasper. I currently can play music just fine through the pi, just when I try to set up voice command i am not able to get audio to output. I changed the .asoundrc file on the pi thinking it may be a similar issue but am still not getting any audio. I was wondering if you had and ideas of how I might be able to troubleshoot this problem.

                                 

                                Thanks,

                                Ryan

                                  • Re: Wolfson audio card + Jasper ?
                                    Frederick Vandenbosch

                                    Hi Ryan,

                                     

                                    as you read here, I was struggling a lot to get Jasper to run with Wolfson also.

                                     

                                    I think the best approach would be to create a new discussion and have others participate there, as this will create the best visibility on your problem.

                                    Also try to attach log files/screenshots/anything that seems useful to help troubleshoot the problem.

                                     

                                    Frederick

                                  • Re: Wolfson audio card + Jasper ?
                                    tridders

                                    Has anyone got this working with the cirrus logic audio card and a raspberry pi 2? I am trying to use spkout speakers and the DCIM microphones with Jasper.

                                     

                                    I manually installed Jasper ontop of the cirrus audio card image as per the instructions from Jaspers website. The image was working fine before the install of Jasper.

                                     

                                    I have replaced the asoundrc file with the one built by ragnar.jensen in this post http://www.element14.com/community/roadTestReviews/1810. However I am pretty sure this is meant for the original woflson audio card and the raspberry pi b.

                                     

                                    When running jasper I get the welcome audio message played out through the raspberry pi headphone jack and then it fails with this error:

                                     

                                    No handlers could be found for logger "cmuclmtk"

                                    *******************************************************

                                    *             JASPER - THE TALKING COMPUTER           *

                                    * (c) 2015 Shubhro Saha, Charlie Marsh & Jan Holthuis *

                                    *******************************************************

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

                                    ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

                                    ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

                                     

                                    ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

                                     

                                    ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave

                                    ALSA lib pcm_direct.c:877:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access

                                    ALSA lib pcm_dmix.c:1030:(snd_pcm_dmix_open) unable to initialize slave

                                    ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream

                                    ALSA lib pcm_direct.c:877:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access

                                    ALSA lib pcm_dmix.c:1030:(snd_pcm_dmix_open) unable to initialize slave

                                    ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave

                                    ALSA lib pcm_dsnoop.c:551:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream

                                    ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave

                                    ALSA lib pcm_direct.c:877:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access

                                    ALSA lib pcm_dmix.c:1030:(snd_pcm_dmix_open) unable to initialize slave

                                    ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave

                                    ALSA lib pcm_direct.c:877:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access

                                    ALSA lib pcm_dmix.c:1030:(snd_pcm_dmix_open) unable to initialize slave

                                    ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave

                                    ALSA lib pcm_direct.c:877:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access

                                    ALSA lib pcm_dmix.c:1030:(snd_pcm_dmix_open) unable to initialize slave

                                    ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream

                                    ALSA lib pcm_direct.c:877:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access

                                    ALSA lib pcm_dmix.c:1030:(snd_pcm_dmix_open) unable to initialize slave

                                    ALSA lib pcm_dsnoop.c:612:(snd_pcm_dsnoop_open) unable to open slave

                                    ALSA lib pcm_direct.c:877:(snd1_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access

                                    ALSA lib pcm_dmix.c:1030:(snd_pcm_dmix_open) unable to initialize slave

                                    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

                                    Traceback (most recent call last):

                                      File "/home/pi/jasper/jasper.py", line 148, in <module>

                                        app.run()

                                      File "/home/pi/jasper/jasper.py", line 118, in run

                                        conversation.handleForever()

                                      File "/home/pi/jasper/client/conversation.py", line 31, in handleForever

                                        threshold, transcribed = self.mic.passiveListen(self.persona)

                                      File "/home/pi/jasper/client/mic.py", line 110, in passiveListen

                                        frames_per_buffer=CHUNK)

                                      File "/usr/lib/pymodules/python2.7/pyaudio.py", line 714, in open

                                        stream = Stream(self, *args, **kwargs)

                                      File "/usr/lib/pymodules/python2.7/pyaudio.py", line 396, in __init__

                                        self._stream = pa.open(**arguments)

                                    IOError: [Errno Invalid input device (no default output device)] -9996

                                     

                                    Note I can now not get the cirrus audio card to record or play files I get an error for this as well.

                                     

                                    Any thoughts / comments / help would be hugely appreciated.

                                     

                                    Tom

                                    • Re: Wolfson audio card + Jasper ?
                                      bantammenace

                                      I've successfully used a Wolfson Audio Card with Gerrelt's (Truehl) Squeezeplug Logitech Media Server on a RPi B since it was first included in the Squeezeplug image.

                                      Recently and primarily using Ragnar's (excellent) instructions for setting up the WAC I have the Subsonic open-source web-based media streamer and jukebox working on another RPi B with a WAC.

                                      Now I am trying to get a RPI B to work with the WAC and Jasper. Unfortunately after many, many, many hours of trying and many fresh attempts I just cannot get it to install/run successfully. I suspect that not all the links in the instructions are pointing to where they should be.

                                      I would really appreciate it if someone could provide a working image that I could download. I just love the idea of using the on board microphones to pause/mute my music and I want top try and avoid having to go down the external USB mic route

                                      I will also post this on the Jasper forum and the Raspberry Pi  forum and will let all three forums if anyone is kind enough to provide a copy of their fully working image. Before anyone does I would probably recommend that they run populate.py again and enter through all the stages without entering their personal details.

                                      Certainly it would help CFC Farnell to sell their remaining stock of WACs which otherwise I would imagine would be languishing on the shelves of a warehouse somewhere until the decision was taken to send them to the tip,

                                      Today they are showing as having 2680 in stock which at the current price of £16.50 UK pounds is £44,220 UK pounds. Perhaps CPC Farnell could pay Ragnar something to create an image ?

                                      Thanks for reading,

                                      Thanks in advance

                                      Kind regards