Coder Social home page Coder Social logo

maximtrp / spectrumled Goto Github PK

View Code? Open in Web Editor NEW
12.0 5.0 0.0 1.89 MB

Spectrum analyzer on a LED matrix :sound:

License: GNU General Public License v3.0

Python 100.00%
spectrum-analyzer hardware led raspberry-pi led-matrix raspberry visualization

spectrumled's Introduction

Hello! ๐Ÿ‘‹

Here is a list of my repos:

Repository Description GitHub
Science
bitermplus Biterm topic models (for short texts)
fixation-correction Fixation Correction plugin for Pupil Labs software
mchmm Markov chains and hidden Markov models
scikit-na Missing data analysis
scikit-posthocs Multiple pairwise comparison tests
tmplot Visualization of topic modeling results
Web
youtrack-vscode-extension YouTrack Extension for Visual Studio Code
droneci-vscode-extension Drone CI Extension for Visual Studio Code
tab Start page generator
randpaper Random photo from Pexels
CLI tools
ranger-archives Ranger plugin for creating and extracting archives
ranger-cmus Ranger plugin for integration with *cmus audio player
mufi Simple music finder for command-line
lastfm-cli-scrobbler Last.fm CLI scrobbler
Arduino
spectrumLED Spectrum analyzer on a LED matrix
heart-sensor Heart rate sensor
lastfm-cli-scrobbler Mood lamp based on arduino and WS2812 RGB leds
Linux WMs
i3blocks-blocklets Useful blocklets for *i3blocks*
awesome-wm-widgets Widgets for Awesome WM

spectrumled's People

Contributors

maximtrp avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

spectrumled's Issues

Problem asound.conf

Hi, I have tried to configure the asound.conf and it does not work.
Hardware
(0, 'bcm2835 ALSA: - (hw:0,0)', 0)
(1, 'bcm2835 ALSA: IEC958/HDMI (hw:0,1)', 0)
(2, 'USB Audio DAC: - (hw:1,0)', 0)
(3, 'Loopback: PCM (hw:2,0)', 32)
(4, 'Loopback: PCM (hw:2,1)', 32)
(5, 'sysdefault', 0)
(6, 'default', 0)
(7, 'dmix', 0)

I make the changes in the example asound.conf and I do not have audio.

You can help me.

Thanks

USB DAC and device OUT

Hi @maximtrp.
I am configuring Raspotify + SpectrumLED but I am not detecting the device out.

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  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 #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  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 #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: VX1 [VX1], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

asound.conf

pcm.!default {
	type plug
	playback.pcm "out"
	capture.pcm "loopin"
}

pcm.out {
    type plug
    slave.pcm {
        type multi
        slaves {
            a { channels 2 pcm "output" }
            b { channels 2 pcm "loopout" }
        }
        bindings {
            0 { slave a channel 0 }
            1 { slave a channel 1 }
            2 { slave b channel 0 }
            3 { slave b channel 1 }
        }
    }
    ttable [
        [ 1 0 1 0 ]   # left  -> a.left,  b.left
        [ 0 1 0 1 ]   # right -> a.right, b.right
    ]
}

pcm.loopout {
    type dmix
	ipc_key 1025
	slave.pcm "hw:0,0,0"
    slave {
        period_time 0
        period_size 1024
        buffer_size 8192
        channels 2
    }
    bindings {
        0 0
        1 1
    }
}

pcm.loopin {
    type plug
	slave.pcm "hw:0,1,0"
}

pcm.output {
	type dmix
	ipc_key 1024
	slave.pcm "hw:1,0"
    slave {
        period_time 0
        period_size 1024
        buffer_size 16384
        channels 2
    }
    bindings {
        0 0
        1 1
    }
}

With librepot I can detect the available devices, but it is not out.

$  librespot --name cubex --backend alsa --device ?

[2020-04-23T20:01:03Z INFO  librespot] librespot (raspotify v0.14.0) 3672214 (2020-01-30). Built on 2020-02-16. Build ID: 7pZDdYUK
[2020-04-23T20:01:03Z INFO  librespot_playback::audio_backend::alsa] Using alsa sink
Listing available alsa outputs
pcm devices:
sysdefault:CARD=VX1
	VX1, USB Audio
	Default Audio Device

front:CARD=VX1,DEV=0
	VX1, USB Audio
	Front speakers

surround21:CARD=VX1,DEV=0
	VX1, USB Audio
	2.1 Surround output to Front and Subwoofer speakers

surround40:CARD=VX1,DEV=0
	VX1, USB Audio
	4.0 Surround output to Front and Rear speakers

surround41:CARD=VX1,DEV=0
	VX1, USB Audio
	4.1 Surround output to Front, Rear and Subwoofer speakers

surround50:CARD=VX1,DEV=0
	VX1, USB Audio
	5.0 Surround output to Front, Center and Rear speakers

surround51:CARD=VX1,DEV=0
	VX1, USB Audio
	5.1 Surround output to Front, Center, Rear and Subwoofer speakers

surround71:CARD=VX1,DEV=0
	VX1, USB Audio
	7.1 Surround output to Front, Center, Side, Rear and Woofer speakers

iec958:CARD=VX1,DEV=0
	VX1, USB Audio
	IEC958 (S/PDIF) Digital Audio Output

dmix:CARD=VX1,DEV=0
	VX1, USB Audio
	Direct sample mixing device

dsnoop:CARD=VX1,DEV=0
	VX1, USB Audio
	Direct sample snooping device

hw:CARD=VX1,DEV=0
	VX1, USB Audio
	Direct hardware device without any conversions

plughw:CARD=VX1,DEV=0
	VX1, USB Audio
	Hardware device with all software conversions

ctl devices:
hwdep devices:

What can be missing in my configuration?

Pulseaudio

Hi,

Thank you for this. If PulseAudio is installed, there's no need to setup a loopback device, as Pulseaudio provides monitor buses for all audio channels.

Just

sudo apt-get install pulseaudio

and

python3 spectrumLED.py

and it should work instantly.

snd-aloop issue

Thanks for sharing this cool project. I'm trying to get it up and running but I have a slightly different setup:

  • rpi 3 with raspbian stretch using python 3.5
  • usb audio card from ebay
  • single max7219

The usb audio card is enabled by editing /usr/share/alsa/alsa.conf, look for these lines:

defaults.ctl.card 0
defaults.pcm.card 0

and change the value to 0.

when I run aplay -l it lists the following:

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 6/7
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 IEC958/HDMI [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

and:

$ cat /proc/asound/cards
 0 [ALSA           ]: bcm2835_alsa - bcm2835 ALSA
                      bcm2835 ALSA
 1 [Device         ]: USB-Audio - USB Audio Device
                      GeneralPlus USB Audio Device at usb-3f980000.usb-1.2, full speed

adding snd-aloop to /etc/modules and rebooting does not list the loopback device. Only a manual sudo modprobe snd-aloop works but I don't want to run this after every reboot.

Any idea how to fix this?

The idea is to eventually visualize the audio from the usb audio device.

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.