Open KirMozor opened 2 years ago
I decided to try to make a symbolic link to the file sudo ln -s /usr/lib/libdl.so.2 /usr/lib/libdl.so
However (as expected) PortAudio didn't like it :(
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Unhandled exception. Bufdio.Exceptions.BufdioException: No loaded audio for playback.
at Bufdio.Utilities.Ensure.That[TException](Boolean condition, String message)
at Bufdio.Players.AudioPlayer.Play()
at Program.ProgramNew.Main() in /home/kirill/RiderProjects/TestEvents/Program.cs:line 18
Process finished with exit code 137.
Hi @KirMozor
Unfortunately I don't own arch, could you please rename this line to libdl.so.2
and check if it works?
https://github.com/luthfiampas/Bufdio/blob/46a4c67bb5a15a15bfbe834d7c99ad0702cc10e5/src/Bufdio/Interop/Libdl.cs#L8
Also I'm not sure why PortAudio uses jack as the default output device when the jack server doesn't even start.
... Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock Cannot connect to server socket err = No such file or directory Cannot connect to server request channel jack server is not running or cannot be started JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock ...
@KirMozor Could you please try this branch out (fix/linux-native-methods
)? This will use libdl.so.2
in Linux. Tested in Fedora and Debian.
Hello, I will try to rename the line in the source code that you said About the arch. There's a great thing called Distrobox, it lets you put any distribution through a docker container About jack, I use Pipewire and maybe it started using jack instead of pulseaudio (the system has a package pipewire-alsa, pipewire-pulse)
@KirMozor Could you please try this branch out (
fix/linux-native-methods
)? This will uselibdl.so.2
in Linux. Tested in Fedora and Debian.
Result:
/home/kirill/RiderProjects/TestEvents/bin/Debug/net6.0/TestEvents
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Unhandled exception. Bufdio.Exceptions.BufdioException: No loaded audio for playback.
at Bufdio.Utilities.Ensure.That[TException](Boolean condition, String message)
at Bufdio.Players.AudioPlayer.Play()
at Program.ProgramNew.Main() in /home/kirill/RiderProjects/TestEvents/Program.cs:line 18
My libdl.so.2 libdl.so.2.zip
WHAT???? Your example on Avalonia works...
Yeah, but the url doesn't play :( How to fix it? I used this URL: https://www.youtube.com/watch?v=7wtfhZwyrcc Log:
/home/kirill/Tools/Bufdio/examples/BufdioAvalonia/bin/Debug/net6.0/BufdioAvalonia
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
ALSA lib pcm_route.c:877:(find_matching_chmap) Found no matching channel map
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Sorry, I think this issue is related to ffmpeg, you can check if it works by playing local audio file first.
For example, we can't load this file (https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3) because the transfer encoding is being chunked that makes duration of the audio file remains unknown until we get complete response.
Yeah, but the url doesn't play :( How to fix it?
It happens a lot with ffmpeg in the first load, you can retry and check if it works. Will take a deeper look, maybe tomorrow.
Sorry, I think this issue is related to ffmpeg, you can check if it works by playing local audio file first.
For example, we can't load this file (https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3) because the transfer encoding is being chunked that makes duration of the audio file remains unknown until we get complete response.
I checked if the track by url and the local file through ffmpeg, and it plays https://user-images.githubusercontent.com/68265324/173661425-cb1942f6-d094-4ed2-a7e6-6200ffb476d2.mp4
What progress has been made in this case?
I had the same problem on the latest Fedora Linux Workstation.
I have a local fork where I use the NativeLibrary class from the .NET Core 3.1 (and later) standard library instead:
using System;
using System.Runtime.InteropServices;
namespace Bufdio.Utilities
{
internal sealed class LibraryLoader : IDisposable
{
private readonly IntPtr _handle;
private bool _disposed;
public LibraryLoader(string libraryName)
{
Ensure.NotNull(libraryName, nameof(libraryName));
if (!NativeLibrary.TryLoad(libraryName, out _handle)) {
throw new NotSupportedException("Platform is not supported.");
}
Ensure.That<Exception>(_handle != IntPtr.Zero, $"Could not load native libary: {libraryName}.");
}
public TDelegate LoadFunc<TDelegate>(string name)
{
IntPtr ptr = NativeLibrary.GetExport(_handle, name);
Ensure.That<Exception>(ptr != IntPtr.Zero, $"Could not load function name: {name}.");
return Marshal.GetDelegateForFunctionPointer<TDelegate>(ptr);
}
public void Dispose()
{
if (_disposed)
{
return;
}
NativeLibrary.Free(_handle);
_disposed = true;
}
}
}
It fixes the issue. Maybe this class could be backported if targeting netstandard2.1 is still required ?
I could not find this fork on your GitHub page. Can you provide me with the source code? I'd like to try and test a fix.
Sorry about the delay, here is the fix:
But it depends on .NET >= 6, not .NET Standard.
Hello, I tried the following code:
But your package turns out to have a bug, it crashes when it cannot find the libdl library
My distribution is ArchLinux and I decided to check if I have ffmpeg and portaudio installed, as it turns out I have
Then I went to Google and searched where libdl comes from, as it turns out it belongs to the package glibc, but I have this package installed
A search of the /usr/lib folder showed me that there are libraries in the system, but they have different names
Of course, you could make a reference to
/usr/lib/libdl.so.2
named/usr/lib/libdl.so
, but this is not the solution to the problem, what should I do (or you?)