tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

net/sniffnet



Hi,

I've recently updated net/sniffnet to v1.1.0
The new version has a new notifications feature that includes sound effects.
Sound is provide by rodio which, uses cpal which in turn uses alsa.

Adding .include "../../audio/alsa-lib/buildlink3.mk" and 
DEPENDS+= alsa-plugins-oss-[0-9]*:../../audio/alsa-plugins-oss
to the package Makefile allows compiling the binary successfully.

Though, install fails with

ERROR: bin/sniffnet: missing library: libasound.so.2
*** Error code 1

Stop.

Adding
RUSTFLAGS+= -C link-arg=${COMPILER_RPATH_FLAG}${BUILDLINK_PREFIX.alsa-lib}/lib

fixes the install issue and the binary build, installs and works as expected.

One can set the sound effects to 'None' or, not use notifications but, trying
to adjust the sound causes an application crash.

Yes, I've copied /usr/pkg/share/examples/alsa-plugins-oss/asoundrc to /home/${USER}/.asoundrc

ALSA lib confmisc.c:855:(parse_card) cannot find card '0'
ALSA lib conf.c:5188:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5188:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5188:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5711:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM default
thread 'thread_play_sound' panicked at 'called `Result::unwrap()` on an `Err` value: DefaultStreamConfigError(DeviceNotAvailable)', src/enums/[sound.rs:60](http://sound.rs:60/):72
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

According to upstream, https://github.com/GyulyVGC/sniffnet/pull/37#issuecomment-1424779358
this is due to libasound not being found.

Obviously the libraries are installed,

~ > cd /usr/pkg/lib
/usr/pkg/lib > ls | grep libasound
.rw-r--r-- root wheel  2.0 MB Mon Nov 21 05:39:08 2022 libasound.a
.rwxr-xr-x root wheel  971 B  Mon Nov 21 05:39:08 2022 libasound.la
lrwxr-xr-x root wheel   18 B  Mon Nov 21 05:39:08 2022 libasound.so ⇒ libasound.so.2.0.0
lrwxr-xr-x root wheel   18 B  Mon Nov 21 05:39:08 2022 libasound.so.2 ⇒ libasound.so.2.0.0
.rwxr-xr-x root wheel  1.2 MB Mon Nov 21 05:39:07 2022 libasound.so.2.0.0

It seems rustc is happy and finds libasound but, the compiled sniffnet binary does not.
Any clues or suggestions? Maybe someone using alsa?

Is there a way to explicit point the compiler to the libasound path or, is something wrong with the default asoundrc?

Thanks!



Sent with Proton Mail secure email.


Home | Main Index | Thread Index | Old Index