summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* nhlt: add nhlt-dmic-info utilityHEADmasterJaroslav Kysela2023-05-166-1/+484
| | | | | | | | | The microphone arrays for Intel platforms are described in the ACPI NHLT table. This table is available in sysfs. Parse this information and use a more common format (json) for output. This information is usable for the further DSP processing. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Release v1.2.9v1.2.9Jaroslav Kysela2023-05-041-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsa-info.sh: increase version to 0.5.3Jaroslav Kysela2023-05-031-161/+161
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsa-info.sh: uname - reduce execs by four, and eliminate a logic bugwileyhy2023-05-031-5/+3
| | | | | | | | | | | | | | | | Per `info uname`, `uname` always prints its data in the same order. Also, "note that A && B || C is not if-then-else. C may run when A is true." https://www.shellcheck.net/wiki/SC2015 set -x; read -r KERNEL_VERSION < <(uname -v); smp=x; \ [[ "$KERNEL_VERSION" = *SMP* ]] && \ { smp=y; readonly smp; false;} || smp=n; set - ... https://github.com/koalaman/shellcheck Fixes: https://github.com/alsa-project/alsa-utils/pull/207 From: wileyhy @ github Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsa-info.sh: Update `test` '-a' and '-o' to '&&' and '||'wileyhy2023-05-031-3/+3
| | | | | | | | | | | | | | | | lines 50, 103: in two compound ['s, replace '-a' with '] && [' SC2166 – Prefer `[ p ] && [ q ]` as `[ p -a q ]` is not well defined. SC2107 – Instead of `[ a && b ]`, use `[ a ] && [ b ]`. line 45: in a compound test command, change '-o' to '|| test' SC1139 – Use `||` instead of `-o` between test commands. SC2109 – Instead of `[ a || b ]`, use `[ a ] || [ b ]`. ... https://github.com/koalaman/shellcheck Fixes: https://github.com/alsa-project/alsa-utils/pull/206 From: wileyhy @ github Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* arecord: use correct durationTj2023-05-031-3/+3
| | | | | | | | | | When a duration is specified but the the capture device cannot use the requested sample rate and an alternative rate is used the duration sample count must be (re)calculated. Fixes: https://github.com/alsa-project/alsa-utils/pull/200 Signed-off-by: Tj <hacker@iam.tj> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: pre-processor: fix regular expression flagsChao Song2023-05-031-2/+2
| | | | | | | | | | | The REG_ICASE flag is a compile-time flag (cflags), it should be used with regcomp() instead of regexec(). Also add the REG_EXTENDED flag in this patch to make patterns like 'tgl|adl' work. Fixes: https://github.com/alsa-project/alsa-utils/pull/195 Signed-off-by: Chao Song <chao.song@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsa-info.sh: print ctl-led list from sysfsJaroslav Kysela2023-03-241-1/+16
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* 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>
* alsabat: improve error handling in bat_init()Jaroslav Kysela2023-02-271-5/+4
| | | | | | | Fix 'LC_ALL=C.UTF-8 ./alsabat' command. Fixes: https://github.com/alsa-project/alsa-utils/issues/192 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsactl: fix OpenBSD compilation (add include of os_compat.h)SASANO Takayoshi2023-02-271-0/+1
| | | | | | Fixes: https://github.com/alsa-project/alsa-utils/pull/193 Signed-off-by: SASANO Takayoshi <uaa@uaa.org.uk> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaucm: fix typo in docs (can can)Jay-7162023-02-271-4/+4
| | | | | | Fixes: https://github.com/alsa-project/alsa-utils/pull/191 Signed-off-by: Jay-716 <13422525511@163.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* include: fix package - add bswap.h and os_compat.h to noinst_HEADERSJaroslav Kysela2023-02-271-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsaucm: add also card index for '-c' argumentJaroslav Kysela2023-02-271-0/+23
| | | | | | Make semantics for this argument in sync with other ALSA utilities. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: add -B,--black-background optionJaroslav Kysela2023-02-102-2/+16
| | | | | Fixes: https://github.com/alsa-project/alsa-utils/issues/176 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: pre-process-object: Expand definitions within stringsJyri Sarha2023-02-061-7/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expand the pre-processor to allow for expanding the definitions, object attribute references and arithmetic expressions within strings. With this extension its possible to embedded definitions or attribute references into topology string objects. For example: Define { PCM_NUMBER 1 } Object.Pipeline { pcm-playback.0 { Object.Widget { copier.1 { copier_type "host" } gain.1 { Object.Control.mixer.1 { name 'hw:$[$PCM_NUMBER - 1] Playback Volume' } } Object.Base { route.1 { source copier.host.$index.1 sink gain.$index.1 } } } In the example the $[$PCM_NUMBER - 1] would be replaced with the result of arithmetic expression '1 - 1' in other words '0' , and $index in all occurrences with index attribute found from pipeline object. Any non alpha numeric or '_' character are treated as delimiters for variable names if $[]-notation is not used. Fixes: https://github.com/alsa-project/alsa-utils/pull/189 Signed-off-by: Jyri Sarha <jyri.sarha@intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: pre-process-object: Remove all trailing white spaceJyri Sarha2023-02-061-2/+2
| | | | | Signed-off-by: Jyri Sarha <jyri.sarha@intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Add OpenBSD supportSASANO Takayoshi2023-02-0313-4/+106
| | | | | | | | | | | | | | | - 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>
* topology: pre-processor: support to include conf block with IncludeByKeyChao Song2023-01-241-23/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, The IncludeByKey mechanism only supports conditionally including a topology conf file. Even if we only want to conditionally include a small conf block, we have to use a conf file and in the end we will have a lot of trivial conf files that only contain a single conf blocks. This patch extends the use of IncludeByKey ito support including conf blocks conditionally. For example, the block below will include the route conditionally based on the variable definition COPIER_ROUTE. Define { COPIER_ROUTE 1 } IncludeByKey.COPIER_ROUTE { "1" { Object.Base.route.11 { source copier.module.8.2 sink copier.module.17.2 } } } Fixes: https://github.com/alsa-project/alsa-utils/pull/187 Signed-off-by: Chao Song <chao.song@linux.intel.com> Co-authored-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: nhlt: intel: add support for ssp blob ver 1.5Jaska Uimonen2023-01-245-35/+148
| | | | | | | | | | | | | | | | | | | | Ssp plugin had already a definition for newer nhlt blob version 1.5. Add support to generate that instead of legacy blob. Never blob can be generated by adding "version" field in SSP dai topology2 definition and setting it to lower 16 bits of SSP_BLOB_VER_1_5 (0xee000105) -> 0x105 i.e 8 bits for major and 8 bits for minor version. SSP."0" { id 0 dai_index 0 direction "duplex" name NoCodec-0 version 0x105 } Fixes: https://github.com/alsa-project/alsa-utils/pull/184 Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: plugins: nhlt: add ssp aux controlsJaska Uimonen2023-01-246-38/+1066
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intel ssp blob can have auxiliary controls catenated as tlv array at the end of its "normal" data blob. These are needed in some platforms for example to enable hardware clocks earlier than streaming starts. In topology the auxiliary data classes are embedded into hw_config and can be instantiated like: Object.Base.hw_config."SSP0_0" { id 0 mclk_freq 38400000 bclk_freq 256000 tdm_slot_width 16 format "DSP_A" bclk "codec_provider" fsync "codec_provider" fsync_freq 16000 Object.Base.mn_config."MN_0" { m_div 100 n_div 200 } Object.Base.clk_config."CLK_0" { clock_warm_up 1 mclk 2 warm_up_ovr 3 clock_stop_delay 4 keep_running 5 clock_stop_ovr 6 } } Fixes: https://github.com/alsa-project/alsa-utils/pull/184 Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* aplay,axfer: Replace off64_t with off_tKhem Raj2023-01-236-30/+30
| | | | | | | | | | | | | | | | | | Also replace lseek64 with lseek. _FILE_OFFSET_BITS=64 is passed to needed platforms since configure uses AC_SYS_LARGEFILE macro. Therefore off_t is already 64-bit and lseek is same as lseek64. Additionally this fixes buils with latest musl where these lfs64 functions are moved out from _GNU_SOURCE and under _LARGEFILE64_SOURCE macro alone. This makes the builds fail on 32-bit platforms even though default off_t on musl is 64-bit always. Fixes: https://github.com/alsa-project/alsa-utils/pull/183 Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: propagate nhlt plugin error to main programChao Song2023-01-232-3/+4
| | | | | | | | | Let's propagate nhlt plugin error to main program, so that we don't generate a wrong nhlt blob silently. Fixes: https://github.com/alsa-project/alsa-utils/pull/181 Signed-off-by: Chao Song <chao.song@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: plugins: nhlt: fix ssp debugJaska Uimonen2023-01-232-54/+57
| | | | | | | | Nhlt ssp plugin debug feature was broken due to recent change in ssp indexing, thus fix it. Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* aplay: Fix parsing of format with WAV_FMT_EXTENSIBLE headerAmadeusz Sławiński2023-01-231-4/+20
| | | | | | | | | | WAV_FMT_EXTENSIBLE header contains valid bits per sample, which can be different than bits per sample. Make sure it is taken into account when parsing headers and choosing playback format. BugLink: https://github.com/alsa-project/alsa-utils/pull/178 Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: nhlt: intel: ssp: fix obvious typo for 'codec_provider'Pierre-Louis Bossart2023-01-231-3/+3
| | | | | | | | Looks like a bad search and replace? Fixes: https://github.com/alsa-project/alsa-utils/pull/174 Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Add Georgian translationNorwayFun2022-11-044-2/+2144
| | | | | | Fixes: https://github.com/alsa-project/alsa-utils/pull/169 Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* bat: Add 'readcapture' option to support analyzing external audioTim Bird2022-11-042-0/+20
| | | | | | | | | | | | | | If audio data is captured on another device (ie we are NOT using loopback mode), then allow alsabat to analyze that data, by passing a filename reference on the command line. Add the '--readcapture' option to the argument parser. When this option is specified, avoid doing a local capture, and instead just read the audio data from the indicated file, and analyze that. Fixes: https://github.com/alsa-project/alsa-utils/pull/166 Signed-off-by: Tim Bird <tim.bird@sony.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* configure.ac: fix build without dlfcn.hFabrice Fontaine2022-11-041-1/+4
| | | | | | | | | | | | | | | | | Fix the following static build failure (i.e. without dlfcn.h) raised since version 1.2.7 and https://github.com/alsa-project/alsa-utils/commit/44d3e8aa44fc12f95bfeef0e3a1051e8f77047b5: pre-processor.c:28:10: fatal error: dlfcn.h: No such file or directory 28 | #include <dlfcn.h> | ^~~~~~~~~ Fixes: - http://autobuild.buildroot.org/results/1173a1ee28a58ce565a3274f35e868c35bb2e04e Fixes: https://github.com/alsa-project/alsa-utils/pull/165 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: plugins: nhlt: fix ssp dai indexJaska Uimonen2022-11-044-100/+106
| | | | | | | | | There was a conceptual error in handling the separate ssp dais, so fix it. Fixes: https://github.com/alsa-project/alsa-utils/pull/164 Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: plugins: nhlt: add dmic dai indexJaska Uimonen2022-11-042-4/+3
| | | | | | | | | Dmic might have multiple configurations for the same hw, so add them to nhlt blob. The configurations are separated by dai_index. Fixes: https://github.com/alsa-project/alsa-utils/pull/164 Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: plugins: fix off by 1 mem allocation errorYong Zhi2022-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Fix valgrind memcheck error: ==1337389== Invalid write of size 1 ==1337389== at 0x4A4AFAB: __vsnprintf_internal (vsnprintf.c:117) ==1337389== by 0x4AECF40: __snprintf_chk (snprintf_chk.c:38) ==1337389== by 0x484B870: snprintf (stdio2.h:67) ==1337389== by 0x484B870: print_as_hex_bytes (nhlt-processor.c:112) ==1337389== by 0x484B870: merge_manifest_data (nhlt-processor.c:154) ==1337389== by 0x484B870: do_nhlt (nhlt-processor.c:420) ==1337389== by 0x484B870: _snd_topology_nhlt_process (nhlt-processor.c:484) The consecutive snprintf overwrites always the previous terminator until it hits the very last call of: snprintf(dst, ALSA_BYTE_CHARS + 1, "0x%02x,", *nhlt_buffer); when the size n given to snprintf is 1 more than allocated. Fixes: https://github.com/alsa-project/alsa-utils/pull/162 Signed-off-by: Yong Zhi <yong.zhi@intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* chore: Add link to master branch on GitHub ActionsTomohiro IKEDA2022-11-041-1/+1
| | | | | | Fixes: https://github.com/alsa-project/alsa-utils/pull/161 Singed-off-by: Tomohiro IKEDA <tomohiro.ikeda@justincase-tech.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* chore: Delete .travis.yml because of using not Travis CI but GitHub ActionsTomohiro IKEDA2022-11-042-19/+0
| | | | | | Fixes: https://github.com/alsa-project/alsa-utils/pull/160 Signed-off-by: Tomohiro IKEDA <tomohiro.ikeda@justincase-tech.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* amidi: restore space between bytesJohn Keeping2022-11-041-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | Commit 9a8fcec ("amidi: add timestamp option for dump") removed the space between bytes when dumping MIDI, changing the output from: 90 45 40 80 45 00 to: 904540 804500 It seems that this was an unintentional side effect of refactoring the code to add the new timestamp output but the result is less readable than it was before. Restore the space between bytes in the same message. Fixes: 9a8fcec ("amidi: add timestamp option for dump") Fixes: https://github.com/alsa-project/alsa-utils/pull/158/ Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* axfer: fix typo in manualTakashi Sakamoto2022-11-041-1/+1
| | | | | | | | | | | The spelling of 'aborted' was 'aboeted' in the manual. This commit fixes it. Fixes: a37703614a90 ("axfer: fulfill manual section for libffado backend") Fixes: https://github.com/alsa-project/alsa-utils/pull/156 Reported-by: Chao Song chao.song@linux.intel.com Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Release v1.2.8v1.2.8Jaroslav Kysela2022-10-241-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsactl: Print driver name in infoJaroslav Kysela2022-09-271-0/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* amixer: fix the help for 'events' commandJaroslav Kysela2022-08-251-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* aplay: remove wrongly merged UCM codeJaroslav Kysela2022-08-031-38/+0
| | | | | | | | The code origin comes from me. Unfortunately, it was merged by mistake to another commit. Remove it for now. Fixes: https://github.com/alsa-project/alsa-utils/issues/153 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* aplay: fix the capture file length regressionJaroslav Kysela2022-08-031-1/+1
| | | | | | | | | | The commit 4b959a4 ("aplay: Fix for arecord recording ghost data") intruduced a regression (file may contain more samples than expected). Correct this. Fixes: https://github.com/alsa-project/alsa-utils/issues/163 Fixes: 4b959a4 ("aplay: Fix for arecord recording ghost data") Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* configure: automake - use subdir-objects optionJaroslav Kysela2022-06-021-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* configure: use AC_DISABLE_STATIC (for topology modules)Jaroslav Kysela2022-06-022-1/+1
| | | | | Fixes: https://github.com/alsa-project/alsa-utils/issues/152 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* Release v1.2.7v1.2.7Jaroslav Kysela2022-05-311-1/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: nhlt plugin: second attempt to fix the .so linkingJaroslav Kysela2022-05-311-0/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: nhlt plugin: fix the .so linkingJaroslav Kysela2022-05-311-2/+1
| | | | Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsamixer: add alsamixer.rc.example fileJaroslav Kysela2022-05-312-1/+193
| | | | | | Fixes: https://github.com/alsa-project/alsa-utils/issues/112 From: Bertram Felgenhauer / int-e / github Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* topology: plugins: nhlt: fix intel dmic mode calculationJaska Uimonen2022-05-311-4/+4
| | | | | | | | | | | Dmic find_modes function was used with same sampling rate for both fifo a and b parameter calculations. This bug was found in testing two simultaneous dmic dais in topology. Fix this by introducing a sampling rate argument for find_modes. Fixes: https://github.com/alsa-project/alsa-utils/pull/148 Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* aplay: Fix for arecord recording ghost dataAmadeusz Sławiński2022-05-312-4/+4
| | | | | | | | | | When recording we should only write the amount of data read to output file instead of copying whole buffer. This fixes glitches appearing at the end of recorded file, when stopping recording. Fixes: https://github.com/alsa-project/alsa-utils/pull/150 Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* alsactl: implement 'info' commandJaroslav Kysela2022-05-105-1/+273
| | | | | | | It may be useful to collect the basic sound card information. The output is in the YAML structured syntax (human and machine readable). Signed-off-by: Jaroslav Kysela <perex@perex.cz>