All of lore.kernel.org
 help / color / mirror / Atom feed
* Serious bug calling ALSA lib functions from .so vs. .o file
@ 2019-06-18  6:24 scott andrew franco
  2019-06-18 15:16 ` scott andrew franco
  0 siblings, 1 reply; 9+ messages in thread
From: scott andrew franco @ 2019-06-18  6:24 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 2161 bytes --]

Hi, I am having a strange issue calling snd_pcm_* alsa-lib functions from a .so file.
 
The example is a pretty run of the mill .wav file output example in C from the internet, which I have placed in playwav.c.
I put the routine that does the pcm play, alsaplaywave(), into a routine and have a duplicate in another external file, test2.c.
I named the one in playwav.c alsaplaywav1(), and the one in test2.c alsaplaywav().
 
The compile is done as follows:
 
gcc -g3 -Iinclude -fPIC -c test2.c -o test2.o
gcc -shared test2.o -o test2.so
#
# Compiling from .so causes bug, compiling from .o does not
#
gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
#gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
 If the test2.so file is used, the playback has its parameters such as rate messed up, and the result is it plays
 as fast as possible (series of chirps). If the above line is just changed to test2.o, the playback is fine.
 Further, if the copy of alsaplaywav() local to the playwav.c file is executed, the playback is correct. It is only
 when playing from the routine in the .so file that it messes up.
 To find out what the key point of failure is, I put all of the preamble for the routine up until it does a
  
 snd_pcm_hw_params_set_rate_near() at the calling point (in playwav.c) and commented that out in the routine.
 The idea was to see exactly which alsa call being done inside the .so caused the malfunction.
 The rate set appears to be the key. Do that outside the .so, it works, do it inside, it does not.
 I note that snd_pcm_hw_params_set_rate_near() goes through a few macros in alsa-lib.
 I think I could debug this better if I can get alsa symbols into gdb. As in the other message, I cannot figure out
 where the libasound.so gets constructed in the build. I see libasound.a, but no libasound.so.
 Apologies for not cutting the example down further, but the failure mode is quite complex and that is
 difficult.
 Find playwav.c and test2.c attached, and the compile instructions I used above or in cplaywav. The
 files are fairly small.
 Thanks for any help.
  
 Scott Franco

[-- Attachment #2: test2.c --]
[-- Type: text/x-c, Size: 3649 bytes --]

#include <pthread.h>
#include <alsa/asoundlib.h>
#include <sys/time.h>
#include <sys/timerfd.h>

/*******************************************************************************

Play ALSA sound file

Plays the given ALSA sound file given the filename.

*******************************************************************************/

void alsaplaywave(char* fn, FILE* fh, snd_pcm_t *pcm_handle,
                  snd_pcm_hw_params_t *params, unsigned int channels, unsigned int rate)

{

    unsigned int pcm, tmp;
//    unsigned int rate/*, channels*/;
//   snd_pcm_t *pcm_handle;
//    snd_pcm_hw_params_t *params;
    snd_pcm_uframes_t frames;
    char *buff;
    int buff_size;
    int r;
    int end;
//    FILE* fh;

    channels = 2;
    rate = 10000;

fprintf(stderr, "\n\nalsaplaywave: begin\n");
//fprintf(stderr, "alsaplaywave: bottom version: begin: file: %s\n", fn);
    /* open input .wav file */
//    fh = fopen(fn, "r");
//    if (!fh) printf("Cannot open input .wav file");

    /* open pcm device */
//    r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
//fprintf(stderr, "alsawave: 0: r: %d\n", r);
//    if (r < 0) printf("Cannot open PCM output device");

//    snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
//    snd_pcm_hw_params_any(pcm_handle, params);

    /* Set parameters */
//    r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
//fprintf(stderr, "alsawave: 1: r: %d\n", r);
//    if (r < 0) printf("Cannot set interleaved mode");

//    r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
//    if (r < 0) printf("Cannot set format");

//    r = snd_pcm_hw_params_set_channels(pcm_handle, params, channels);
//    if (r < 0) printf("Cannot set channels number");


fprintf(stderr, "alsaplaywave: before set rate: rate: %d\n", rate);
    r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
    if (r < 0) printf("Cannot set rate");
fprintf(stderr, "alsaplaywave: after set rate: rate: %d\n", rate);



    /* Write parameters */
    r = snd_pcm_hw_params(pcm_handle, params);
    if (r < 0) printf("cannot set hardware parameters\n");

    /* get number of channels */
    snd_pcm_hw_params_get_channels(params, &channels);

    /* get sample rate */
    snd_pcm_hw_params_get_rate(params, &rate, 0);
fprintf(stderr, "alsaplaywave: rate: %d\n", rate);
rate = 10000;

    /* Allocate buffer to hold single period */
    snd_pcm_hw_params_get_period_size(params, &frames, 0);
fprintf(stderr, "frames: %ld\n", frames);
frames = 1024;

    buff_size = frames * channels * 2 /* 2 -> sample size */;
fprintf(stderr, "channels: %d frames: %ld buff_size: %d\n", channels, frames, buff_size);
    buff = (char *) malloc(buff_size);

    snd_pcm_hw_params_get_period_time(params, &tmp, NULL);

fprintf(stderr, "alsaplaywave: 4\n");
    end = 0;
    while (!end) {

        /* read input .wav file */
//fprintf(stderr, "alsaplaywave: buff_size: %d\n", buff_size);
        r = fread(buff, buff_size, 1, fh);
//fprintf(stderr, "alsaplaywave: r: %d\n", r);
        end = r == 0;
        if (!end) {

            /* write samples to PCM device */
            r = snd_pcm_writei(pcm_handle, buff, frames);
            if (r == -EPIPE) snd_pcm_prepare(pcm_handle);
            else if (r < 0) { printf("Cannot write to PCM device\n"); exit(1); }

        }
//fprintf(stderr, "alsaplaywave: 6\n");

    }

    snd_pcm_drain(pcm_handle);
    snd_pcm_close(pcm_handle);
    free(buff);
    fclose(fh);

}

[-- Attachment #3: cplaywav --]
[-- Type: text/plain, Size: 271 bytes --]

gcc -g3 -Iinclude -fPIC -c test2.c -o test2.o
gcc -shared test2.o -o test2.so
#
# Compiling from .so causes bug, compiling from .o does not
#
gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
#gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav

[-- Attachment #4: playwav.c --]
[-- Type: text/x-c, Size: 6636 bytes --]

/*
 * Simple sound playback using ALSA API and libasound.
 *
 * Compile:
 * $ cc -o play sound_playback.c -lasound
 *
 * Usage:
 * $ ./play <sample_rate> <channels> <seconds> < <file>
 *
 * Examples:
 * $ ./play 44100 2 5 < /dev/urandom
 * $ ./play 22050 1 8 < /path/to/file.wav
 *
 * Copyright (C) 2009 Alessandro Ghedini <alessandro@ghedini.me>
 * --------------------------------------------------------------
 * "THE BEER-WARE LICENSE" (Revision 42):
 * Alessandro Ghedini wrote this file. As long as you retain this
 * notice you can do whatever you want with this stuff. If we
 * meet some day, and you think this stuff is worth it, you can
 * buy me a beer in return.
 * --------------------------------------------------------------
 */

#include <alsa/asoundlib.h>
#include <stdio.h>

static void alsaplaywave1(char* fn, FILE* fh, snd_pcm_t *pcm_handle,
                          snd_pcm_hw_params_t *params, unsigned int channels, unsigned int rate)

{

    unsigned int pcm, tmp;
//    unsigned int rate/*, channels*/;
//    snd_pcm_t *pcm_handle;
//    snd_pcm_hw_params_t *params;
    snd_pcm_uframes_t frames;
    char *buff;
    int buff_size;
    int r;
    int end;
//    FILE* fh;

    channels = 2;
    rate = 10000;

fprintf(stderr, "\n\nalsaplaywave1: begin\n");
//fprintf(stderr, "alsaplaywave: top version: begin: file: %s\n", fn);
    /* open input .wav file */
//    fh = fopen(fn, "r");
//    if (!fh) printf("Cannot open input .wav file");

    /* open pcm device */
//    r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
//fprintf(stderr, "alsawave: 0: r: %d\n", r);
//    if (r < 0) printf("Cannot open PCM output device");

//    snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
//    snd_pcm_hw_params_any(pcm_handle, params);
    /* Set parameters */
//    r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
//fprintf(stderr, "alsawave: 1: r: %d\n", r);
//    if (r < 0) printf("Cannot set interleaved mode");

//    r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
//    if (r < 0) printf("Cannot set format");

//    r = snd_pcm_hw_params_set_channels(pcm_handle, params, channels);
//    if (r < 0) printf("Cannot set channels number");



fprintf(stderr, "alsaplaywave: before set rate: rate: %d\n", rate);
    r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
    if (r < 0) printf("Cannot set rate");
fprintf(stderr, "alsaplaywave: after set rate: rate: %d\n", rate);



    /* Write parameters */
    r = snd_pcm_hw_params(pcm_handle, params);
    if (r < 0) printf("cannot set hardware parameters");

    /* get number of channels */
    snd_pcm_hw_params_get_channels(params, &channels);

    /* get sample rate */
    snd_pcm_hw_params_get_rate(params, &rate, 0);
fprintf(stderr, "alsaplaywave: rate: %d\n", rate);
rate = 10000;

    /* Allocate buffer to hold single period */
    snd_pcm_hw_params_get_period_size(params, &frames, 0);
fprintf(stderr, "frames: %ld\n", frames);
frames = 1024;

    buff_size = frames * channels * 2 /* 2 -> sample size */;
fprintf(stderr, "channels: %d frames: %ld buff_size: %d\n", channels, frames, buff_size);
    buff = (char *) malloc(buff_size);

    snd_pcm_hw_params_get_period_time(params, &tmp, NULL);

fprintf(stderr, "alsaplaywave: 4\n");
    end = 0;
    while (!end) {

        /* read input .wav file */
//fprintf(stderr, "alsaplaywave: before fread: buff_size: %d\n", buff_size);
        r = fread(buff, buff_size, 1, fh);
//fprintf(stderr, "alsaplaywave: after fread: r: %d\n", r);
        end = r == 0;
        if (!end) {

            /* write samples to PCM device */
            r = snd_pcm_writei(pcm_handle, buff, frames);
            if (r == -EPIPE) snd_pcm_prepare(pcm_handle);
            else if (r < 0) { printf("Cannot write to PCM device"); exit(1); }

        }
//fprintf(stderr, "alsaplaywave: 6\n");

    }
fprintf(stderr, "alsaplaywave: 5\n");

    snd_pcm_drain(pcm_handle);
    snd_pcm_close(pcm_handle);
    free(buff);
    fclose(fh);

}

extern void alsaplaywave(char* fn, FILE* fh, snd_pcm_t *pcm_handle,
                         snd_pcm_hw_params_t *params, unsigned int channels, unsigned int rate);

int main(int argc, char **argv)

{

    FILE* fh;
    snd_pcm_t *pcm_handle;
    snd_pcm_hw_params_t *params;
    unsigned int channels = 2;
    unsigned int rate = 10000;
    int r;

    fh = fopen("test.wav", "r");
    if (!fh) printf("Cannot open input .wav file");
    r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
    if (r < 0) printf("Cannot open PCM output device");
    snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
    snd_pcm_hw_params_any(pcm_handle, params);
    r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
    fprintf(stderr, "alsawave: 1: r: %d\n", r);
    if (r < 0) printf("Cannot set interleaved mode");
    r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
    if (r < 0) printf("Cannot set format");
    r = snd_pcm_hw_params_set_channels(pcm_handle, params, channels);
    if (r < 0) printf("Cannot set channels number");
//    fprintf(stderr, "alsaplaywave: before set rate: rate: %d\n", rate);
//    r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
//    if (r < 0) printf("Cannot set rate");
//    fprintf(stderr, "alsaplaywave: after set rate: rate: %d\n", rate);
    alsaplaywave("test.wav", fh, pcm_handle, params, channels, rate);

    fh = fopen("test.wav", "r");
    if (!fh) printf("Cannot open input .wav file");
    r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
    if (r < 0) printf("Cannot open PCM output device");
    snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
    snd_pcm_hw_params_any(pcm_handle, params);
    r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
    fprintf(stderr, "alsawave: 1: r: %d\n", r);
    if (r < 0) printf("Cannot set interleaved mode");
    r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
    if (r < 0) printf("Cannot set format");
    r = snd_pcm_hw_params_set_channels(pcm_handle, params, channels);
    if (r < 0) printf("Cannot set channels number");
    fprintf(stderr, "alsaplaywave: before set rate: rate: %d\n", rate);
    r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
    if (r < 0) printf("Cannot set rate");
    fprintf(stderr, "alsaplaywave: after set rate: rate: %d\n", rate);
    alsaplaywave1("test.wav", fh, pcm_handle, params, channels, rate);

    return 0;
}

[-- Attachment #5: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Serious bug calling ALSA lib functions from .so vs. .o file
  2019-06-18  6:24 Serious bug calling ALSA lib functions from .so vs. .o file scott andrew franco
@ 2019-06-18 15:16 ` scott andrew franco
  2019-06-18 15:54   ` scott andrew franco
  2019-06-18 18:18   ` Jaroslav Kysela
  0 siblings, 2 replies; 9+ messages in thread
From: scott andrew franco @ 2019-06-18 15:16 UTC (permalink / raw)
  To: alsa-devel

Hello,
 
The issue:
 
calling across .so (dynamic linking) produces different behavior in ALSA library calls than normal,
and causes ALSA to malfunction.
 
I have minimized my issue to as small a code section as possible. Note the code is from commonly available
internet examples, including Free Electrons "Audio in embedded linux systems".
 
The run is:
 
samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
alsaplaywave: rate: 1
alsaplaywave: rate: 0
samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
alsaplaywave: rate: 1
alsaplaywave: rate: 1
  
 Note the only difference between the two runs of "playwave" is if the second module, test2, is linked as a .so or
 linked as a .o.
  
 The code is:
 =======================================================================================
 playwav.c
 #include <alsa/asoundlib.h>
#include <stdio.h>
 void alsaplaywave1(void)
 {
 snd_pcm_t *pcm_handle;
 snd_pcm_hw_params_t *params;
 unsigned int val;
 unsigned int rate;
 int r;
 /* open pcm device */
 r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 if (r < 0) printf("Cannot open PCM output device");
 snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 snd_pcm_hw_params_any(pcm_handle, params);
 r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 if (r < 0) printf("Cannot set interleaved mode");
 r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 if (r < 0) printf("Cannot set format");
 r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 if (r < 0) printf("Cannot set channels number");
 val = 44100;
 r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 if (r < 0) printf("Cannot set rate");
 snd_pcm_hw_params_get_rate(params, &rate, 0);
 printf("alsaplaywave: rate: %d\n", rate);
 snd_pcm_close(pcm_handle);
 }
 extern void alsaplaywave2(void);
 int main(int argc, char **argv)
 {
 alsaplaywave1();
 alsaplaywave2();
 return 0;
}
  
 ==================================================================================
 test2.c
 #include <alsa/asoundlib.h>
#include <stdio.h>
 void alsaplaywave2(void)
 {
 snd_pcm_t *pcm_handle;
 snd_pcm_hw_params_t *params;
 unsigned int val;
 unsigned int rate;
 int r;
 /* open pcm device */
 r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 if (r < 0) printf("Cannot open PCM output device");
 snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 snd_pcm_hw_params_any(pcm_handle, params);
 r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 if (r < 0) printf("Cannot set interleaved mode");
 r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 if (r < 0) printf("Cannot set format");
 r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 if (r < 0) printf("Cannot set channels number");
 val = 44100;
 r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 if (r < 0) printf("Cannot set rate");
 snd_pcm_hw_params_get_rate(params, &rate, 0);
 printf("alsaplaywave: rate: %d\n", rate);
 snd_pcm_close(pcm_handle);
 }

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Serious bug calling ALSA lib functions from .so vs. .o file
  2019-06-18 15:16 ` scott andrew franco
@ 2019-06-18 15:54   ` scott andrew franco
  2019-06-18 18:18   ` Jaroslav Kysela
  1 sibling, 0 replies; 9+ messages in thread
From: scott andrew franco @ 2019-06-18 15:54 UTC (permalink / raw)
  To: alsa-devel

 uname -a
Linux samiam-home-pc 4.15.0-51-generic #55-Ubuntu SMP Wed May 15 14:27:21 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
  
 
samiam@samiam-home-pc:/usr/lib/x86_64-linux-gnu$ ls -l libasound*
lrwxrwxrwx 1 root root 18 Dec 18 20:25 libasound.so -> libasound.so.2.0.0
lrwxrwxrwx 1 root root 18 Dec 18 20:25 libasound.so.2 -> libasound.so.2.0.0
-rw-r--r-- 1 root root 1075496 Dec 18 20:25 libasound.so.2.0.0
samiam@samiam-home-pc:/usr/lib/x86_64-linux-gnu$
  
 
--------- Original Message --------- Subject: RE: Serious bug calling ALSA lib functions from .so vs. .o file
From: "scott andrew franco" <samiam@moorecad.com>
Date: 6/18/19 8:16 am
To: alsa-devel@alsa-project.org

 Hello,
 
The issue:
 
calling across .so (dynamic linking) produces different behavior in ALSA library calls than normal,
and causes ALSA to malfunction.
 
I have minimized my issue to as small a code section as possible. Note the code is from commonly available
internet examples, including Free Electrons "Audio in embedded linux systems".
 
The run is:
 
samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
alsaplaywave: rate: 1
alsaplaywave: rate: 0
samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
alsaplaywave: rate: 1
alsaplaywave: rate: 1
  
 Note the only difference between the two runs of "playwave" is if the second module, test2, is linked as a .so or
 linked as a .o.
  
 The code is:
 =======================================================================================
 playwav.c
 #include <alsa/asoundlib.h>
#include <stdio.h>
 void alsaplaywave1(void)
 {
 snd_pcm_t *pcm_handle;
 snd_pcm_hw_params_t *params;
 unsigned int val;
 unsigned int rate;
 int r;
 /* open pcm device */
 r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 if (r < 0) printf("Cannot open PCM output device");
 snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 snd_pcm_hw_params_any(pcm_handle, params);
 r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 if (r < 0) printf("Cannot set interleaved mode");
 r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 if (r < 0) printf("Cannot set format");
 r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 if (r < 0) printf("Cannot set channels number");
 val = 44100;
 r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 if (r < 0) printf("Cannot set rate");
 snd_pcm_hw_params_get_rate(params, &rate, 0);
 printf("alsaplaywave: rate: %d\n", rate);
 snd_pcm_close(pcm_handle);
 }
 extern void alsaplaywave2(void);
 int main(int argc, char **argv)
 {
 alsaplaywave1();
 alsaplaywave2();
 return 0;
}
  
 ==================================================================================
 test2.c
 #include <alsa/asoundlib.h>
#include <stdio.h>
 void alsaplaywave2(void)
 {
 snd_pcm_t *pcm_handle;
 snd_pcm_hw_params_t *params;
 unsigned int val;
 unsigned int rate;
 int r;
 /* open pcm device */
 r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 if (r < 0) printf("Cannot open PCM output device");
 snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 snd_pcm_hw_params_any(pcm_handle, params);
 r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 if (r < 0) printf("Cannot set interleaved mode");
 r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 if (r < 0) printf("Cannot set format");
 r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 if (r < 0) printf("Cannot set channels number");
 val = 44100;
 r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 if (r < 0) printf("Cannot set rate");
 snd_pcm_hw_params_get_rate(params, &rate, 0);
 printf("alsaplaywave: rate: %d\n", rate);
 snd_pcm_close(pcm_handle);
 }

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Serious bug calling ALSA lib functions from .so vs. .o file
  2019-06-18 15:16 ` scott andrew franco
  2019-06-18 15:54   ` scott andrew franco
@ 2019-06-18 18:18   ` Jaroslav Kysela
  2019-06-18 18:33     ` scott andrew franco
  1 sibling, 1 reply; 9+ messages in thread
From: Jaroslav Kysela @ 2019-06-18 18:18 UTC (permalink / raw)
  To: scott andrew franco; +Cc: alsa-devel

Dne 18. 06. 19 v 17:16 scott andrew franco napsal(a):
> Hello,
>  
> The issue:
>  
> calling across .so (dynamic linking) produces different behavior in ALSA library calls than normal,
> and causes ALSA to malfunction.
>  
> I have minimized my issue to as small a code section as possible. Note the code is from commonly available
> internet examples, including Free Electrons "Audio in embedded linux systems".

It seems like a linker issue. I think that you must link .so to -lasound, too.
(add -lasound to the command producing your .so library to satisfy the
versioned symbols)

						Jaroslav

>  
> The run is:
>  
> samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
> samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
> samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
> alsaplaywave: rate: 1
> alsaplaywave: rate: 0
> samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
> samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
> alsaplaywave: rate: 1
> alsaplaywave: rate: 1
>   
>  Note the only difference between the two runs of "playwave" is if the second module, test2, is linked as a .so or
>  linked as a .o.
>   
>  The code is:
>  =======================================================================================
>  playwav.c
>  #include <alsa/asoundlib.h>
> #include <stdio.h>
>  void alsaplaywave1(void)
>  {
>  snd_pcm_t *pcm_handle;
>  snd_pcm_hw_params_t *params;
>  unsigned int val;
>  unsigned int rate;
>  int r;
>  /* open pcm device */
>  r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
>  if (r < 0) printf("Cannot open PCM output device");
>  snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
>  snd_pcm_hw_params_any(pcm_handle, params);
>  r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
>  if (r < 0) printf("Cannot set interleaved mode");
>  r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
>  if (r < 0) printf("Cannot set format");
>  r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
>  if (r < 0) printf("Cannot set channels number");
>  val = 44100;
>  r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
>  if (r < 0) printf("Cannot set rate");
>  snd_pcm_hw_params_get_rate(params, &rate, 0);
>  printf("alsaplaywave: rate: %d\n", rate);
>  snd_pcm_close(pcm_handle);
>  }
>  extern void alsaplaywave2(void);
>  int main(int argc, char **argv)
>  {
>  alsaplaywave1();
>  alsaplaywave2();
>  return 0;
> }
>   
>  ==================================================================================
>  test2.c
>  #include <alsa/asoundlib.h>
> #include <stdio.h>
>  void alsaplaywave2(void)
>  {
>  snd_pcm_t *pcm_handle;
>  snd_pcm_hw_params_t *params;
>  unsigned int val;
>  unsigned int rate;
>  int r;
>  /* open pcm device */
>  r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
>  if (r < 0) printf("Cannot open PCM output device");
>  snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
>  snd_pcm_hw_params_any(pcm_handle, params);
>  r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
>  if (r < 0) printf("Cannot set interleaved mode");
>  r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
>  if (r < 0) printf("Cannot set format");
>  r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
>  if (r < 0) printf("Cannot set channels number");
>  val = 44100;
>  r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
>  if (r < 0) printf("Cannot set rate");
>  snd_pcm_hw_params_get_rate(params, &rate, 0);
>  printf("alsaplaywave: rate: %d\n", rate);
>  snd_pcm_close(pcm_handle);
>  }
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 


-- 
Jaroslav Kysela <perex@perex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Serious bug calling ALSA lib functions from .so vs. .o file
  2019-06-18 18:18   ` Jaroslav Kysela
@ 2019-06-18 18:33     ` scott andrew franco
  2019-06-18 18:59       ` scott andrew franco
  0 siblings, 1 reply; 9+ messages in thread
From: scott andrew franco @ 2019-06-18 18:33 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel

Hi, and thanks for the reply.
 
>I think that you must link .so to -lasound, too.
 
This was done and shows in the command line example below, IE,
 
 samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
> samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
> samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
> alsaplaywave: rate: 1
> alsaplaywave: rate: 0
> samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
> samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
> alsaplaywave: rate: 1
> alsaplaywave: rate: 1
 
Note that in both the "succeeds" case and the "fails" case carry the -lasound option. It would not compile
if not.
 
Scott Franco
 
--------- Original Message --------- Subject: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
From: "Jaroslav Kysela" <perex@perex.cz>
Date: 6/18/19 11:18 am
To: "scott andrew franco" <samiam@moorecad.com>
Cc: alsa-devel@alsa-project.org

Dne 18. 06. 19 v 17:16 scott andrew franco napsal(a):
 > Hello,
 > 
 > The issue:
 > 
 > calling across .so (dynamic linking) produces different behavior in ALSA library calls than normal,
 > and causes ALSA to malfunction.
 > 
 > I have minimized my issue to as small a code section as possible. Note the code is from commonly available
 > internet examples, including Free Electrons "Audio in embedded linux systems".
 
 It seems like a linker issue. I think that you must link .so to -lasound, too.
 (add -lasound to the command producing your .so library to satisfy the
 versioned symbols)
 
 Jaroslav
 
 > 
 > The run is:
 > 
 > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
 > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
 > samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
 > alsaplaywave: rate: 1
 > alsaplaywave: rate: 0
 > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
 > samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
 > alsaplaywave: rate: 1
 > alsaplaywave: rate: 1
 > 
 > Note the only difference between the two runs of "playwave" is if the second module, test2, is linked as a .so or
 > linked as a .o.
 > 
 > The code is:
 > =======================================================================================
 > playwav.c
 > #include <alsa/asoundlib.h>
 > #include <stdio.h>
 > void alsaplaywave1(void)
 > {
 > snd_pcm_t *pcm_handle;
 > snd_pcm_hw_params_t *params;
 > unsigned int val;
 > unsigned int rate;
 > int r;
 > /* open pcm device */
 > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 > if (r < 0) printf("Cannot open PCM output device");
 > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 > snd_pcm_hw_params_any(pcm_handle, params);
 > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 > if (r < 0) printf("Cannot set interleaved mode");
 > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 > if (r < 0) printf("Cannot set format");
 > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 > if (r < 0) printf("Cannot set channels number");
 > val = 44100;
 > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 > if (r < 0) printf("Cannot set rate");
 > snd_pcm_hw_params_get_rate(params, &rate, 0);
 > printf("alsaplaywave: rate: %d\n", rate);
 > snd_pcm_close(pcm_handle);
 > }
 > extern void alsaplaywave2(void);
 > int main(int argc, char **argv)
 > {
 > alsaplaywave1();
 > alsaplaywave2();
 > return 0;
 > }
 > 
 > ==================================================================================
 > test2.c
 > #include <alsa/asoundlib.h>
 > #include <stdio.h>
 > void alsaplaywave2(void)
 > {
 > snd_pcm_t *pcm_handle;
 > snd_pcm_hw_params_t *params;
 > unsigned int val;
 > unsigned int rate;
 > int r;
 > /* open pcm device */
 > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 > if (r < 0) printf("Cannot open PCM output device");
 > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 > snd_pcm_hw_params_any(pcm_handle, params);
 > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 > if (r < 0) printf("Cannot set interleaved mode");
 > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 > if (r < 0) printf("Cannot set format");
 > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 > if (r < 0) printf("Cannot set channels number");
 > val = 44100;
 > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 > if (r < 0) printf("Cannot set rate");
 > snd_pcm_hw_params_get_rate(params, &rate, 0);
 > printf("alsaplaywave: rate: %d\n", rate);
 > snd_pcm_close(pcm_handle);
 > }
 > _______________________________________________
 > Alsa-devel mailing list
 > Alsa-devel@alsa-project.org
 > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
 > 
 
 
 -- 
 Jaroslav Kysela <perex@perex.cz>
 Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
 _______________________________________________
 Alsa-devel mailing list
 Alsa-devel@alsa-project.org
 https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Serious bug calling ALSA lib functions from .so vs. .o file
  2019-06-18 18:33     ` scott andrew franco
@ 2019-06-18 18:59       ` scott andrew franco
  2019-06-18 20:49         ` Takashi Iwai
  0 siblings, 1 reply; 9+ messages in thread
From: scott andrew franco @ 2019-06-18 18:59 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel

PS. I really appreciate the help, I have spent more than a week on this, it is a serious blocking issue.
 
I've gone over the example I posted quite carefully. I recommend you try the example out. You just need the
two source files below (test2.c and playwav.c). and execute the commands shown below.
 
The fact that it fails only in the .so file can explain why this bug hasn't affected more user code, since most
people don't call alsa from another library. However, it does not explain everything since I believe there must
be a few users who do put the calling code in a library.
 
Thanks,
 
Scott Franco
 
--------- Original Message --------- Subject: RE: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
From: "scott andrew franco" <samiam@moorecad.com>
Date: 6/18/19 11:33 am
To: "Jaroslav Kysela" <perex@perex.cz>
Cc: alsa-devel@alsa-project.org

 Hi, and thanks for the reply.
 
>I think that you must link .so to -lasound, too.
 
This was done and shows in the command line example below, IE,
 
 samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
> samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
> samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
> alsaplaywave: rate: 1
> alsaplaywave: rate: 0
> samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
> samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
> alsaplaywave: rate: 1
> alsaplaywave: rate: 1
 
Note that in both the "succeeds" case and the "fails" case carry the -lasound option. It would not compile
if not.
 
Scott Franco
 
--------- Original Message --------- Subject: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
From: "Jaroslav Kysela" <perex@perex.cz>
Date: 6/18/19 11:18 am
To: "scott andrew franco" <samiam@moorecad.com>
Cc: alsa-devel@alsa-project.org

Dne 18. 06. 19 v 17:16 scott andrew franco napsal(a):
 > Hello,
 > 
 > The issue:
 > 
 > calling across .so (dynamic linking) produces different behavior in ALSA library calls than normal,
 > and causes ALSA to malfunction.
 > 
 > I have minimized my issue to as small a code section as possible. Note the code is from commonly available
 > internet examples, including Free Electrons "Audio in embedded linux systems".
 
 It seems like a linker issue. I think that you must link .so to -lasound, too.
 (add -lasound to the command producing your .so library to satisfy the
 versioned symbols)
 
 Jaroslav
 
 > 
 > The run is:
 > 
 > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
 > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
 > samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
 > alsaplaywave: rate: 1
 > alsaplaywave: rate: 0
 > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
 > samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
 > alsaplaywave: rate: 1
 > alsaplaywave: rate: 1
 > 
 > Note the only difference between the two runs of "playwave" is if the second module, test2, is linked as a .so or
 > linked as a .o.
 > 
 > The code is:
 > =======================================================================================
 > playwav.c
 > #include <alsa/asoundlib.h>
 > #include <stdio.h>
 > void alsaplaywave1(void)
 > {
 > snd_pcm_t *pcm_handle;
 > snd_pcm_hw_params_t *params;
 > unsigned int val;
 > unsigned int rate;
 > int r;
 > /* open pcm device */
 > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 > if (r < 0) printf("Cannot open PCM output device");
 > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 > snd_pcm_hw_params_any(pcm_handle, params);
 > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 > if (r < 0) printf("Cannot set interleaved mode");
 > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 > if (r < 0) printf("Cannot set format");
 > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 > if (r < 0) printf("Cannot set channels number");
 > val = 44100;
 > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 > if (r < 0) printf("Cannot set rate");
 > snd_pcm_hw_params_get_rate(params, &rate, 0);
 > printf("alsaplaywave: rate: %d\n", rate);
 > snd_pcm_close(pcm_handle);
 > }
 > extern void alsaplaywave2(void);
 > int main(int argc, char **argv)
 > {
 > alsaplaywave1();
 > alsaplaywave2();
 > return 0;
 > }
 > 
 > ==================================================================================
 > test2.c
 > #include <alsa/asoundlib.h>
 > #include <stdio.h>
 > void alsaplaywave2(void)
 > {
 > snd_pcm_t *pcm_handle;
 > snd_pcm_hw_params_t *params;
 > unsigned int val;
 > unsigned int rate;
 > int r;
 > /* open pcm device */
 > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 > if (r < 0) printf("Cannot open PCM output device");
 > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 > snd_pcm_hw_params_any(pcm_handle, params);
 > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 > if (r < 0) printf("Cannot set interleaved mode");
 > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 > if (r < 0) printf("Cannot set format");
 > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 > if (r < 0) printf("Cannot set channels number");
 > val = 44100;
 > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 > if (r < 0) printf("Cannot set rate");
 > snd_pcm_hw_params_get_rate(params, &rate, 0);
 > printf("alsaplaywave: rate: %d\n", rate);
 > snd_pcm_close(pcm_handle);
 > }
 > _______________________________________________
 > Alsa-devel mailing list
 > Alsa-devel@alsa-project.org
 > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
 > 
 
 
 -- 
 Jaroslav Kysela <perex@perex.cz>
 Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
 _______________________________________________
 Alsa-devel mailing list
 Alsa-devel@alsa-project.org
 https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Serious bug calling ALSA lib functions from .so vs. .o file
  2019-06-18 18:59       ` scott andrew franco
@ 2019-06-18 20:49         ` Takashi Iwai
  2019-06-18 21:10           ` scott andrew franco
  0 siblings, 1 reply; 9+ messages in thread
From: Takashi Iwai @ 2019-06-18 20:49 UTC (permalink / raw)
  To: scott andrew franco; +Cc: alsa-devel

On Tue, 18 Jun 2019 20:59:19 +0200,
scott andrew franco wrote:
> 
> PS. I really appreciate the help, I have spent more than a week on this, it is a serious blocking issue.
>  
> I've gone over the example I posted quite carefully. I recommend you try the example out. You just need the
> two source files below (test2.c and playwav.c). and execute the commands shown below.
>  
> The fact that it fails only in the .so file can explain why this bug hasn't affected more user code, since most
> people don't call alsa from another library. However, it does not explain everything since I believe there must
> be a few users who do put the calling code in a library.

What Jaroslav pointed is to pass -lasound2 at creating the *.so file,
not at linking to the final binary.  That is,

% gcc -shared test2.o -o test2.so -lasound

Otherwise the linker won't get the proper versioned symbol, hence an
incorrect symbol may be taken instead of the expected versioned one.

Calling ALSA library from a shared object is commonly done,
e.g. PulseAudio.  The tricky part is the versioned symbol handling,
and it's not specific to ALSA-lib but a generic problem.


Takashi

>  
> Thanks,
>  
> Scott Franco
>  
> --------- Original Message --------- Subject: RE: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
> From: "scott andrew franco" <samiam@moorecad.com>
> Date: 6/18/19 11:33 am
> To: "Jaroslav Kysela" <perex@perex.cz>
> Cc: alsa-devel@alsa-project.org
> 
>  Hi, and thanks for the reply.
>  
> >I think that you must link .so to -lasound, too.
>  
> This was done and shows in the command line example below, IE,
>  
>  samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
> > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
> > samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
> > alsaplaywave: rate: 1
> > alsaplaywave: rate: 0
> > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
> > samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
> > alsaplaywave: rate: 1
> > alsaplaywave: rate: 1
>  
> Note that in both the "succeeds" case and the "fails" case carry the -lasound option. It would not compile
> if not.
>  
> Scott Franco
>  
> --------- Original Message --------- Subject: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
> From: "Jaroslav Kysela" <perex@perex.cz>
> Date: 6/18/19 11:18 am
> To: "scott andrew franco" <samiam@moorecad.com>
> Cc: alsa-devel@alsa-project.org
> 
> Dne 18. 06. 19 v 17:16 scott andrew franco napsal(a):
>  > Hello,
>  > 
>  > The issue:
>  > 
>  > calling across .so (dynamic linking) produces different behavior in ALSA library calls than normal,
>  > and causes ALSA to malfunction.
>  > 
>  > I have minimized my issue to as small a code section as possible. Note the code is from commonly available
>  > internet examples, including Free Electrons "Audio in embedded linux systems".
>  
>  It seems like a linker issue. I think that you must link .so to -lasound, too.
>  (add -lasound to the command producing your .so library to satisfy the
>  versioned symbols)
>  
>  Jaroslav
>  
>  > 
>  > The run is:
>  > 
>  > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
>  > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
>  > samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
>  > alsaplaywave: rate: 1
>  > alsaplaywave: rate: 0
>  > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
>  > samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
>  > alsaplaywave: rate: 1
>  > alsaplaywave: rate: 1
>  > 
>  > Note the only difference between the two runs of "playwave" is if the second module, test2, is linked as a .so or
>  > linked as a .o.
>  > 
>  > The code is:
>  > =======================================================================================
>  > playwav.c
>  > #include <alsa/asoundlib.h>
>  > #include <stdio.h>
>  > void alsaplaywave1(void)
>  > {
>  > snd_pcm_t *pcm_handle;
>  > snd_pcm_hw_params_t *params;
>  > unsigned int val;
>  > unsigned int rate;
>  > int r;
>  > /* open pcm device */
>  > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
>  > if (r < 0) printf("Cannot open PCM output device");
>  > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
>  > snd_pcm_hw_params_any(pcm_handle, params);
>  > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
>  > if (r < 0) printf("Cannot set interleaved mode");
>  > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
>  > if (r < 0) printf("Cannot set format");
>  > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
>  > if (r < 0) printf("Cannot set channels number");
>  > val = 44100;
>  > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
>  > if (r < 0) printf("Cannot set rate");
>  > snd_pcm_hw_params_get_rate(params, &rate, 0);
>  > printf("alsaplaywave: rate: %d\n", rate);
>  > snd_pcm_close(pcm_handle);
>  > }
>  > extern void alsaplaywave2(void);
>  > int main(int argc, char **argv)
>  > {
>  > alsaplaywave1();
>  > alsaplaywave2();
>  > return 0;
>  > }
>  > 
>  > ==================================================================================
>  > test2.c
>  > #include <alsa/asoundlib.h>
>  > #include <stdio.h>
>  > void alsaplaywave2(void)
>  > {
>  > snd_pcm_t *pcm_handle;
>  > snd_pcm_hw_params_t *params;
>  > unsigned int val;
>  > unsigned int rate;
>  > int r;
>  > /* open pcm device */
>  > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
>  > if (r < 0) printf("Cannot open PCM output device");
>  > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
>  > snd_pcm_hw_params_any(pcm_handle, params);
>  > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
>  > if (r < 0) printf("Cannot set interleaved mode");
>  > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
>  > if (r < 0) printf("Cannot set format");
>  > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
>  > if (r < 0) printf("Cannot set channels number");
>  > val = 44100;
>  > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
>  > if (r < 0) printf("Cannot set rate");
>  > snd_pcm_hw_params_get_rate(params, &rate, 0);
>  > printf("alsaplaywave: rate: %d\n", rate);
>  > snd_pcm_close(pcm_handle);
>  > }
>  > _______________________________________________
>  > Alsa-devel mailing list
>  > Alsa-devel@alsa-project.org
>  > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>  > 
>  
>  
>  -- 
>  Jaroslav Kysela <perex@perex.cz>
>  Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
>  _______________________________________________
>  Alsa-devel mailing list
>  Alsa-devel@alsa-project.org
>  https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Serious bug calling ALSA lib functions from .so vs. .o file
  2019-06-18 20:49         ` Takashi Iwai
@ 2019-06-18 21:10           ` scott andrew franco
  2019-06-18 21:20             ` scott andrew franco
  0 siblings, 1 reply; 9+ messages in thread
From: scott andrew franco @ 2019-06-18 21:10 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Ok I see, apologies. Will try that.
 
Scott
 
--------- Original Message --------- Subject: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
From: "Takashi Iwai" <tiwai@suse.de>
Date: 6/18/19 1:49 pm
To: "scott andrew franco" <samiam@moorecad.com>
Cc: alsa-devel@alsa-project.org

On Tue, 18 Jun 2019 20:59:19 +0200,
 scott andrew franco wrote:
 > 
 > PS. I really appreciate the help, I have spent more than a week on this, it is a serious blocking issue.
 > 
 > I've gone over the example I posted quite carefully. I recommend you try the example out. You just need the
 > two source files below (test2.c and playwav.c). and execute the commands shown below.
 > 
 > The fact that it fails only in the .so file can explain why this bug hasn't affected more user code, since most
 > people don't call alsa from another library. However, it does not explain everything since I believe there must
 > be a few users who do put the calling code in a library.
 
 What Jaroslav pointed is to pass -lasound2 at creating the *.so file,
 not at linking to the final binary. That is,
 
 % gcc -shared test2.o -o test2.so -lasound
 
 Otherwise the linker won't get the proper versioned symbol, hence an
 incorrect symbol may be taken instead of the expected versioned one.
 
 Calling ALSA library from a shared object is commonly done,
 e.g. PulseAudio. The tricky part is the versioned symbol handling,
 and it's not specific to ALSA-lib but a generic problem.
 
 
 Takashi
 
 > 
 > Thanks,
 > 
 > Scott Franco
 > 
 > --------- Original Message --------- Subject: RE: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
 > From: "scott andrew franco" <samiam@moorecad.com>
 > Date: 6/18/19 11:33 am
 > To: "Jaroslav Kysela" <perex@perex.cz>
 > Cc: alsa-devel@alsa-project.org
 > 
 > Hi, and thanks for the reply.
 > 
 > >I think that you must link .so to -lasound, too.
 > 
 > This was done and shows in the command line example below, IE,
 > 
 > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
 > > samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
 > > alsaplaywave: rate: 1
 > > alsaplaywave: rate: 0
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
 > > samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
 > > alsaplaywave: rate: 1
 > > alsaplaywave: rate: 1
 > 
 > Note that in both the "succeeds" case and the "fails" case carry the -lasound option. It would not compile
 > if not.
 > 
 > Scott Franco
 > 
 > --------- Original Message --------- Subject: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
 > From: "Jaroslav Kysela" <perex@perex.cz>
 > Date: 6/18/19 11:18 am
 > To: "scott andrew franco" <samiam@moorecad.com>
 > Cc: alsa-devel@alsa-project.org
 > 
 > Dne 18. 06. 19 v 17:16 scott andrew franco napsal(a):
 > > Hello,
 > > 
 > > The issue:
 > > 
 > > calling across .so (dynamic linking) produces different behavior in ALSA library calls than normal,
 > > and causes ALSA to malfunction.
 > > 
 > > I have minimized my issue to as small a code section as possible. Note the code is from commonly available
 > > internet examples, including Free Electrons "Audio in embedded linux systems".
 > 
 > It seems like a linker issue. I think that you must link .so to -lasound, too.
 > (add -lasound to the command producing your .so library to satisfy the
 > versioned symbols)
 > 
 > Jaroslav
 > 
 > > 
 > > The run is:
 > > 
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
 > > samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
 > > alsaplaywave: rate: 1
 > > alsaplaywave: rate: 0
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
 > > samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
 > > alsaplaywave: rate: 1
 > > alsaplaywave: rate: 1
 > > 
 > > Note the only difference between the two runs of "playwave" is if the second module, test2, is linked as a .so or
 > > linked as a .o.
 > > 
 > > The code is:
 > > =======================================================================================
 > > playwav.c
 > > #include <alsa/asoundlib.h>
 > > #include <stdio.h>
 > > void alsaplaywave1(void)
 > > {
 > > snd_pcm_t *pcm_handle;
 > > snd_pcm_hw_params_t *params;
 > > unsigned int val;
 > > unsigned int rate;
 > > int r;
 > > /* open pcm device */
 > > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 > > if (r < 0) printf("Cannot open PCM output device");
 > > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 > > snd_pcm_hw_params_any(pcm_handle, params);
 > > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 > > if (r < 0) printf("Cannot set interleaved mode");
 > > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 > > if (r < 0) printf("Cannot set format");
 > > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 > > if (r < 0) printf("Cannot set channels number");
 > > val = 44100;
 > > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 > > if (r < 0) printf("Cannot set rate");
 > > snd_pcm_hw_params_get_rate(params, &rate, 0);
 > > printf("alsaplaywave: rate: %d\n", rate);
 > > snd_pcm_close(pcm_handle);
 > > }
 > > extern void alsaplaywave2(void);
 > > int main(int argc, char **argv)
 > > {
 > > alsaplaywave1();
 > > alsaplaywave2();
 > > return 0;
 > > }
 > > 
 > > ==================================================================================
 > > test2.c
 > > #include <alsa/asoundlib.h>
 > > #include <stdio.h>
 > > void alsaplaywave2(void)
 > > {
 > > snd_pcm_t *pcm_handle;
 > > snd_pcm_hw_params_t *params;
 > > unsigned int val;
 > > unsigned int rate;
 > > int r;
 > > /* open pcm device */
 > > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 > > if (r < 0) printf("Cannot open PCM output device");
 > > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 > > snd_pcm_hw_params_any(pcm_handle, params);
 > > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 > > if (r < 0) printf("Cannot set interleaved mode");
 > > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 > > if (r < 0) printf("Cannot set format");
 > > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 > > if (r < 0) printf("Cannot set channels number");
 > > val = 44100;
 > > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 > > if (r < 0) printf("Cannot set rate");
 > > snd_pcm_hw_params_get_rate(params, &rate, 0);
 > > printf("alsaplaywave: rate: %d\n", rate);
 > > snd_pcm_close(pcm_handle);
 > > }
 > > _______________________________________________
 > > Alsa-devel mailing list
 > > Alsa-devel@alsa-project.org
 > > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
 > > 
 > 
 > 
 > -- 
 > Jaroslav Kysela <perex@perex.cz>
 > Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
 > _______________________________________________
 > Alsa-devel mailing list
 > Alsa-devel@alsa-project.org
 > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
 > _______________________________________________
 > Alsa-devel mailing list
 > Alsa-devel@alsa-project.org
 > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
 > 
 _______________________________________________
 Alsa-devel mailing list
 Alsa-devel@alsa-project.org
 https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Serious bug calling ALSA lib functions from .so vs. .o file
  2019-06-18 21:10           ` scott andrew franco
@ 2019-06-18 21:20             ` scott andrew franco
  0 siblings, 0 replies; 9+ messages in thread
From: scott andrew franco @ 2019-06-18 21:20 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

Fixed.
 
Again, apologies for my being dense there.
 
This is *great* it all works now. I don't think I would have figured out that link issue on my own.
 
Scott Franco
 
--------- Original Message --------- Subject: RE: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
From: "scott andrew franco" <samiam@moorecad.com>
Date: 6/18/19 2:10 pm
To: "Takashi Iwai" <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org

 Ok I see, apologies. Will try that.
 
Scott
 
--------- Original Message --------- Subject: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
From: "Takashi Iwai" <tiwai@suse.de>
Date: 6/18/19 1:49 pm
To: "scott andrew franco" <samiam@moorecad.com>
Cc: alsa-devel@alsa-project.org

On Tue, 18 Jun 2019 20:59:19 +0200,
 scott andrew franco wrote:
 > 
 > PS. I really appreciate the help, I have spent more than a week on this, it is a serious blocking issue.
 > 
 > I've gone over the example I posted quite carefully. I recommend you try the example out. You just need the
 > two source files below (test2.c and playwav.c). and execute the commands shown below.
 > 
 > The fact that it fails only in the .so file can explain why this bug hasn't affected more user code, since most
 > people don't call alsa from another library. However, it does not explain everything since I believe there must
 > be a few users who do put the calling code in a library.
 
 What Jaroslav pointed is to pass -lasound2 at creating the *.so file,
 not at linking to the final binary. That is,
 
 % gcc -shared test2.o -o test2.so -lasound
 
 Otherwise the linker won't get the proper versioned symbol, hence an
 incorrect symbol may be taken instead of the expected versioned one.
 
 Calling ALSA library from a shared object is commonly done,
 e.g. PulseAudio. The tricky part is the versioned symbol handling,
 and it's not specific to ALSA-lib but a generic problem.
 
 
 Takashi
 
 > 
 > Thanks,
 > 
 > Scott Franco
 > 
 > --------- Original Message --------- Subject: RE: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
 > From: "scott andrew franco" <samiam@moorecad.com>
 > Date: 6/18/19 11:33 am
 > To: "Jaroslav Kysela" <perex@perex.cz>
 > Cc: alsa-devel@alsa-project.org
 > 
 > Hi, and thanks for the reply.
 > 
 > >I think that you must link .so to -lasound, too.
 > 
 > This was done and shows in the command line example below, IE,
 > 
 > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
 > > samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
 > > alsaplaywave: rate: 1
 > > alsaplaywave: rate: 0
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
 > > samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
 > > alsaplaywave: rate: 1
 > > alsaplaywave: rate: 1
 > 
 > Note that in both the "succeeds" case and the "fails" case carry the -lasound option. It would not compile
 > if not.
 > 
 > Scott Franco
 > 
 > --------- Original Message --------- Subject: Re: [alsa-devel] Serious bug calling ALSA lib functions from .so vs. .o file
 > From: "Jaroslav Kysela" <perex@perex.cz>
 > Date: 6/18/19 11:18 am
 > To: "scott andrew franco" <samiam@moorecad.com>
 > Cc: alsa-devel@alsa-project.org
 > 
 > Dne 18. 06. 19 v 17:16 scott andrew franco napsal(a):
 > > Hello,
 > > 
 > > The issue:
 > > 
 > > calling across .so (dynamic linking) produces different behavior in ALSA library calls than normal,
 > > and causes ALSA to malfunction.
 > > 
 > > I have minimized my issue to as small a code section as possible. Note the code is from commonly available
 > > internet examples, including Free Electrons "Audio in embedded linux systems".
 > 
 > It seems like a linker issue. I think that you must link .so to -lasound, too.
 > (add -lasound to the command producing your .so library to satisfy the
 > versioned symbols)
 > 
 > Jaroslav
 > 
 > > 
 > > The run is:
 > > 
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -fPIC -c test2.c -o test2.o
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.so -lasound -o playwav
 > > samiam@samiam-home-pc:~/projeclufthansa check reservationts/petit_ami$ ./playwav
 > > alsaplaywave: rate: 1
 > > alsaplaywave: rate: 0
 > > samiam@samiam-home-pc:~/projects/petit_ami$ gcc -g3 -Iinclude linux/playwav.c ./test2.o -lasound -o playwav
 > > samiam@samiam-home-pc:~/projects/petit_ami$ ./playwav
 > > alsaplaywave: rate: 1
 > > alsaplaywave: rate: 1
 > > 
 > > Note the only difference between the two runs of "playwave" is if the second module, test2, is linked as a .so or
 > > linked as a .o.
 > > 
 > > The code is:
 > > =======================================================================================
 > > playwav.c
 > > #include <alsa/asoundlib.h>
 > > #include <stdio.h>
 > > void alsaplaywave1(void)
 > > {
 > > snd_pcm_t *pcm_handle;
 > > snd_pcm_hw_params_t *params;
 > > unsigned int val;
 > > unsigned int rate;
 > > int r;
 > > /* open pcm device */
 > > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 > > if (r < 0) printf("Cannot open PCM output device");
 > > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 > > snd_pcm_hw_params_any(pcm_handle, params);
 > > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 > > if (r < 0) printf("Cannot set interleaved mode");
 > > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 > > if (r < 0) printf("Cannot set format");
 > > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 > > if (r < 0) printf("Cannot set channels number");
 > > val = 44100;
 > > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 > > if (r < 0) printf("Cannot set rate");
 > > snd_pcm_hw_params_get_rate(params, &rate, 0);
 > > printf("alsaplaywave: rate: %d\n", rate);
 > > snd_pcm_close(pcm_handle);
 > > }
 > > extern void alsaplaywave2(void);
 > > int main(int argc, char **argv)
 > > {
 > > alsaplaywave1();
 > > alsaplaywave2();
 > > return 0;
 > > }
 > > 
 > > ==================================================================================
 > > test2.c
 > > #include <alsa/asoundlib.h>
 > > #include <stdio.h>
 > > void alsaplaywave2(void)
 > > {
 > > snd_pcm_t *pcm_handle;
 > > snd_pcm_hw_params_t *params;
 > > unsigned int val;
 > > unsigned int rate;
 > > int r;
 > > /* open pcm device */
 > > r = snd_pcm_open(&pcm_handle, "default", SND_PCM_STREAM_PLAYBACK, 0);
 > > if (r < 0) printf("Cannot open PCM output device");
 > > snd_pcm_hw_params_alloca(&params); /* get hw parameter block */
 > > snd_pcm_hw_params_any(pcm_handle, params);
 > > r = snd_pcm_hw_params_set_access(pcm_handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
 > > if (r < 0) printf("Cannot set interleaved mode");
 > > r = snd_pcm_hw_params_set_format(pcm_handle, params, SND_PCM_FORMAT_S16_LE);
 > > if (r < 0) printf("Cannot set format");
 > > r = snd_pcm_hw_params_set_channels(pcm_handle, params, 2);
 > > if (r < 0) printf("Cannot set channels number");
 > > val = 44100;
 > > r = snd_pcm_hw_params_set_rate_near(pcm_handle, params, &rate, 0);
 > > if (r < 0) printf("Cannot set rate");
 > > snd_pcm_hw_params_get_rate(params, &rate, 0);
 > > printf("alsaplaywave: rate: %d\n", rate);
 > > snd_pcm_close(pcm_handle);
 > > }
 > > _______________________________________________
 > > Alsa-devel mailing list
 > > Alsa-devel@alsa-project.org
 > > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
 > > 
 > 
 > 
 > -- 
 > Jaroslav Kysela <perex@perex.cz>
 > Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
 > _______________________________________________
 > Alsa-devel mailing list
 > Alsa-devel@alsa-project.org
 > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
 > _______________________________________________
 > Alsa-devel mailing list
 > Alsa-devel@alsa-project.org
 > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
 > 
 _______________________________________________
 Alsa-devel mailing list
 Alsa-devel@alsa-project.org
 https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-06-18 21:20 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-18  6:24 Serious bug calling ALSA lib functions from .so vs. .o file scott andrew franco
2019-06-18 15:16 ` scott andrew franco
2019-06-18 15:54   ` scott andrew franco
2019-06-18 18:18   ` Jaroslav Kysela
2019-06-18 18:33     ` scott andrew franco
2019-06-18 18:59       ` scott andrew franco
2019-06-18 20:49         ` Takashi Iwai
2019-06-18 21:10           ` scott andrew franco
2019-06-18 21:20             ` scott andrew franco

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.