GithubHelp home page GithubHelp logo

chatterpi's People

Contributors

viennamike avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chatterpi's Issues

ALSA buffer underruns on some models of Raspberry Pi

This is a strange one. Version 0.9 runs fine on a Raspberry Pi Zero W, which one would think was relatively slow, but generates many ALSA buffer underrun errors on a Pi4 and reported on a Pi3B.

The issue is clearly related to taking too long in the audiopy callback function that determines the jaw movements, but I have not found a way to make that run any faster.

Increasing the buffer size to 16384 seems to elliminate the problem on the Pi4.
Changing the CPU governor to performance mode may also help, but it wasn't sufficient by itself.

Need to update the documentation to reflect this.

Issues when running main.py

I have tried your setup on a RPI 3a+ using Buster and have all package requirements installed. Alsamixer shows my default correctly and I can use aplay to play a .wav just fine.

When I run python3 main.py I'm getting a
'AUDIO' object has no attribute 'play_audio' and nothing plays.

Any ideas.

Could I use and i2c servo controller?

Could I use something like an Waveshare Servo Driver HAT 16-Channel 12-bit I2C Interface or an Adafruit 16-Channel PWM / Servo HAT with this code? And if I could how would i modify the code?

Invalid configuration not caught

If PROP_TRIGGER is START (start immediately and keep the audio open) then the only valid value for SOURCE is MICROPHONE. You can't use this trigger setting with audio files. If this improper configuration is set, program exits with unhelpful errors.

Fix: Check at startup for this invalid configuration. If present, inform user of the problem and how to fix it before gracefully closing.

Kill PID vs. .py script

Hey ViennaMike! Thought I'd mention this, instead of looking up the PID each time when auto-starting/scheduling ChatterPi to run, using 'pkill -9 -f main.py' at the terminal is quite faster. If that's helpful for the guide. Cheers!

Error when Setting playback to LEFT channel only

I get a read-only error on line 89 of audio.py followed by a bunch of other errors when I try to play a stereo track with only the left channel, using the right channel to drive the servo only. The file plays fine when the flag is set to BOTH.

GUI + Boot On Startup Not Working

Hi there. I am extremely new to my Raspberry Pi B 4gb Model, so perhaps this is user error but I am having two issues:

  1. I tried to run the controlPanel.py however it did not work. The last line of my error message said Syntax Error "(" unexpected.

  2. Auto boot wont run, I've followed directions to a T

  3. I havent had the opportunity to test the mic yet... but.. when I use the commands:
    $ cd /home/pi/chatterpi
    $ python3 main.py

it will start up and play the default ambient sound that comes with ChatterPi; so it seems to be working?

there are some other tiny errors in your manual that throws a noob like myself off. The one on page 11 discussing the path for auto-boot is listed as "...system/system..." versus "...systemd/system..." May also want to suggest for noobs that to drop the chatterpi.service file, they should open it with "sudo pcmanfm" to allow permissions of dropping it in.

Overall Mike this is an AMAZING PROJECT and I am so happy you have been kind enough to share... I really hope I can get these issues figured out as I am sweating bullets because this convention is 4 weeks away.

Hope to hear back soon. If you have a discord or other means of contact, please let me know! I can walk you through what I am doing and maybe catch something I am doing wrong on my end.

Thanks!!!

Unable to get Chatterpi to Use Microphone - Stops execution

I am working on a Proof Of Concept for a cosplay prop using chatterpi. My goal is to test using a Raspberry pi 3B with a Tower Pro MG90s Micro Servo to move a Jaw on a Wearable Skull when I talk. I have it wired to the proper GPIO Pins. I am using a UGreen USB sound card. The Sound card is connected to a Throat Microphone so that no external sounds can be picked up outside of my voice. There will be no audio output as I want to have the prop move when I talk.
The Pi detects the USB Sound Card (I have tried multiple sound cards.) I did disable the built in sound card by adding blacklist snd_bcm2835 to the modprobe.d directory under the alsa-blacklist.conf file. The alsa-base.conf file shows options snd-usb-audio index=1

pi@raspberrypi:/etc $ lsusb -t
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
        |__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/3p, 480M
            |__ Port 1: Dev 5, If 0, Class=Vendor Specific Class, Driver=lan78xx, 480M
            |__ Port 2: Dev 6, If 0, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 6, If 1, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 6, If 2, Class=Audio, Driver=snd-usb-audio, 12M
            |__ Port 2: Dev 6, If 3, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 2: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 2: Dev 4, If 1, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 2: Dev 4, If 2, Class=Human Interface Device, Driver=usbhid, 12M

Alsa Mixer shows the PulseAudio card and I can set it to the USB sound card.
I can use APLAY to record and playback sound files using the command prompt.
Audacity can utilize the sound card as well.

I have followed the instructions in the README.md file.

$sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt update
**Then install the package for Python 3:**
$ sudo apt install python3-gpiozero
**To install PiGPIO, type:**
$ sudo apt install pigpio
$ sudo systemctl enable pigpiod
$ sudo apt-get install python3-pigpio _The first command downloads and install PiGPIO, while the second command ensures that it starts running in the background whenever the Pi starts. The 3rd command loads the required python package._
**To install PortAudio**:
$ sudo apt-get install portaudio19-dev
**To install PyAudio**
$ sudo apt-get install python3-pyaudio
**To install Scipy, use the command:**
$ sudo apt-get install python3-scipy

I have also installed the following packages

$ sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0
And $ sudo pip3 install pyaudio to ensure audio libraries are installed.

I have copied the contents of chatterpi_v0.9 into the /home/pi/chatterpi directory and I have copied the ambient and vocals directory to the chatterpi directory.

pi@raspberrypi:~/chatterpi $ ls -la
total 92
drwxr-xr-x  5 pi pi 4096 May 18 16:09 .
drwxr-xr-x 20 pi pi 4096 May 18 16:04 ..
drwxr-xr-x  2 pi pi 4096 May 16 22:33 ambient
-rw-r--r--  1 pi pi 8062 Dec 26 23:35 audio.py
-rw-r--r--  1 pi pi 7037 May 18 14:48 audio.pyc
-rw-r--r--  1 pi pi  537 Dec 26 23:35 bandpassFilter.py
-rw-r--r--  1 pi pi 1061 May 18 14:49 bandpassFilter.pyc
-rw-r--r--  1 pi pi  462 May 18 16:06 config.ini
-rw-r--r--  1 pi pi  451 May 16 22:36 config.ini.back
-rw-r--r--  1 pi pi 1819 Dec 26 23:35 config.py
-rw-r--r--  1 pi pi 1504 May 18 14:48 config.pyc
-rw-r--r--  1 pi pi 6978 Dec 26 23:35 controlPanel.py
-rw-r--r--  1 pi pi 2877 Dec 26 23:35 control.py
-rw-r--r--  1 pi pi 2451 May 18 14:48 control.pyc
-rw-r--r--  1 pi pi  337 Dec 26 23:35 main.py
-rw-r--r--  1 pi pi 1685 Dec 26 23:35 maxVol.py
-rw-r--r--  1 pi pi    0 May 18 16:09 output.txt
drwxr-xr-x  2 pi pi 4096 May 16 22:41 __pycache__
-rw-r--r--  1 pi pi 1855 Dec 26 23:35 tracks.py
-rw-r--r--  1 pi pi 2011 May 18 14:48 tracks.pyc
drwxr-xr-x  2 pi pi 4096 May 16 22:33 vocals
pi@raspberrypi:~/chatterpi $

I have modified the config.ini file with the following.

[SERVO]
servo_min = 548
servo_max = 1020
min_angle = 90
max_angle = 180

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

[AUDIO]
buffer_size = 2048
source = MICROPHONE
output_channels = BOTH
mic_time = 60
ambient = OFF

[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

When I run the python script I get numerous ALSA errors which The readme said was normal, but the script ultimately times errors out. – Some times the servo will move. Most times it wont.

pi@raspberrypi:~/chatterpi $ python3 main.py
ALSA lib confmisc.c:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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 sysdefault
ALSA lib confmisc.c:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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 sysdefault
ALSA lib confmisc.c:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value 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
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_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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:{AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2  CARD 2}
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1822:(_snd_pcm_hw_open) Invalid value for card
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
ALSA lib confmisc.c:767:(parse_card) cannot find card '2'
ALSA lib conf.c:4568:(_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:4568:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
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 dmix
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.c:8424:(snd_pcm_recover) underrun occurred
Expression 'err' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3355
Expression 'ContinuePoll( self, StreamDirection_In, &pollTimeout, &pollCapture )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 3907
Expression 'PaAlsaStream_WaitForFrames( stream, &framesAvail, &xrun )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 4285
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/home/pi/chatterpi/audio.py", line 117, in cleanup
    normalEnd()
  File "/home/pi/chatterpi/audio.py", line 114, in normalEnd
    self.jaw.angle = None
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 432, in __setattr__
    return super(CompositeDevice, self).__setattr__(name, value)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 148, in __setattr__
    return super(GPIOBase, self).__setattr__(name, value)
  File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1788, in angle
    self.value = None
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 432, in __setattr__
    return super(CompositeDevice, self).__setattr__(name, value)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 148, in __setattr__
    return super(GPIOBase, self).__setattr__(name, value)
  File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1627, in value
    self.pwm_device.pin.frequency = None
AttributeError: 'NoneType' object has no attribute 'frequency'
pi@raspberrypi:~/chatterpi $

when I configure the config.ini to use source = files, ambient = on, prop_trigger = timer, the ambient file plays, then the audio will start to play and the servo will move. The audio sounds very garbled, and cuts in and out.

I don’t know what is going on and would like to see if I may have configured the pi wrong or if I am doing something incorrectly. Any help would greatly be appreciated.

Wont start at boot?

Hi Mike,
Have the latest code I believe. I have done all in the para describing run automatically on boot, but the program doesn't start. Following reboot, I open a terminal and see this:

Running at boot
Traceback (most recent call last):
File "/home/pi/chatterpi/main.py", line 10, in
c.update()
File "/home/pi/chatterpi/config.py", line 40, in update
SERVO_MIN = int(cfg['SERVO']['SERVO_MIN'])
File "/usr/lib/python3.7/configparser.py", line 958, in getitem
raise KeyError(key)
KeyError: 'SERVO'
pi@raspberrypi:

I've also tried a variety of methods to get this to run, cron, localrc, etc...with no success. Appreciate your thoughts.

Image file not working

Incidentally, the image did not work so I had to do the manual install of
the prerequisites.

Buffer underrun

Using 5 files of 6-10MB each, PIR trigger. function well for about 2 hours, then I get several
buffer underruns reported and playback / trigger sensing stops

ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred

PIR issue and cannot run on startup

Hello, in the new version, the PIR only seems to start the first event and then it seems to go into timer mode and I have it set to FILES and PIR. Also it will not work on startup after putting the chatterpi.service in the etc.systemd.system folder. I did it with permission as well.

Audio playback stops intermittently

While running the program; three vocal tracks, one ambient track, playback seems to work until it stops intermittently with the following trace:
.
.---standard ALSA error messages here....
if you see ALSA error messages above, ignore them
End of PyAudio initialization (audio stops with following error trace):
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gpiozero/pins/pigpio.py", line 245, in _set_state
if value != self.factory.connection.get_PWM_dutycycle(self.number):
File "/usr/lib/python3/dist-packages/pigpio.py", line 1511, in get_PWM_dutycycle
return _u2i(_pigpio_command(self.sl, _PI_CMD_GDC, user_gpio, 0))
File "/usr/lib/python3/dist-packages/pigpio.py", line 1011, in _u2i
raise error(error_text(v))
pigpio.error: 'GPIO is not in use for PWM'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/pi/chatterpi/audio.py", line 97, in filesCallback
self.jaw.angle = jawTarget
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 447, in setattr
return super(CompositeDevice, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 132, in setattr
return super(GPIOBase, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1804, in angle
self._min_value)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 447, in setattr
return super(CompositeDevice, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 132, in setattr
return super(GPIOBase, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1642, in value
((value - self._min_value) / self._value_range)
File "/usr/lib/python3/dist-packages/gpiozero/pins/init.py", line 285, in
lambda self, value: self._set_state(value),
File "/usr/lib/python3/dist-packages/gpiozero/pins/pigpio.py", line 248, in _set_state
raise PinInvalidState('invalid state "%s" for pin %r' % (value, self))
gpiozero.exc.PinInvalidState: invalid state "525" for pin GPIO18

Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/pi/chatterpi/audio.py", line 120, in cleanup
normalEnd()
File "/home/pi/chatterpi/audio.py", line 117, in normalEnd
self.jaw.angle = None
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 447, in setattr
return super(CompositeDevice, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 132, in setattr
return super(GPIOBase, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1798, in angle
self.value = None
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 447, in setattr
return super(CompositeDevice, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 132, in setattr
return super(GPIOBase, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1637, in value
self.pwm_device.pin.frequency = None
AttributeError: 'NoneType' object has no attribute 'frequency'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/pi/chatterpi/audio.py", line 120, in cleanup
normalEnd()
File "/home/pi/chatterpi/audio.py", line 117, in normalEnd
self.jaw.angle = None
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 447, in setattr
return super(CompositeDevice, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 132, in setattr
return super(GPIOBase, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1798, in angle
self.value = None
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 447, in setattr
return super(CompositeDevice, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 132, in setattr
return super(GPIOBase, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1637, in value
self.pwm_device.pin.frequency = None
AttributeError: 'NoneType' object has no attribute 'frequency'
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "/home/pi/chatterpi/audio.py", line 120, in cleanup
normalEnd()
File "/home/pi/chatterpi/audio.py", line 117, in normalEnd
self.jaw.angle = None
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 447, in setattr
return super(CompositeDevice, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 132, in setattr
return super(GPIOBase, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1798, in angle
self.value = None
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 447, in setattr
return super(CompositeDevice, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 132, in setattr
return super(GPIOBase, self).setattr(name, value)
File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 1637, in value
self.pwm_device.pin.frequency = None
AttributeError: 'NoneType' object has no attribute 'frequency'
pi@raspberrypi:~/chatterpi $

This error trace seems pretty consistent, ie, when it quits, the trace always starts at the same point.

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.