summaryrefslogtreecommitdiff
path: root/alsaloop
Commit message (Collapse)AuthorAgeFilesLines
* alsaloop: fix loopcount conditionJaroslav Kysela2023-02-271-1/+1
| | | | | | BugLink: https://github.com/alsa-project/alsa-utils/issues/185 Fixes: e61f35b ("alsaloop: try adapt avail_min for playback to avoid 100% CPU usage") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Add OpenBSD supportSASANO Takayoshi2023-02-033-0/+4
| | | | | | | | | | | | | | | - ERESTART not supported platform: use EINTR instead - add include/os_compat.h, well-used OS specific definition - copied include/bswap.h from alsa-lib - EPIPE and ESTRPIPE are different usage, but currently EPIPE is used when ESTRPIPE is not defined. To fix this problem, assign ESPIPE instead. Fixes: https://github.com/alsa-project/alsa-utils/pull/186 Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Support "Playback Pitch 1000000" rate shiftPavel Hofman2021-10-281-2/+6
| | | | | | | | | | | | | Linux 5.15 will introduce a new control element "Playback Pitch 1000000" (commit 6fec018 ("usb: gadget: u_audio.c: Adding Playback Pitch ctl for sync playback") which provides feedback mechanism for playback direction of USB Audio Gadget. The control operates in the same way as the existing control element "Capture Pitch 1000000". This patch adds support for this feature. Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Renamed field capt_pitch to ctl_pitchPavel Hofman2021-10-282-9/+9
| | | | | | | | | Renaming capt_pitch to ctl_pitch to respect the naming style of snd_ctl_elem_value_t fields in loopback_handle. Also making the variable name suitable for planned support of playback pitch. Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: fixed parsing value 'auto' of option 'sync'Pavel Hofman2021-10-131-0/+2
| | | | | | | | The value 'auto' was not checked which resulted in using SYNC_TYPE_NONE instead of SYNC_TYPE_AUTO. Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: added option prateshift for PLAYSHIFT ctl elem used in PLAYSHIFTPavel Hofman2021-10-134-23/+77
| | | | | | | | | | | | | | | If snd-aloop device is on playback side, the required sync mode is PLAYSHIFT. That means Loopback ctl elem "PCM Rate Shift 100000" of the corresponding capture side of the Loopback pipe must be controlled (by a reciprocal). ASCII name of the playback rate shift ctl elem is specified with newly added option -x/--prateshift, e.g.: -P hw:Loopback,0 -S playshift \ -x iface=PCM,name='PCM Rate Shift 100000',device=1 Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Adding openctl_elem debug logPavel Hofman2021-10-041-0/+5
| | | | | | | | When debugging what ctl elem was found and opened (if any) a debug log is helpful. Signed-off-by: Pavel Hofman <pavel.hofman@ivitera.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Support "Capture Pitch 1000000" rate shiftYunhao Tian2021-08-232-4/+15
| | | | | | | | | | | | In Linux 5.14, a new feedback mechanism for USB Audio Gadget is introduced (commit e89bb428), along with a new control element "Capture Pitch 1000000". This patch adds support for this feature. Note that this property seems to be the reverse of PCM Rate Shift, so we have to take reciprocal of pitch. Signed-off-by: Yunhao Tian <t123yh@outlook.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: man page - correct "rate" optionnootc2021-04-131-1/+1
| | | | | | | | Change "rate" option from "-c" to "-r". BugLink: https://github.com/alsa-project/alsa-utils/pull/83 From: nootc Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: samplerate - fix the wrong pointer operationJaroslav Kysela2021-03-311-2/+2
| | | | | | | | It seems that the warnings fix introduced a regression. BugLink: https://github.com/alsa-project/alsa-utils/issues/85 Fixes: cc46d02 ("alsaloop: pcmjob - fix few warnings") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: get_queued_playback_samples() - simplify codeJaroslav Kysela2021-01-081-2/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: fix possible memory leak in create_loopback_handle()Jaroslav Kysela2021-01-081-2/+7
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Fix the silence generation in xrun_syncDragos Tarcatu2020-09-251-3/+6
| | | | | | | | | | | | | | | | The silence frames generation in xrun_sync() seems to be currently a bit off as snd_pcm_format_set_silence() uses a wrong buffer address and size for zero-ing out the data. Consequently instead of clearing out the last frame(s), snd_pcm_format_set_silence() ends up silencing samples somewhere else in the buffer. This is partilarly more obvious for higher frame sizes (e.g. more than 2 channels). This patch fixes this issue by correcting the parameters passed to snd_pcm_format_set_silence(). BugLink: https://github.com/alsa-project/alsa-utils/pull/58 Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: reduce cumulative error caused by non-atomic samples calculationRuslan Bilovol2020-03-111-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When doing loopback between two audio card with same sampling frequency, I noticed slow increase of pitch_diff. When I changed order of get_queued_playback_samples() vs get_queued_capture_samples(), I noticed same drift of pitch_diff but if was decreasing this time. This seems to be caused by non-atomic consecutive snd_pcm_delay() invocation for playback then for capture. snd_pcm_delay() measures delay between read/write call and actual ADC/DAC operation. So while we get this value for playback path in get_queued_playback_samples(), next call to get_queued_capture_samples() will happen a little bit later so snd_pcm_delay() may return incorrect value. Be interleaving get_queued_{playback,capture}_samples() order, we divide this small error between playback and capture paths. I do not see any issues anymore with one-way drift of pitch_diff. Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* treewide: Fix printf formatsRosen Penev2019-11-201-5/+5
| | | | | | | Found with cppcheck Signed-off-by: Rosen Penev <rosenp@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsaloop: remove unused assignment warning (coverity)Jaroslav Kysela2019-03-131-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: more avail_min cleanupsJaroslav Kysela2018-10-241-1/+8
| | | | | | | | | | | 1) do not increase avail_min forever It seems that there are broken plugins like pulse which returns from poll() immediately regardless avail_min settings. 2) remove ommited debug printf() Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: pcmjob - fix few warningsJaroslav Kysela2018-10-141-3/+3
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: fix a typo in the comparisonKirill Marinushkin2018-02-051-1/+1
| | | | | | | | | | | | | | | Hello maintainers, I would like to suggest you a patch which fixes a typo in the alsa-utils alsaloop. Best Regards, Kirill Marinushkin Signed-off-by: Kirill Marinushkin <k.marinushkin@gmail.com> Cc: patch@alsa-project.org Cc: alsa-devel@alsa-project.org Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Change FSF address (Franklin Street)Jaroslav Kysela2017-11-145-5/+5
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: try adapt avail_min for playback to avoid 100% CPU usageJaroslav Kysela2016-10-182-3/+47
|
* Makefiles - use AM_CPPFLAGS instead INCLUDESJaroslav Kysela2014-05-071-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: pcmjob.c: use portable way to initialize recursive mutexJohn Spencer2013-11-081-2/+13
| | | | | | | | | | | | | | | | PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is not in POSIX, as _NP (non-portable) suggests. exposing such a symbol in musl libc would lock in the ABI for all times and makes it impossible to do future changes to the under- lying struct without hideous symbol versioning hacks. use the portable way instead: pthread_once was designed for such cases. Signed-off-by: John Spencer <maillist-alsa@barfooze.de> Tested-by: John Spencer <maillist-alsa@barfooze.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: add -z,--syslog option to use syslog for errorsJaroslav Kysela2013-09-161-3/+15
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: fix wrong alias for signal.hJaroslav Kysela2013-07-231-1/+1
| | | | | | | | | | | | in POSIX, there is no <sys/signal.h>. it's merely a legacy alias used by glibc, and the header does nothing else than including <signal.h>. so let's do the right thing and use the right name, which works everywhere. Signed-off-by: John Spencer <maillist-alsa@barfooze.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Several formatting fixes for manpages.Jordi Mallach2013-05-161-27/+27
| | | | | | | | Fix many occurrences of unescaped “-”. Fix minor English issue. Signed-off-by: Jordi Mallach <jordi@debian.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsaloop: Fix missing #endifTakashi Iwai2012-11-301-1/+1
| | | | | | Sorry, forgotten. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsaloop: Make alsaloop working without libsamplerateTakashi Iwai2012-11-301-5/+4
| | | | | | | | | When alsaloop is built with libsamplerate, it quits immediately with No libsamplerate suppor message. It's because the check of -A option and it's set as default non-zero value. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsaloop: fix the avail_min setupJaroslav Kysela2012-05-131-4/+0
| | | | | | | | The previous code does not work as expected for some period_size configurations. We do not rely on the period size value, so do not correlate the avail_min parameter with this value. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Improve xrun_sync - fill missing playback samplesJaroslav Kysela2012-02-201-0/+17
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Use AM_CFLAGS in Makefile.amTakashi Iwai2011-06-031-1/+1
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* alsaloop: another try to force correct formats for libsamplerateJaroslav Kysela2011-03-081-6/+16
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: libsamplerate requires specific formats, force them for slave modeJaroslav Kysela2011-03-071-2/+20
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: rework the ctl event handling routineJaroslav Kysela2010-10-211-24/+27
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Delay the restart a bit (to handle snd-aloop playback xruns better)Jaroslav Kysela2010-10-202-7/+28
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Fix latency printJaroslav Kysela2010-10-141-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: fixes, added -W/--wake optionJaroslav Kysela2010-10-145-34/+101
| | | | | | | | - added -W/--wake option to reduce poll time - another try to fix the avail_min parameter for playback - fixed initial silence fill Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: add -U/--xrun to alsaloop.1 man pageJaroslav Kysela2010-10-131-0/+6
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: added xrun profiling support (-U,--xrun), added SIGUSR1 state dumpJaroslav Kysela2010-10-134-45/+270
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: add --pctl and --cctl options to man pageJaroslav Kysela2010-10-111-0/+10
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz># Please enter the commit message for your changes. Lines starting
* alsaloop: add --pctl and --cctl optionsJaroslav Kysela2010-10-113-8/+34
| | | | | | | In some cases it might be usefull to specify another CTL device names. Add -X/--pctl and -Y/--cctl options. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Fixes and added --workaround optionJaroslav Kysela2010-10-115-38/+112
| | | | | | | | | | - added workaround for alsa-lib (pthread configuration parsing issue) - the workaround must be activated manually using ('--workaround serialopen') - fixed avail_min initialization (caused high CPU usage or xruns) - fixed shared buffer initialization (both capture and playback buffers must have equal number of samples in this config) Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Fix command-line parsing and pollfd initializationJaroslav Kysela2010-10-084-20/+54
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Add OSS mixer redirection supportJaroslav Kysela2010-10-086-6/+138
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: added resampling for unsupported soundcard ratesJaroslav Kysela2010-10-074-81/+223
| | | | | | - improve also xrun synchronization Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: fix resample argument parsingJaroslav Kysela2010-10-072-3/+3
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: fix -a option and slave mode processingJaroslav Kysela2010-10-063-11/+14
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Fix thread handlingJaroslav Kysela2010-10-062-3/+21
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaloop: Fix loopbacks pointer initialization and allocation, fix -T optionJaroslav Kysela2010-10-061-3/+4
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Introduce alsaloop utilityJaroslav Kysela2010-10-068-0/+3170
alsaloop allows create a PCM loopback between a PCM capture device and a PCM playback device. alsaloop supports multiple soundcards, adaptive clock synchronization, adaptive rate resampling using the samplerate library (if available in the system). Also, mixer controls can be redirected from one card to another (for example Master and PCM). Signed-off-by: Jaroslav Kysela <perex@perex.cz>