GithubHelp home page GithubHelp logo

Comments (7)

ViennaMike avatar ViennaMike commented on July 16, 2024

Thanks for your extensive documentation on the problems you're seeing! I'll try to take a look at it over the weekend.

from chatterpi.

ViennaMike avatar ViennaMike commented on July 16, 2024

I just wanted to give you an update. Strangely, I can reproduce a similar issue (although it mostly plays my audio message, with garbling only at the beginning) when I install and run on a Pi 4 (but it worked on a Pi Zero W, which should have had the same issue only worse. You get way more ALSA errors than I get, I'm not sure why, plus you get Jack errors that I don't get (I don't know why yours has Jack trying to run at all). Did you start from a clean Pi install, or were there other things and audio settings already on the Pi? Because I also get
ALSA lib pcm.c:8424:(snd_pcm_recover) underrun occurred
when I run it and get garbled output, but I get a bunch of them and the Pi recovers and keeps running. I can't reproduce the program crashing at that point.

In a perfect world, we woudn't be getting the underrun errors, I'll try a few more things to see if I can elliminate them.

from chatterpi.

naota2k3 avatar naota2k3 commented on July 16, 2024

I have the Raspberry Pi B+, not overclocked running a fresh install of Rasbian on a 128 gig Microsd Card. I have a copy of Rasbian on a Noobs SD but I was going to reserve that for a PI Zero so I can install it into the skull in which I am going to be wearing and have it move when I talk. This is the 3d printed Skull Mask I am going to be using. https://www.youtube.com/watch?v=weCU1Pv9C8o

If needed I can solder on the header and try the RaspberryPi Zero with the Noobs Installed SD CARD. and try seeing if i get different results with the Chatter Pi. I am not too worried about the audio playing as I won't have any speakers but I am trying to have My Microphone which is a throat microphone be used as the input and as I speak it would move the servo in sync to the voice.

from chatterpi.

ViennaMike avatar ViennaMike commented on July 16, 2024

Still working on it. It's really strange. There IS one bug for using sound files that I found, but that's not the main problem. In control.py, add () to the end of line 37 (should be a.play_vocal_track() ).

But the core problem seems to be that somehow the callback function that analyzes the sound chunk and drives the jaw completes in sufficient time on a Pi Zero (and I think on my Pi 3, haven't rechecked), but not on my Pi 4 or your Pi B+. This makes little sense to me. However it may be related to the CPU governor. If I install rpi-cpu.gov (https://github.com/DavidM42/rpi-cpu.gov) and set the governor to "performance" my Pi 4, it doesn't work perfectly, but works better for a sound file, with less overruns and only a little garbling at the start, but it still crashes using MICROPHONE mode (which is what you care about). Note: changing the governor does NOT overclock the Pi, just keeps it from using a power-saving mode, so it shouldn't hurt anything.

You can try those two things to see if they help on your Pi B+. I'm also going to try to refactor my code to use blocking rather than callbacks. I don't know if this will work at all for this functionality, but I'll check it out this week and see if that still works and eliminates the problem.

from chatterpi.

andreasba1206 avatar andreasba1206 commented on July 16, 2024

Hello Mike,

First I would like to Thank you for the project. Thats exactly what I was looking for.

So after finding, I wanted to test this program on my Pi.
As first I have tried this on a Raspberry 3B, but I had issues with the microphone mode as naota2k3.
Then I ordered an Raspi zero W, because I have seen that this was working fine on your side.

So I tried to set it up according your description.
Everything worked fine (much better as on the Rasp 3B).
Only 1 additional reboot during the pigpoid installation was needed ;)
I also added the () in the control.py file.

But finally it does not work (The PIR seems to work).
I will get following error

pi@ChatterPi:~/chatterpi $ python3 main.py
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.front.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround21
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround40.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround40
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround41
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround50
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround51.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround51
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.surround71.0:CARD=0'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM surround71
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM iec958
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.bcm2835_hdmi.pcm.iec958.0:CARD=0,AES0=4,AES1=130,AES2=0,AES3=2'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5047:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM spdif
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline

With following config.ini values:

[SERVO]
servo_min = 1050
servo_max = 1250
min_angle = 90
max_angle = 0

[CONTROLLER]
style = 1
threshold = 2500
level1 = 1500
level2 = 2500
level3 = 3500
filtered_level1 = 1000
filtered_level2 = 2500
filtered_level3 = 4000

[AUDIO]
buffer_size = 16384
source = MICROPHONE
output_channels = BOTH
mic_time = 30
ambient = ON

[PROP]
prop_trigger = START
delay = 10
eyes = ON
trigger_out = ON

[PINS]
jaw_pin = 18
pir_pin = 23
eyes_pin = 25
trigger_out_pin = 16

Please could you help me?

Thanks in advance
Andy

from chatterpi.

andreasba1206 avatar andreasba1206 commented on July 16, 2024

Hello Mike,

I have found out the issue! But I am not sure if it's the same for naota2k3.

I had already added the () in line 31 of the control.py
After checking your code, I found also missing () in line 51 of the control.py

Thanks again!

Andy

from chatterpi.

ViennaMike avatar ViennaMike commented on July 16, 2024

The missing () have been fixed in the latest update (10_3_2021).

from chatterpi.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.