Open jariji opened 2 years ago
Right now PulseAudio isn't set up to work with pipewire. Related: #92. Some of the other errors might be separate issues. Do you still have alsa? Can you find an alsa.conf file? The invalid PaErrorCode message is a bit of a bug: we should be throwing a better error there.
I have the pipewire-alsa compatiblity shim enabled and there are some related-looking files:
% ll /etc/alsa/conf.d
lrwxrwxrwx 48 root 18 Sep 12:09 49-pipewire-modules.conf -> /etc/static/alsa/conf.d/49-pipewire-modules.conf
lrwxrwxrwx 40 root 18 Sep 12:09 50-pipewire.conf -> /etc/static/alsa/conf.d/50-pipewire.conf
lrwxrwxrwx 48 root 18 Sep 12:09 99-pipewire-default.conf -> /etc/static/alsa/conf.d/99-pipewire-default.conf
Well one thing to try would be to add /etc/static/alsa/
to the list here:
Another thing to try might be to build a newer version of PulseAudio in BinaryBuilder:
https://github.com/JuliaPackaging/Yggdrasil/blob/master/P/PulseAudio/build_tarballs.jl
But I suspect the best way to solve it would be to build Pipewire with binary builder and then make alsa-plugins aware of it:
https://github.com/JuliaPackaging/Yggdrasil/blob/master/A/alsa_plugins/build_tarballs.jl
I tried setting the ALSA_CONFIG_DIR
environment variable which got me past the build step but creating a stream failed. The error is coming from
https://files.portaudio.com/docs/v19-doxydocs/portaudio_8h.html#adc955dfab007624000695c48d4f876dc
which says
The user should first determine the available device ids by using the supplied application "pa_devs".
and then set the environment variable PA_RECOMMENDED_OUTPUT_DEVICE
so I look at pa_devs.c
and it's calling Pa_GetDeviceCount
. But
julia> PortAudio.LibPortAudio.Pa_GetDeviceCount()
0
even after
julia> PortAudio.LibPortAudio.Pa_Initialize()
0
julia> PortAudio.LibPortAudio.Pa_GetDeviceCount()
0
so something's wrong.
I didn't set ALSA_PLUGIN_DIR
but I don't know if that's relevant.
In Python it works fine.
https://github.com/spatialaudio/python-sounddevice/blob/master/sounddevice.py#L453
>>> import sounddevice as sd
>>> sd._lib.Pa_GetDeviceCount()
13
julia> ENV["ALSA_CONFIG_DIR"] = "/etc/static/alsa"
pkg> add PortAudio, SampledSignals
julia> using PortAudio, SampledSignals;
julia> stream = PortAudioStream(2, 2; warn_xruns = false);
ERROR: ArgumentError: invalid value for Enum PaErrorCode: -1
Stacktrace:
[1-5] ⋮ internal
@ Base.Enums, PortAudio, Unknown
[6] PortAudioStream(input_channels::Int64, output_channels::Int64; keywords::Base.Pairs{Symbol, Bool, …})
@ PortAudio ~/.julia/packages/PortAudio/HNBv4/src/PortAudio.jl:871
Use `err` to retrieve the full stack trace.
julia> err
1-element ExceptionStack:
ArgumentError: invalid value for Enum PaErrorCode: -1
Stacktrace:
[1] enum_argument_error(typename::Symbol, x::Int32)
@ Base.Enums ./Enums.jl:93
[2] PaErrorCode
@ ./Enums.jl:211 [inlined]
[3] handle_status(error_number::Int32; warn_xruns::Bool)
@ PortAudio ~/.julia/packages/PortAudio/HNBv4/src/PortAudio.jl:94
[4] handle_status
@ ~/.julia/packages/PortAudio/HNBv4/src/PortAudio.jl:92 [inlined]
[5] get_default_input_index
@ ~/.julia/packages/PortAudio/HNBv4/src/PortAudio.jl:199 [inlined]
[6] PortAudioStream(input_channels::Int64, output_channels::Int64; keywords::Base.Pairs{Symbol, Bool, Tuple{Symbol}, NamedTuple{(:warn_xruns,), Tuple{Bool}}})
@ PortAudio ~/.julia/packages/PortAudio/HNBv4/src/PortAudio.jl:871
[7] top-level scope
@ REPL[6]:1
(jl_3wZYpH) pkg> st
Status `/tmp/jl_3wZYpH/Project.toml`
[80ea8bcb] PortAudio v1.3.0
[bd7594eb] SampledSignals v2.1.3
julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 24 × AMD Ryzen 9 3900XT 12-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, znver2)
Threads: 12 on 24 virtual cores
Environment:
JULIA_NUM_THREADS = 12
JULIA_PKG_PRESERVE_TIERED_INSTALLED = true
JULIA_IMAGE_THREADS = 1
PortAudio.LibPortAudio.Pa_Initialize(); PortAudio.LibPortAudio.Pa_GetDeviceCount()
isn't detecting any devices. This may be because it needs to be configured with pipewire support.
I tried to follow the readme.
NixOS, with Pipewire emulating Pulseaudio. Julia 1.7.1