libao issueshttps://gitlab.xiph.org/xiph/libao/-/issues2023-08-15T11:54:20Zhttps://gitlab.xiph.org/xiph/libao/-/issues/2324reserved identifier violation2023-08-15T11:54:20ZMarkus Elfringreserved identifier violation:eyes: I would like to point out that identifiers like “[`__AO_H__`](https://gitlab.xiph.org/xiph/libao/-/blob/cafce902a73c1050474a62feff83e428bbbee5f4/include/ao/ao.h#L27 "Update candidate")” and “[`__PLUGIN_H__`](https://gitlab.xiph.or...:eyes: I would like to point out that identifiers like “[`__AO_H__`](https://gitlab.xiph.org/xiph/libao/-/blob/cafce902a73c1050474a62feff83e428bbbee5f4/include/ao/ao.h#L27 "Update candidate")” and “[`__PLUGIN_H__`](https://gitlab.xiph.org/xiph/libao/-/blob/cafce902a73c1050474a62feff83e428bbbee5f4/include/ao/plugin.h#L25 "Another update candidate")” [do not fit](https://wiki.sei.cmu.edu/confluence/display/cplusplus/DCL51-CPP.+Do+not+declare+or+define+a+reserved+identifier#DCL51CPP.Donotdeclareordefineareservedidentifier-NoncompliantCodeExample%28HeaderGuard%29 "Do not declare an identifier which is reserved for the compiler implementation.") to the expected naming convention of the C++ language standard.
:thought_balloon: Would you like to adjust your selection for unique names?https://gitlab.xiph.org/xiph/libao/-/issues/2322dynamic linking: initialize fails/crashes2021-10-22T19:06:35Zminttydynamic linking: initialize fails/crashesI'm trying to link libao dynamically, using dlopen.
It fails (i.e. crashes) on ao_initialize, however, while all other functions work as I can verify by a split up configuration, linking ao_initialize statically and all others dynamically.I'm trying to link libao dynamically, using dlopen.
It fails (i.e. crashes) on ao_initialize, however, while all other functions work as I can verify by a split up configuration, linking ao_initialize statically and all others dynamically.https://gitlab.xiph.org/xiph/libao/-/issues/2321libao's OS X stutters on closing audio2021-07-22T17:22:11ZGonzalo Garramunolibao's OS X stutters on closing audioThe MacOSX plugin in libao results in stutter (crackles) when closing the audio.The MacOSX plugin in libao results in stutter (crackles) when closing the audio.https://gitlab.xiph.org/xiph/libao/-/issues/2320ao.m4 is broken on cross-compile environmants2021-04-06T12:50:15ZStas Sergeevao.m4 is broken on cross-compile environmantsao.m4 has a few problems for
cross-compile environments, notably
buildroot.
- It uses prefix for includes/libs.
Namely:
```
elif test "x$prefix" != "xNONE"; then
AO_LIBS="-L$prefix/lib"
```
and
```
elif test "x$prefix" != "xNON...ao.m4 has a few problems for
cross-compile environments, notably
buildroot.
- It uses prefix for includes/libs.
Namely:
```
elif test "x$prefix" != "xNONE"; then
AO_LIBS="-L$prefix/lib"
```
and
```
elif test "x$prefix" != "xNONE"; then
AO_CFLAGS="-I$prefix/include"
```
Prefix is only valid on target.
It should not be used on host.
- It have no checks for cross-compile
environments at all:
```
],, no_ao=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
```
Well, its not OK to "assume OK".
AC_TRY_RUN() should be avoided.
I think the generic AC_CHECK_HEADERS()+
AC_CHECK_LIBS() should do quite fine.https://gitlab.xiph.org/xiph/libao/-/issues/2319When I try to fork Xiph.org/libao I get a "You have reached your project limits"2024-02-02T10:40:25ZGonzalo GarramunoWhen I try to fork Xiph.org/libao I get a "You have reached your project limits"When I try to fork Xiph.org/libao I get a "You have reached your project limits"
I would like to create a fork and set up a merge request please.When I try to fork Xiph.org/libao I get a "You have reached your project limits"
I would like to create a fork and set up a merge request please.https://gitlab.xiph.org/xiph/libao/-/issues/23181.2.2: compile time warnings2019-05-04T10:03:06ZTomasz Kłoczko1.2.2: compile time warningsgcc 9 warnings
<pre>ao_alsa.c: In function &apos;alsa_set_hwparams&apos;:
ao_alsa.c:333:11: warning: enumeration value &apos;SND_PCM_FORMAT_UNKNOWN&apos; not handled in switch [-Wswitch]
333 | switch(internal-&gt;bitformat){...gcc 9 warnings
<pre>ao_alsa.c: In function 'alsa_set_hwparams':
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_UNKNOWN' not handled in switch [-Wswitch]
333 | switch(internal->bitformat){
| ^~~~~~
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S8' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S16_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U16_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U16_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S24_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S32_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U32_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U32_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT64_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT64_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_IEC958_SUBFRAME_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_IEC958_SUBFRAME_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_MU_LAW' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_A_LAW' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_IMA_ADPCM' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_MPEG' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_GSM' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_SPECIAL' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S24_3LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S24_3BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24_3LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24_3BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20_3LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20_3BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20_3LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20_3BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S18_3LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S18_3BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U18_3LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U18_3BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_G723_24' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_G723_24_1B' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_G723_40' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_G723_40_1B' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U8' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U16_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U32_LE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U16_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_DSD_U32_BE' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_LAST' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U16' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U24' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U32' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_FLOAT64' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_IEC958_SUBFRAME' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_S20' not handled in switch [-Wswitch]
ao_alsa.c:333:11: warning: enumeration value 'SND_PCM_FORMAT_U20' not handled in switch [-Wswitch]
ao_alsa.c: In function 'alsa_set_swparams':
ao_alsa.c:485:2: warning: 'snd_pcm_sw_params_set_xfer_align' is deprecated [-Wdeprecated-declarations]
485 | err = snd_pcm_sw_params_set_xfer_align(internal->pcm_handle, params, 1);
| ^~~
In file included from /usr/include/alsa/asoundlib.h:54,
from ao_alsa.c:39:
/usr/include/alsa/pcm.h:1331:5: note: declared here
1331 | int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val) __attribute__((deprecated));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ao_alsa.c: In function 'alsa_test_open':
ao_alsa.c:531:26: warning: unused variable 'params' [-Wunused-variable]
531 | snd_pcm_hw_params_t *params;
| ^~~~~~
ao_alsa.c: In function 'ao_plugin_play':
ao_alsa.c:798:11: warning: unused variable 'ibytes' [-Wunused-variable]
798 | int ibytes = frames * ibytewidth * device->output_channels;
| ^~~~~~
ao_alsa.c:791:9: warning: unused variable 'ostride' [-Wunused-variable]
791 | int ostride = obytewidth*device->output_channels;
| ^~~~~~~
ao_alsa.c:790:9: warning: unused variable 'istride' [-Wunused-variable]
790 | int istride = internal->sample_size;
| ^~~~~~~
ao_pulse.c: In function 'ao_plugin_close':
ao_pulse.c:309:17: warning: implicit declaration of function 'nanosleep'; did you mean 'pa_msleep'? [-Wimplicit-function-declaration]
309 | while(nanosleep(&sleep,&wake)<0){
| ^~~~~~~~~
| pa_msleep
ao_null.c: In function 'ao_null_set_option':
ao_null.c:89:20: warning: unused variable 'internal' [-Wunused-variable]
89 | ao_null_internal *internal = (ao_null_internal *) device->internal;
| ^~~~~~~~
config.c: In function 'ao_read_config_file':
config.c:58:6: warning: unused variable 'end' [-Wunused-variable]
58 | int end;
| ^~~
ao_wav.c: In function 'ao_wav_open':
ao_wav.c:165:29: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
165 | strncpy(internal->wave.riff.id, "RIFF",4);
| ~~~~~~~~~~~~~~~~~~~^~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:167:29: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
167 | strncpy(internal->wave.riff.wave_id, "WAVE",4);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:169:31: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
169 | strncpy(internal->wave.format.id, "fmt ",4);
| ~~~~~~~~~~~~~~~~~~~~~^~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:185:29: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
185 | strncpy(internal->wave.data.id, "data",4);
| ~~~~~~~~~~~~~~~~~~~^~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:189:10: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
189 | strncpy(buf, internal->wave.riff.id, 4);
| ^~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:189:34: warning: pointer targets in passing argument 2 of 'strncpy' differ in signedness [-Wpointer-sign]
189 | strncpy(buf, internal->wave.riff.id, 4);
| ~~~~~~~~~~~~~~~~~~~^~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'const char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:191:13: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
191 | strncpy(buf+8, internal->wave.riff.wave_id, 4);
| ~~~^~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:191:36: warning: pointer targets in passing argument 2 of 'strncpy' differ in signedness [-Wpointer-sign]
191 | strncpy(buf+8, internal->wave.riff.wave_id, 4);
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'const char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:192:13: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
192 | strncpy(buf+12, internal->wave.format.id,4);
| ~~~^~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:192:39: warning: pointer targets in passing argument 2 of 'strncpy' differ in signedness [-Wpointer-sign]
192 | strncpy(buf+12, internal->wave.format.id,4);
| ~~~~~~~~~~~~~~~~~~~~~^~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'const char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:205:13: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
205 | strncpy(buf+60, internal->wave.data.id, 4);
| ~~~^~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
ao_wav.c:205:37: warning: pointer targets in passing argument 2 of 'strncpy' differ in signedness [-Wpointer-sign]
205 | strncpy(buf+60, internal->wave.data.id, 4);
| ~~~~~~~~~~~~~~~~~~~^~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_wav.c:33:
/usr/include/bits/string_fortified.h:103:1: note: expected 'const char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
In file included from ../include/ao/ao.h:94,
from audio_out.c:54:
audio_out.c: In function '_sanitize_matrix':
../include/ao/ao_private.h:201:26: warning: field precision specifier '.*' expects argument of type 'int', but argument 4 has type 'long int' [-Wformat=]
201 | fprintf(stderr,"ao_%s ERROR: " format,device->funcs->driver_info()->short_name,## args); \
| ^~~~~~~~~~~~~~~
audio_out.c:669:11: note: in expansion of macro 'aerror'
669 | aerror("Unrecognized channel name \"%.*s\" in channel matrix \"%s\"\n",
| ^~~~~~
audio_out.c:669:49: note: format string is defined here
669 | aerror("Unrecognized channel name \"%.*s\" in channel matrix \"%s\"\n",
| ~~^~
| |
| int
In file included from ../include/ao/ao.h:94,
from audio_out.c:54:
../include/ao/ao_private.h:203:26: warning: field precision specifier '.*' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat=]
203 | fprintf(stderr,"ERROR: " format,## args); \
| ^~~~~~~~~
audio_out.c:669:11: note: in expansion of macro 'aerror'
669 | aerror("Unrecognized channel name \"%.*s\" in channel matrix \"%s\"\n",
| ^~~~~~
audio_out.c:669:49: note: format string is defined here
669 | aerror("Unrecognized channel name \"%.*s\" in channel matrix \"%s\"\n",
| ~~^~
| |
| int
audio_out.c:668:15: warning: unused variable 'i' [-Wunused-variable]
668 | int i;
| ^
At top level:
audio_out.c:609:13: warning: '_swap_samples' defined but not used [-Wunused-function]
609 | static void _swap_samples(char *target_buffer, char* source_buffer,
| ^~~~~~~~~~~~~
audio_out.c:406:12: warning: '_check_driver_id' defined but not used [-Wunused-function]
406 | static int _check_driver_id(int driver_id)
| ^~~~~~~~~~~~~~~~
ao_au.c: In function 'ao_au_open':
ao_au.c:165:15: warning: pointer targets in passing argument 1 of 'strncpy' differ in signedness [-Wpointer-sign]
165 | strncpy (buf + 24, internal->au.info, 4);
| ~~~~^~~~
| |
| unsigned char *
In file included from /usr/include/features.h:450,
from /usr/include/bits/libc-header-start.h:33,
from /usr/include/stdio.h:27,
from ao_au.c:30:
/usr/include/bits/string_fortified.h:103:1: note: expected 'char * restrict' but argument is of type 'unsigned char *'
103 | __NTH (strncpy (char *__restrict __dest, const char *__restrict __src,
| ^~~~~
</pre>https://gitlab.xiph.org/xiph/libao/-/issues/2317libao_pulse buffer calculation overflow2017-11-03T10:00:01ZGitlab Botlibao_pulse buffer calculation overflowIn tracking down the source of some strange behavior when setting buffer_time for the pulse plugin, I found a bug in the buffer length calculations that results in a multiplication overflow for some values. This overflow would set the bu...In tracking down the source of some strange behavior when setting buffer_time for the pulse plugin, I found a bug in the buffer length calculations that results in a multiplication overflow for some values. This overflow would set the buffer size to some absurdly-large value (~30 seconds in my case).
I've attached a patch that casts the multiplicands to a 64-bit int before the multiplication. This fixed the issue for me.Monty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2307Inconsistent signedness of 8-bit samples2017-11-03T10:00:01ZDaniel Richard G.Inconsistent signedness of 8-bit samplesWhen playing 8-bit audio live, signed 8-bit samples work correctly.
When writing to a file with the "au" driver, signed samples also work correctly.
However, when writing to a "wav" file, signed samples yield incorrect output. The samp...When playing 8-bit audio live, signed 8-bit samples work correctly.
When writing to a file with the "au" driver, signed samples also work correctly.
However, when writing to a "wav" file, signed samples yield incorrect output. The samples must be converted to unsigned (by XOR'ing with 0x80) in order to produce a recognizable WAV file.
WAV files have the peculiarity of encoding 8-bit samples in unsigned form. I believe signed samples make more sense for API purposes, and Libao should handle the conversion itself when writing a WAV file.
(Currently, it is necessary to add special-casing to the application to perform this conversion when writing out an 8-bit WAV file.)Monty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2286[PATCH] Revamped support for Microsoft Windows2017-11-03T10:00:01ZDaniel Richard G.[PATCH] Revamped support for Microsoft WindowsI've put together a patch to Libao, against Git master (currently `97c0dea6`), that fixes and simplifies the support for Windows.
First, I've added an NMAKE makefile that can be used with Microsoft Visual Studio. I have tested the build...I've put together a patch to Libao, against Git master (currently `97c0dea6`), that fixes and simplifies the support for Windows.
First, I've added an NMAKE makefile that can be used with Microsoft Visual Studio. I have tested the build with the following versions:
* Microsoft Visual C++ 6.0 (does not build due to missing APIs)
* Microsoft Visual Studio 2003 .NET
* Microsoft Visual Studio 2005
* Intel ICC 11.1 + MSVC9 Platform SDK
This is accompanied by a small batch file that handles the instantiation of `os_types.h` from `os_types.h.in`. Together, these allow building Libao using only Microsoft tools.
(I have further tested the linking of a small sound application with the built library, and confirmed that it works correctly.)
I've tweaked things so that on Windows, the system config for Libao is at
```
C:\Program Files\Common Files\Xiph.Org\libao.conf
```
and the user config is at
```
${LOCALAPPDATA}\Xiph.Org\libao.conf
```
This follows Windows conventions reasonably well without resorting to the Registry.
In `ao_private.h`, I've added two new sets of logging macros. One uses C99 syntax for variadic macros, supported by Visual Studio 2005 and later. The other is for older systems that do not support variadic macros at all. It's a hack, and has the shortcoming that messages are written to `stdout` instead of `stderr`, but it's better than nothing.
The remainder are small changes, which I'll describe below:
* `Makefile.am`: Added the two new Windows build files to `EXTRA_DIST`
* `include/ao/Makefile.am`: Don't include `os_types.h` (generated file) in the distribution tarball
* `include/ao/ao_private.h`: Use `strdup()` with an underscore prefix to keep the Microsoft compiler happy
* `src/ao_wmm.c`: Moved `-D_CRT_SECURE_NO_DEPRECATE` out to the makefile, because it also quashes warnings in the other source files
* `src/ao_wmm.c`: Use `#pragma comment(lib)` directives to bake in a reference to the two Windows libraries required by this code; this simplifies application linking later
* `src/ao_wmm.c`: Must `#include<ks.h>` or else you get this error:
```
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\KsMedia.h(16) : fatal error C1189: #error : KS.H must be included before KSMEDIA.H
```
(Also, you must still `#include<ksmedia.h>`, or else you don't get a usable definition of `KSDATAFORMAT_SUBTYPE_PCM`)
* `src/ao_wmm.c`: Add missing newlines to various logging macros
* `src/ao_wmm.c`: Check that `max` is greater than zero, because otherwise the system has no sound devices (saw this on a Windows VM)
* `src/ao_wmm.c`: Properly ignore unsupported options
* `src/audio_out.c`: `dirent.h` does not exist in Microsoft-land
* `src/audio_out.c`: Don't `#include"ao_private.h"`; this is #included from `ao.h`
* `src/audio_out.c`: Removed unused variable, flattened needless block
* `src/config.c`: Corrected AO header #including
* `src/config.c`: Removed unused variableMonty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2282Sample rate: return effective value, option to disable auto-conversion2017-11-03T10:00:01ZDaniel Richard G.Sample rate: return effective value, option to disable auto-conversionI am writing a program based on LibAO that synthesizes sound. For this to work correctly, I need to know the exact sample rate that is in effect.
Unfortunately, this is at present not so straightforward in LibAO. Some drivers may not gi...I am writing a program based on LibAO that synthesizes sound. For this to work correctly, I need to know the exact sample rate that is in effect.
Unfortunately, this is at present not so straightforward in LibAO. Some drivers may not give you the exact rate you request, but something close. (Problem: You have no way of knowing what the real rate is.) Some drivers, like "alsa", will actually give you any arbitrary sample rate you choose (let's do 512 kHz!) but actually resample in software to whatever the hardware wants. (Problem: This eats up CPU, and messes up my synthesis.)
The attached patch (against git master) addresses these issues:
1. As far as I can tell, only the "alsa", "macosx" and "oss" drivers can give you a sample rate different than what you requested. In these, I added code to update the ao_sample_format struct that was passed in to reflect the actual rate. This way, the calling program can subsequently examine the struct to see what it got.
(The same thing could potentially be done with other parameters in there, like the channels. I think this would be a good pattern to follow generally, as the struct is otherwise useless after the ao_open_*() call.)
2. Pass in SND_PCM_NO_AUTO_RESAMPLE to the snd_pcm_open() call in ao_alsa.c, to disable the "dmix" resampling layer. If you request a rate of 512000, you should see a "sample rate not supported" warning and get an actual rate like 48000; you should not get a software simulation of a 512 kHz ultra-hi-def sound card.
(FYI: the snd_pcm_hw_params_set_rate_resample() function may be another way of going about this. I used the aforementioned open-mode flag only because I saw its use in a patch to VLC's ALSA driver.)Monty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2280libao 1.2.0 uses deprecated OS X audio APIs2020-06-14T10:09:37ZMax Hornlibao 1.2.0 uses deprecated OS X audio APIsRunning ogg123, linked against libao 1.2, produced this warning on Mac OS X 10.11 (El Capitan):
```
WARNING: 140: This application, or a library it uses, is using the
deprecated Carbon Component Manager for hosting Audio Units. Support...Running ogg123, linked against libao 1.2, produced this warning on Mac OS X 10.11 (El Capitan):
```
WARNING: 140: This application, or a library it uses, is using the
deprecated Carbon Component Manager for hosting Audio Units. Support for
this will be removed in a future release. Also, this makes the host
incompatible with version 3 audio units. Please transition to the API's
in AudioComponent.h.
```
Looking at libao's git, it seems this was already fixedin January 2016: https://git.xiph.org/?p=libao.git;a=commit;h=0dc9485462179744d7f1acf319c417a2b3c2a54c
So I a guess I am requesting that a new release is made -- the last one is from 2014.Monty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2217libao fails to signal output device change2017-11-03T10:00:01Zjrleemanlibao fails to signal output device changelibao does not signal a change of audio output device in such a way that applications may respond. Related to/discovered in pianobar issue: https://github.com/PromyLOPh/pianobar/issues/536#issuecomment-135080348 libao does not signal a change of audio output device in such a way that applications may respond. Related to/discovered in pianobar issue: https://github.com/PromyLOPh/pianobar/issues/536#issuecomment-135080348 Monty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2210Warning: Carbon Component Manager is being depricated2020-06-14T10:09:15ZSethWarning: Carbon Component Manager is being depricatedApplications running in OS X 10.11 (El Capitan) have errors stating that Carbon Component Manager is deprecated:
This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support...Applications running in OS X 10.11 (El Capitan) have errors stating that Carbon Component Manager is deprecated:
This application, or a library it uses, is using the deprecated Carbon Component Manager for hosting Audio Units. Support for this will be removed in a future release. Also, this makes the host incompatible with version 3 audio units. Please transition to the API's in AudioComponent.h.Monty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2204libao-1.2.0 faulty configure check for wmm driver2017-11-03T10:00:02ZBen G.libao-1.2.0 faulty configure check for wmm driverHello
The AC_LANG_SOURCE() function in configure.ac for the wmm detection code is misplaced and disable the test altogether.
I've joined a small patch that fix the problem.
```
--- libao-1.2.0-bug/configure.ac 2014-01-27 18:02:05.000...Hello
The AC_LANG_SOURCE() function in configure.ac for the wmm detection code is misplaced and disable the test altogether.
I've joined a small patch that fix the problem.
```
--- libao-1.2.0-bug/configure.ac 2014-01-27 18:02:05.000000000 +0100
+++ libao-1.2.0-fix/configure.ac 2015-06-15 02:49:42.994291600 +0200
@@ -224,13 +224,13 @@ AC_ARG_ENABLE([wmm],
[include WMM output plugin @<:@default=check@:>@])],
[],[enable_wmm="check"]
)
-AS_IF([AC_LANG_SOURCE([test "x$enable_wmm" != "xno"],
+AS_IF([test "x$enable_wmm" != "xno"],
[AC_CHECK_HEADERS([mmsystem.h],
[
AC_MSG_CHECKING([waveOut family functions])
waveout_old_LIBS="$LIBS"; LIBS="$LIBS -lwinmm"
dnl Can't use AC_SEARCH_LIBS because symbols are decorated
- AC_LINK_IFELSE([
+ AC_LINK_IFELSE([AC_LANG_SOURCE([
#include <windows.h>
#include <mmsystem.h>
int main(int na, char ** a) {
```
--
G.BMonty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2196ao_open_file: Race condition in checking for file2017-11-03T10:00:01ZRaúl Salinas-Monteagudoao_open_file: Race condition in checking for fileWhen "not overwrite" is specified, [ao_open_file()](https://trac.xiph.org/browser/trunk/ao/src/audio_out.c#L1352) will try to first open it for reading and this does not fail, open it for writing.
```
if (!overwrite) {
/* Test for fil...When "not overwrite" is specified, [ao_open_file()](https://trac.xiph.org/browser/trunk/ao/src/audio_out.c#L1352) will try to first open it for reading and this does not fail, open it for writing.
```
if (!overwrite) {
/* Test for file existence */
file = fopen(filename, "r");
if (file != NULL) {
fclose(file);
errno = AO_EFILEEXISTS;
return NULL;
}
}
file = fopen(filename, "w");
```
There is a [TOCTTOU](http://en.wikipedia.org/wiki/Time_of_check_to_time_of_use) condition, the file could have been created by someone else after the check.
A non-racy way to create it would be to use
```
file=fopen(filename, "wx");
```
and checking for the errno E_EXIST.
If this is not portable enough, open( ... , O_CREAT|O_EXCL) could be used.Monty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2129libao.conf man page doesn't list default_driver=pulse option2017-11-03T10:00:02Zcomputersforpeacelibao.conf man page doesn't list default_driver=pulse optionThis option is especially important for users of Pulse, as they often are unaware they need to switch from 'alsa' to 'pulse' to allow concurrent use of the sound device. See:
https://bugs.launchpad.net/ubuntu/+source/libao/+bug/1075479
...This option is especially important for users of Pulse, as they often are unaware they need to switch from 'alsa' to 'pulse' to allow concurrent use of the sound device. See:
https://bugs.launchpad.net/ubuntu/+source/libao/+bug/1075479
https://wiki.archlinux.org/index.php/PulseAudio#libao
https://github.com/PromyLOPh/pianobar/issues/494
Will attach patch shortlyPhilipp SchafftPhilipp Schaffthttps://gitlab.xiph.org/xiph/libao/-/issues/2083[patch] support for jack in libao2017-11-03T10:00:01Zlparcq[patch] support for jack in libaoThe patch for the configure.ac and src/plugins/Makefile.am is 0001-jack-plugin.patch
The code for the plugin itself is libao-jack-plugin.tgz
By default it connects to all available physical ports. It can be configured
with the paramet...The patch for the configure.ac and src/plugins/Makefile.am is 0001-jack-plugin.patch
The code for the plugin itself is libao-jack-plugin.tgz
By default it connects to all available physical ports. It can be configured
with the parameter "ports"
ports=system:playback_1,system:playback_2
The plugin uses libsamplerate to resample the audio to the jack server rate.
There are different algorithms in libsamplerate. There are selected according to
the value of parameter "quality" (value from 0 to 9). The default is 5. It
impacts the CPU consumption.
Monty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2051non-blocking ao_play() and associated ao_wait()2017-11-03T10:00:01ZPeter Billamnon-blocking ao_play() and associated ao_wait()Greetings. I've been exploring libao, but for what I want to do I need a non-blocking ao_play(), so I can then do processing in real-time, then an ao_wait to get to the end of the previous buffer, then play my new buffer and loop.
It lo...Greetings. I've been exploring libao, but for what I want to do I need a non-blocking ao_play(), so I can then do processing in real-time, then an ao_wait to get to the end of the previous buffer, then play my new buffer and loop.
It looks like this has not been implemented, perhaps because it's not portable enough :-(
Suggestions gratefully received...
Regards, PeterMonty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2035libao 1.2.0 differing behaviour for 8bit audio2017-11-03T10:00:01Zjohn_spencerlibao 1.2.0 differing behaviour for 8bit audiolibao 1.1.0 behaves as expected: the amplitude is unsigned (0..255)
libao 1.2.0 behaves differently: the amplitude is signed (-128..127)
noticed when trying to mute a stream by using 0 for the samples
for 1.2.0 you have to pass 127 to m...libao 1.1.0 behaves as expected: the amplitude is unsigned (0..255)
libao 1.2.0 behaves differently: the amplitude is signed (-128..127)
noticed when trying to mute a stream by using 0 for the samples
for 1.2.0 you have to pass 127 to mute.
```
#include <unistd.h>
#include <ao/ao.h>
#include <stdlib.h>
#include <string.h>
struct AoWriter {
ao_device *device;
ao_sample_format format;
int aodriver;
};
int AoWriter_init(struct AoWriter *self) {
ao_initialize();
memset(self, 0, sizeof(*self));
self->format.bits = 8;
self->format.channels = 1;
self->format.rate = 11025;
self->format.byte_format = AO_FMT_LITTLE;
self->aodriver = ao_default_driver_id();
self->device = ao_open_live(self->aodriver, &self->format, NULL);
return self->device != NULL;
}
int AoWriter_write(struct AoWriter *self, void* buffer, size_t bufsize) {
return ao_play(self->device, buffer, bufsize);
}
int AoWriter_close(struct AoWriter *self) {
return ao_close(self->device);
}
static unsigned char blip[] = {0x52, 0x51, 0x51, 0x51, 0xC4, 0x4C, 0xF4, 0xF4, 0xF3,0xEF};
static int blip_frame(int idx) {
idx = idx % (2*sizeof(blip));
if(idx>=sizeof(blip)) idx=(2*sizeof(blip))-idx;
return blip[idx];
}
static void generate_blip(unsigned char* data, size_t bufsize, double volume) {
int i;
for(i=0;i<bufsize;i++)
/* libao 1.1.0 behaves as expected: the amplitude is unsigned (0..255)
libao 1.2.0 behaves differently: the amplitude is signed (-128..127) */
#if 1
data[i] = (blip_frame(i)-128)*volume+127;
#else
data[i] = blip_frame(i)*volume;
#endif
}
#define DEFAULT_VOLUME 0.02
int main() {
struct AoWriter ao;
AoWriter_init(&ao);
unsigned char buf[100];
generate_blip(buf, sizeof(buf), DEFAULT_VOLUME);
unsigned passed = 0;
while(1) {
usleep(1000);
passed++;
if(passed >= 200) {
passed=0;
AoWriter_write(&ao, buf, sizeof buf);
}
}
AoWriter_close(&ao);
return 0;
}
```
Monty MontgomeryMonty Montgomeryhttps://gitlab.xiph.org/xiph/libao/-/issues/2034release 1.2.0 was not announced and is not linked on the downloads page2017-11-03T10:00:01Zjohn_spencerrelease 1.2.0 was not announced and is not linked on the downloads pagedespite it being available on the ftp since several weeksdespite it being available on the ftp since several weeksMonty MontgomeryMonty Montgomery