alsa

alsa: latency increases at every underrun

北战南征 提交于 2020-01-24 15:30:29
问题 I'm writing a tipical capture-process-playback loop. Capture using snd_pcm_readi() , some cheap audio process and then playback through snd_pcm_writei() . Single threaded. At 128 period size and 96000KHz I cannot perceive any latency. Good. Periodically I get a buffer underrun ( snd_pcm_writei() returns -EPIPE); It's ok, I'm running a regular Ubuntu 16.04 desktop not configured for low audio latency. After some underruns the latency becomes perceivable. I don't understand why. this is my

ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card arecord: main:722: audio open error: No such file or directory

ぐ巨炮叔叔 提交于 2020-01-24 08:36:30
问题 i am working on speech recognition . for this i am using "alsa-utils" but when i try to use this script #!/bin/bash echo “Recording… Press Ctrl+C to Stop.” arecord -D plughw:1,0 -q -f cd -t wav | ffmpeg -loglevel panic -y -i – -ar 16000 -acodec flac file.flac > /dev/null 2>&1 echo “Processing…” wget -q -U “Mozilla/5.0” –post-file file.flac –header “Content-Type: audio/x-flac; rate=16000” -O – “http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium” | cut -d” -f12 >stt.txt

ALSA lib pcm_hw.c:1667:(_snd_pcm_hw_open) Invalid value for card arecord: main:722: audio open error: No such file or directory

为君一笑 提交于 2020-01-24 08:36:12
问题 i am working on speech recognition . for this i am using "alsa-utils" but when i try to use this script #!/bin/bash echo “Recording… Press Ctrl+C to Stop.” arecord -D plughw:1,0 -q -f cd -t wav | ffmpeg -loglevel panic -y -i – -ar 16000 -acodec flac file.flac > /dev/null 2>&1 echo “Processing…” wget -q -U “Mozilla/5.0” –post-file file.flac –header “Content-Type: audio/x-flac; rate=16000” -O – “http://www.google.com/speech-api/v1/recognize?lang=en-us&client=chromium” | cut -d” -f12 >stt.txt

ALSA: Relation between period size of speaker and mic

这一生的挚爱 提交于 2020-01-20 05:14:05
问题 I have audio conferencing device which has a mic and speaker. Both mic and speaker having same sampling rate set by snd_pcm_hw_params_set_rate_near() say 8000 Hz. Do I need to set period size and number of periods to be same for both (for two such devices communicate each other) ? Or can I choose a different period/period size for speaker than the one configured for mic ? How do I decide on which period and period size to use ? I am using snd_pcm_hw_params_set_period_size_near() and snd_pcm

Tinyalsa/ALSA for Android adjustment. arecord records only noise or nothing

限于喜欢 提交于 2020-01-16 16:42:35
问题 I've installed Alsamixer from Google Play. Gadget is Samsung Galaxy S3. It has one soundcard (indexed as 0), and 4 devices (0-3). The device list (from /proc/asound/devices ) is the following: 0: [ 0] : control 16: [ 0- 0]: digital audio playback 17: [ 0- 1]: digital audio playback 18: [ 0- 2]: digital audio playback 19: [ 0- 3]: digital audio playback 24: [ 0- 0]: digital audio capture 25: [ 0- 1]: digital audio capture 26: [ 0- 2]: digital audio capture 27: [ 0- 3]: digital audio capture 33

PyAudio working, but spits out error messages each time

拥有回忆 提交于 2020-01-08 10:23:12
问题 I'm using PyAudio to record input from the microphone. Since the audio is recording fine for me, should I try to simply suppress its error messages? Or would there be a way of resolving them? ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2212:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib audio/pcm_bluetooth.c:1613:(audioservice_expect) BT_GET_CAPABILITIES failed :

Orangepi DLAN Music Player

爱⌒轻易说出口 提交于 2020-01-07 15:56:09
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> sudo apt install -y gmediarender gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa sudo nano /etc/asound.conf defaults.ctl.card 1 defaults.pcm.card 1 defaults.timer.card 1 sudo gmediarender -f "Pi" -d 来源: oschina 链接: https://my.oschina.net/lanseyujie/blog/3154386

Set mixer as “default” ALSA API

徘徊边缘 提交于 2020-01-06 08:38:26
问题 I wrote a code to open and control mixer volume: char *card, *channel; snd_mixer_t *handle = NULL; snd_mixer_elem_t *elem = NULL; static long alsa_min, alsa_max; void alsa_open_mixer( void ) { int err; static snd_mixer_selem_id_t *sid = NULL; if ((err = snd_mixer_open (&handle, 0)) < 0) return; if ((err = snd_mixer_attach (handle, card)) < 0) goto error; if ((err = snd_mixer_selem_register (handle, NULL, NULL)) < 0) goto error; if ((err = snd_mixer_load (handle)) < 0) goto error; snd_mixer

Port Alsa to Android

纵饮孤独 提交于 2020-01-06 04:20:27
问题 I'm trying to add the usb audio function for my android phone. Is it possible that as long as I can add all the alsa driver to my android system and then i can get what i want? Can anyone give me some hints on how android is using alsa and how I can add alsa kernel modules to existing system? Thank you. 回答1: @James, the android platform already includes alsa for its audio sub system as a standard and you do not need to add it yourself. If you have a rooted phone or a branded phone you can

alsa_aplay not recording on android

牧云@^-^@ 提交于 2020-01-01 06:54:20
问题 I have just started working on android and I am trying to understand how android audio sub-system (alsa) works. I am running an android image in virtual-box running on windows-7 (64 bit). I was fiddling with alsa-utils to record sound. I tried alsa_aplay -C -f S16_LE -c 2 -r 44100 -d 5 foo.wav it said something like: Recording WAVE foo.wav : Signed 16 bit little endian, rate 44100, stereo However, the output file created appears to be blank (after the wav file header). od -x foo.wav 0000000