bishoph / sopare

Real time sound pattern recognition in Python for Raspberry/Banana Pi.
Other
321 stars 86 forks source link

How do I configure recording card/device? #84

Open sbogun opened 4 years ago

sbogun commented 4 years ago

I couldn't get sopare recording any audio on my Raspberry Pi 4 (running Buster). To me it seems sopare doesn't respect asound.conf or .asoundrc files in which I have clearly defined hw:2,0 to be my recoding device. arecord works like a charm accordingly.

The output of ./sopare.py -v -t example however suggests it wants to use Dummy: PCM (hw:1,0) as recording card/device:

DEBUG:sopare.audio_factory:#### Default input device info #####
DEBUG:sopare.audio_factory:defaultSampleRate: 44100.0
DEBUG:sopare.audio_factory:defaultLowOutputLatency: 0.0087074829932
DEBUG:sopare.audio_factory:defaultLowInputLatency: 0.00868480725624
DEBUG:sopare.audio_factory:maxInputChannels: 2
DEBUG:sopare.audio_factory:structVersion: 2
DEBUG:sopare.audio_factory:hostApi: 0
DEBUG:sopare.audio_factory:index: 2
DEBUG:sopare.audio_factory:defaultHighOutputLatency: 0.0348299319728
DEBUG:sopare.audio_factory:maxOutputChannels: 2
DEBUG:sopare.audio_factory:name: Dummy: PCM (hw:1,0)
DEBUG:sopare.audio_factory:defaultHighInputLatency: 0.0348299319728
DEBUG:sopare.recorder:SAMPLE_RATE: 48000
DEBUG:sopare.recorder:CHUNK: 512
INFO:sopare.recorder:start endless recording
INFO:sopare.buffering:buffering queue runner
INFO:sopare.processing:starting append mode
DEBUG:sopare.filter:New window!
DEBUG:sopare.worker:characteristic = 0 {'dfm': 0, 'peaks': [], 'df': 0, 'volume': 0, 'fc': 0.0, 'norm': [0], 'token_peaks': [0, 0, 0, 0, 0, 0]}
DEBUG:sopare.worker:meta = [{'adapting': 0, 'token_peaks': [0, 0, 0, 0, 0, 0], 'pos': 6, 'volume': 0, 'token': 'token', 'silence': 0}]
DEBUG:sopare.worker:characteristic = 1 {'dfm': 0, 'peaks': [], 'df': 0, 'volume': 0, 'fc': 0.0, 'norm': [0], 'token_peaks': [0, 0, 0, 0, 0, 0]}
DEBUG:sopare.worker:meta = [{'adapting': 0, 'token_peaks': [0, 0, 0, 0, 0, 0], 'pos': 12, 'volume': 0, 'token': 'token', 'silence': 0}]

why? Where does it take it from? hw1:0 is not the default card/device!

bishoph commented 4 years ago

As SOPARE uses the pyaudio lib there is no direct interaction which hardware is used. This should be a config issue on your side. Try to edit the alsa.conf directly and set the default hardware according to https://www.alsa-project.org/main/index.php/Asoundrc