lyrebird-voice-changer/lyrebird

Lyrebird refuses to work, no input device created

ErisonNull opened this issue · 2 comments

Hello! I have that error on Linux Mint 21.2 (ubuntu 22.04)

erisonnull@lmint:~$ lyrebird
[info] Starting Lyrebird v1.2.0
[info] Audio server: None
Произошла ошибка: Не удалось инициализировать модуль
Traceback (most recent call last):
  File "/usr/share/lyrebird/app/ui/mainwindow.py", line 179, in toggle_activated
    state.audio.load_pa_modules()
  File "/usr/share/lyrebird/app/core/audio.py", line 55, in load_pa_modules
    self.null_sink = subprocess.check_call(
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['pactl', 'load-module', 'module-null-sink', 'sink_name=Lyrebird-Output', 'node.description="Lyrebird', 'Output"']' returned non-zero exit status 1.
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 153, in apport_excepthook
    with os.fdopen(os.open(pr_filename,
FileNotFoundError: [Errno 2] Нет такого файла или каталога: '/var/crash/_usr_share_lyrebird_app.py.1000.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/share/lyrebird/app/ui/mainwindow.py", line 179, in toggle_activated
    state.audio.load_pa_modules()
  File "/usr/share/lyrebird/app/core/audio.py", line 55, in load_pa_modules
    self.null_sink = subprocess.check_call(
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['pactl', 'load-module', 'module-null-sink', 'sink_name=Lyrebird-Output', 'node.description="Lyrebird', 'Output"']' returned non-zero exit status 1.

Same here! I've might figured that out.

@staticmethod
    def determine_audio_server():
        pactl_info = subprocess.run(["pactl", "info"], capture_output=True, encoding="utf8")
        stdout = pactl_info.stdout
        print(stdout)
        server_name_prefix = "Server Name: "
        for line in stdout.split("\n"):
            if line.startswith(server_name_prefix):
                audio_server = line[len(server_name_prefix):]
                if len(audio_server) == 0:
                    return None
                return audio_server

this method relies on server_name_prefix = "Server Name: " to fetch an audio server name, but if you have a different system locale then this method would fail!

this is my output for example

Имя сервера: **pulseaudio**

so it can't match the string properly

we need to figure out more elegant way of doing this!

Oh and furthermore, creating virtual mic isn't working also
Commands are written totally wrong!

See here for an example
https://askubuntu.com/questions/1398632/how-can-i-fit-python-pyaudio-to-to-virtual-microphone-that-i-created

If i'm going to have some time this week, I'll make a pull request

Cheers!

Switching to pactl --format=json info, might be a fix for this defect.