alsa

Getting IOError: [Errno Invalid number of channels] -9998 when using mic with PyAudio on Raspberry Pi

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Bad news, everyone! I try to use a microphone on my Raspberry Pi through PyAudio but without success. The microphone is connected to a USB sound card. The microphone works when I go through 'arecord' : pi@raspberrypi ~ $ arecord -D plughw:0,0 -f cd test2.wav Recording WAVE 'test2.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo However, when I do the test record.py in PyAudio, I got an error. The error is the same for all programs in Python that uses PyAudio : pi@raspberrypi /usr/src/pyaudio/test $ python record.py ALSA lib pcm.c

How to synthesize sounds?

给你一囗甜甜゛ 提交于 2019-12-03 09:56:30
问题 I'd like to produce sounds that would resemble audio from real instruments. The problem is that I have very little clue how to get that. What I know this far from real instruments is that sounds they output are rarely clean. But how to produce such unclean sounds? This far I've gotten to do this, it produces quite plain sound from which I'm not sure it's even using the alsa correctly. import numpy from numpy.fft import fft, ifft from numpy.random import random_sample from alsaaudio import PCM

is it possible to dynamic link to libcsd-client.so to enable in call voice recording on Galaxy S4 I9505

故事扮演 提交于 2019-12-03 09:54:35
I9505 runs on APQ8064T and the way how the HAL layer set up the in-call voice recording audio path on the chipset has changed compared to the previous generation MSM8960. Now, in addition to set correct Mixer controls in Kernel, it also requires sending some sort of "magic" commands through libcsd-client.so (Qualcomm proprietary, close source) library to the baseband modem. Google does this for the Nexus 4 (runs APQ8064) at the HAL layer by dlsym the libcsd-client.so (see the csd_start_record function). However, using the AudioRecord API with MediaRecorder.AudioSource.VOICE_DOWNLINK at App

ALSA: Ways to prevent underrun for speaker

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am playing a single channel audio in non-interleaved mode. I am getting underrun when I am writing aduio data into speaker : ALSA lib pcm.c:7339:(snd_pcm_recover) underrun occurred Here is how I write: printf("%d",snd_pcm_avail (spkhandle)); ret = snd_pcm_writen(spkhandle, pSpeakerBuf , framesIn18Millisec); if(ret < 0) { snd_pcm_recover(spkhandle, ret, 0); } What are the different ways/parameter configurations to prevent ALSA under run ? (I am using Linux 3.0, ARM ) Edit: Here is a buffer measurement using snd_pcm_avail() API snd_pcm_avail

Call recording - make it work on Nexus 5X (rooting or custom ROM possible)

依然范特西╮ 提交于 2019-12-03 04:16:30
I'm attempting to use AudioRecord with AudioSource.VOICE_DOWNLINK on Nexus 5X, Android 7.1 (my own build from AOSP). I'm already past the permissions stage - moved my APK to privileged apps, made an adjustment to AudioRecord in Android source to stop throwing an exception about this source. Now I'm getting empty recording buffers during a phone call. I know that there are a lot of call recording apps, and they work on other devices. I've also seen certain apps that can perform some hack on a rooted N5 and make it work. I wish to achieve the same on Nexus 5X - ANY adjustment is OK for me,

ALSA: snd_pcm_hw_params_free() causing memory error

匿名 (未验证) 提交于 2019-12-03 02:41:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm modifying some existing sound code and noticed that when it finishes writing configuration data to the hardware, the code doesn't call snd_pcm_hw_params_free() . The application, for legacy reasons, open and closes the sound hardware for every sound it plays. This has got to be causing memory leak because the snd_pcm_hw_params_t * is never being free'd. So I added a call to `snd_pcm_hw_params_free() and now get the following error: [root@n00200C709F3D namb2]# ./freetest *** glibc detected *** ./freetest: free(): invalid pointer:

PyAudio prints ALSA warnings and does not work

匿名 (未验证) 提交于 2019-12-03 02:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: hey guys i'm trying to run a basic python speech to text code. This is the code. import speech_recognition as sr r = sr.Recognizer() with sr.Microphone() as source: audio = r.listen(source) try: print("You said " + r.recognize(audio)) except LookupError: print("Could not understand audio") The code works fine till it reaches the print stage and then throws this error. Is there anything that i have done wrong? ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM cards

Running pyfluidsynth + pyaudio demo, many problems with alsa and jack

匿名 (未验证) 提交于 2019-12-03 01:44:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm following the demo here . I'm very new to creating audio via python, so I'm not sure how to debug which errors I should consider, what naive things I might be doing wrong. Here are my python errors: >>> import time >>> import numpy >>> import pyaudio >>> import fluidsynth >>> >>> pa = pyaudio.PyAudio() ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2217:(snd

FFMPEG for Android toolchains: arm-linux-armeabi-eabi-pkg-config - is there any toolchain in existence containing the pkg-config tool

匿名 (未验证) 提交于 2019-12-03 01:31:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Does anybody know any toolchain for ffmpeg linux arm platform which contains the arm-linux-androideabi-pkg-config tool? The Android NDK does not contain it. Also has anybody succeeded in building ffmpeg for android that contains the alsa device? Please note that libasound is present on my Ubuntu x86 PC. After very extensive research visiting forums including ffmpeg.org, ffmpeg--nabbles, groups.google.com including the andro and android-ndk gropus, and the Internet in general, I have not succeeded in finding anyone who seems to know of its

List devices with PyAudio on Linux

匿名 (未验证) 提交于 2019-12-03 00:58:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When listing audio devices on Linux (I tried with Raspbian / RaspberryPi) with: import pyaudio p = pyaudio.PyAudio() for i in range(p.get_device_count()): print p.get_device_info_by_index(i) I get these errors. How to have a clean PyAudio running on Raspberry? ALSA lib confmisc.c:1286:(snd_func_refer) Unable to find definition 'cards.bcm2835.pcm.front.0:CARD=0' ALSA lib conf.c:4241:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory ALSA lib conf.c:4720:(snd_config_expand) Evaluate error: No such file or