Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lots of stuff I don't understand! #52

Open
Unhallowed1949 opened this issue Sep 2, 2021 · 4 comments
Open

Lots of stuff I don't understand! #52

Unhallowed1949 opened this issue Sep 2, 2021 · 4 comments

Comments

@Unhallowed1949
Copy link

I'm extremely new to raspberry pi. Can anyone help?

pi@raspberrypi:~/dancyPi-audio-reactive-led/python $ sudo python3 visualization.py scroll
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
Traceback (most recent call last):
File "visualization.py", line 368, in
microphone.start_stream(microphone_update)
File "/home/pi/dancyPi-audio-reactive-led/python/microphone.py", line 14, in start_stream
frames_per_buffer=frames_per_buffer)
File "/usr/local/lib/python3.7/dist-packages/pyaudio.py", line 750, in open
stream = Stream(self, *args, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/pyaudio.py", line 441, in init
self._stream = pa.open(**arguments)
OSError: [Errno -9996] Invalid input device (no default output device)

and prior to that when I installed Python 3, warning near the end.

Collecting numpy
Downloading https://www.piwheels.org/simple/numpy/numpy-1.21.2-cp37-cp37m-linux_armv7l.whl (12.3 MB)
|████████████████████████████████| 12.3 MB 7.8 kB/s
Collecting scipy==1.4.1
Downloading https://www.piwheels.org/simple/scipy/scipy-1.4.1-cp37-cp37m-linux_armv7l.whl (50.7 MB)
|████████████████████████████████| 50.7 MB 185 bytes/s
Collecting pyaudio
Downloading https://www.piwheels.org/simple/pyaudio/PyAudio-0.2.11-cp37-cp37m-linux_armv7l.whl (53 kB)
|████████████████████████████████| 53 kB 17 kB/s
Collecting pyqtgraph
Downloading https://www.piwheels.org/simple/pyqtgraph/pyqtgraph-0.12.2-py3-none-any.whl (959 kB)
|████████████████████████████████| 959 kB 346 kB/s
Installing collected packages: numpy, scipy, pyqtgraph, pyaudio
Successfully installed numpy-1.21.2 pyaudio-0.2.11 pyqtgraph-0.12.2 scipy-1.4.1
**WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
================== Compl
**eted Installing Numpy, Scipy, PyAudio, PyQtgraph ==================
================== Start Installing rpi_ws281x ==================
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting rpi_ws281x
Downloading https://www.piwheels.org/simple/rpi-ws281x/rpi_ws281x-4.3.0-cp37-cp37m-linux_armv7l.whl (116 kB)
|████████████████████████████████| 116 kB 355 kB/s
Installing collected packages: rpi-ws281x
Successfully installed rpi-ws281x-4.3.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
================== Completed Installing rpi_ws281x ==================
================== Copying asound.conf ==================
================== Completed copying to /etc/asound.conf ==================
================== Creating backup of alsa.conf ==================
================== Completed backup of alsa.conf -> alsa.conf.bak ==================
================== Replacing text in alsa.conf ==================
================== Completed replacing text in alsa.conf =============

Please help out a noob lol

@naztronaut
Copy link
Owner

The warning you're getting after installation is fine to ignore. It just doesn't like that you're running things as sudo but it's necessary to control the hardware, the Pi won't work without it.

As for the error you're seeing when trying to run it, it's saying t hat the mic isn't being detected.

  • Can you post outputs of these commands:
    • cat /proc/asound/cards
    • cat /etc/modules
    • arecord -l
    • aplay -l

The arecord output should give you a list of devices attached to your Pi. You want to make sure that whatever mic you are connected to is the number found in /etc/asound.conf - by default the installer adds card number 1 to the configuration: https://github.com/naztronaut/dancyPi-audio-reactive-led/blob/master/python/install/asound.conf

You'll just have to change the '1' to whatever number your device is.

@Unhallowed1949
Copy link
Author

Unhallowed1949 commented Sep 3, 2021

Update
Its running but nothing happens. I have 144 LEDs and changed both cards found in asound.conf to "2" as per my results from what you asked for.

pi@raspberrypi:~/dancyPi-audio-reactive-led/python $ sudo python3 visualization.py scroll
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
FPS 44 / 50
FPS 38 / 50
FPS 42 / 50
FPS 43 / 50
FPS 33 / 50
FPS 39 / 50
FPS 28 / 50
FPS 43 / 50
FPS 45 / 50
^CTraceback (most recent call last):
File "visualization.py", line 368, in
microphone.start_stream(microphone_update)
File "/home/pi/dancyPi-audio-reactive-led/python/microphone.py", line 19, in start_stream
y = np.fromstring(stream.read(frames_per_buffer, exception_on_overflow=False), dtype=np.int16)
File "/usr/local/lib/python3.7/dist-packages/pyaudio.py", line 608, in read
return pa.read_stream(self._stream, num_frames, exception_on_overflow)
KeyboardInterrupt

results from output commands
pi@raspberrypi:~ $ cat /proc/asound/cards
0 [b1 ]: bcm2835_hdmi - bcm2835 HDMI 1
bcm2835 HDMI 1
1 [Headphones ]: bcm2835_headpho - bcm2835 Headphones
bcm2835 Headphones
2 [Device ]: USB-Audio - USB PnP Sound Device
C-Media Electronics Inc. USB PnP Sound Device at usb-0000:01:00.0-1.4, full spe

pi@raspberrypi:~ $ cat /etc/modules

/etc/modules: kernel modules to load at boot time.

This file contains the names of kernel modules that should be loaded

at boot time, one per line. Lines beginning with "#" are ignored.

pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 2: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 4/4
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3

@naztronaut
Copy link
Owner

You're getting the FPS so that means it's working. Your settings look good. Are the lights not working?

@nmc5
Copy link

nmc5 commented May 16, 2022

Hi, I am having this issue. I ran those commands and I got similar outputs. The only one that is a little different is aplay:

**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 Headphones]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice#1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice#5: subdevice #1
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
Subdevice #8: subdevice #8

But my lights are still not working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants