i-rinat / freshplayerplugin

ppapi2npapi compatibility layer
MIT License
727 stars 52 forks source link

asoundlib.h: No such file or directory #380

Closed Vascom closed 5 years ago

Vascom commented 5 years ago

I am can't build 0.3.11 release with this error:

/builddir/build/BUILD/freshplayerplugin-0.3.11/src/audio_thread_alsa.c:32:10: fatal error: asoundlib.h: No such file or directory
   32 | #include <asoundlib.h>
      |          ^~~~~~~~~~~~~

Alsa lib installed and it's headers in /usr/include/alsa

Full build log http://koji.rpmfusion.org/kojifiles/work/tasks/5878/325878/build.log

i-rinat commented 5 years ago

As far as I understand, ALSA libraries removed /usr/include/alsa from include paths, so instead of using asoundlib.h one should use alsa/asoundlib.h. So, use this patch: https://github.com/i-rinat/freshplayerplugin/commit/e608336b3e9382ceaa6888d122941baaaaa55e91. It should help.

Vascom commented 5 years ago

May be in othet distro alsa headers in other path. Can you make cmake autodetect it instead hardcoding?

i-rinat commented 5 years ago

Can you make cmake autodetect it instead hardcoding?

I don't think it's necessary. Inside alsa-lib repository #include <alsa/asoundlib.h> was used at least for 10 years. It was my mistake to use #include <asoundlib.h>. I peeked at some examples over the Internet when I was learning ALSA libraries.

Here is the change in ALSA libraries that surfaced the issue: https://git.alsa-project.org/?p=alsa-lib.git;a=commit;h=fc0e54c3cc6ad48d12d2cdad18df4473c559a448. As you can see, they say the #include <alsa/asoundlib.h> is the way it should be included.

Vascom commented 5 years ago

OK. It works. Thanks.