Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Songrec crashes when changing, activating or deactivating the audio source. #169

Open
Mi605 opened this issue Jun 3, 2024 · 0 comments
Open

Comments

@Mi605
Copy link

Mi605 commented Jun 3, 2024

Issue Description:

SongRec 0.4.2 crashes when changing, activating or deactivating the audio source.

I've read #58 already and installed package pulseaudio-utils so pactl command is available. Is this a dependency for SongRec not mentioned in the install instructions? Nevertheless, installing it didn't fix the issue.

As you can see from the console output below I have already installed pipewire ver 1.0.3.

Songrec is the single audio program I've met by now not able to connect to the pipewire sound server monitors properly, and it doesn't show up in qpwgraph either, so I can't rewire its input to the proper output therein, while e.g. audacity and other programs do show up when running e.g. a recording; they can be observed therein connecting to one of the monitors on their own, while SongRec doesn't turns up at all.

It doesn't make any difference whether I set the profile in pavucontrol to pro audio or or to analog stereo duplex, the issue stays present.

Also it doesn't make any difference whether audacity, vmpk, qsynth/fluidsynth, pavucontrol, firefox, qpwgraph or other audio programs are running or not, nor from which program the sound is played.

The Audio input pulldown menu in Songrec shows the following entries (which look correct):

Internes Audio Pro (or Internes Audio Analog Stereo)
Monitor of Cedar HDMI Audio [...] Digital Stereo
Monitor of Internes Audio Pro (or Monitor of Inernes Audio Analog Stereo)
Monitor of Internes Audio Pro 1 (or none)

When selecting Internes Audio Pro (or Internes Audio Analog Stereo) instead of one of the monitors, the checkbox is reset from Speakers to Microphone automatically.

But even when the Monitors are selectable, they won't connect.

Remarkable detail might be: When running for the first time after reboot, Songrec connects properly for a single run to the preselected audio source, whichever this might be. Then there is no complaint about DeviceNotAvailable and it properly recognises the music. Only from a second run onwards, and also when you need to switch to another audio source in the first run, this issue occurs, and it seems it can be only solved by full rebooting, to make Songrec work again for a single request.

Also, on the first run of Songrec (when it is able to connect) you can observe the level indivator in its window quiver a bit, independend on what input source is selected, while on all the next runs it is dead until you reboot (while the respective indicators in other programs, e.g. pavucontrol, still work properly). Only Songrec seems to be affected from this strange sudden inavailability of the devices.

Just a suspicion: Is it possible Songrec doesn't free up a device once it had used it, so when calling it for another request or when switching forth and back between the devices it can't connect to the very audio devices it has used before, so it crashes when trying to access them again?

Background info:

Songrec was installed by the command from your readme.md:

$ cargo install songrec --no-default-features -F gui,ffmpeg,pulse,mpris

(Same result when compiling it after cloning your repo to the local drive and using the other method. Flatpak install wasn't tested, since flatpaks aren't supported by the OS, these are known to work unreliable.)

$ songrec --version
SongRec 0.4.2
$ RUST_BACKTRACE=1 songrec

ALSA lib pcm_dsnoop.c:566:(snd_pcm_dsnoop_open) unable to open slave
thread '<unnamed>' panicked at /home/Robin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/songrec-0.4.2/src/core/microphone_thread.rs:55:60:
Failed to get default input config: DeviceNotAvailable
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: songrec::core::microphone_thread::microphone_thread
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at /home/Robin/.cargo/registry/src/index.crates.io-6f17d22bba15001f/songrec-0.4.2/src/gui/main_window.rs:589:75:
called `Result::unwrap()` on an `Err` value: SendError { .. }
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: <O as gtk::auto::button::ButtonExt>::connect_clicked::clicked_trampoline
   4: <unknown>
   5: g_signal_emit_valist
   6: g_signal_emit
   7: <unknown>
   8: <unknown>
   9: g_signal_emit_valist
  10: g_signal_emit
  11: <unknown>
  12: <unknown>
  13: <unknown>
  14: g_signal_emit_valist
  15: g_signal_emit
  16: <unknown>
  17: g_cclosure_marshal_VOID__BOXEDv
  18: <unknown>
  19: g_signal_emit_valist
  20: g_signal_emit
  21: <unknown>
  22: <unknown>
  23: <unknown>
  24: gtk_event_controller_handle_event
  25: <unknown>
  26: <unknown>
  27: <unknown>
  28: g_signal_emit_valist
  29: g_signal_emit
  30: <unknown>
  31: <unknown>
  32: gtk_main_do_event
  33: <unknown>
  34: <unknown>
  35: g_main_context_dispatch
  36: <unknown>
  37: g_main_context_iteration
  38: g_application_run
  39: <O as gio::application::ApplicationExtManual>::run
  40: songrec::gui::main_window::gui_main
  41: songrec::main

Running with pipewire set to analog stereo duplex

$ wpctl status
PipeWire 'pipewire-0' [1.0.3, Robin@brike, cookie:2515171525]
 └─ Clients:
        32. pipewire                            [1.0.3, Robin@brike, pid:1636441]
        34. WirePlumber                         [1.0.3, Robin@brike, pid:1636439]
        35. WirePlumber [export]                [1.0.3, Robin@brike, pid:1636439]
        43. PipeWire ALSA [volumeicon]          [1.0.3, Robin@brike, pid:1636479]
        57. Firefox                             [1.0.3, Robin@brike, pid:1956231]
        82. wpctl                               [1.0.3, Robin@brike, pid:1986936]
        90. FluidSynth                          [1.0.3, Robin@brike, pid:1970103]
       101. MainConn                            [1.0.3, Robin@brike, pid:1981859]
       106. mpv                                 [1.0.3, Robin@brike, pid:1978857]
       112. FluidSynth                          [1.0.3, Robin@brike, pid:1969840]

Audio
 ├─ Devices:
 │      42. Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series] [alsa]
 │      48. Internes Audio                      [alsa]
 │  
 ├─ Sinks:
 │      47. Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series] Digital Stereo (HDMI) [vol: 1.00]
 │  *   53. Internes Audio Pro                  [vol: 0.65]
 │      56. Internes Audio Pro 1                [vol: 1.00]
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  *   78. Internes Audio Pro                  [vol: 1.00]
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:
        98. FluidSynth                                                  
             95. output_FR       > VT1708S Analog:playback_AUX1	[active]
             97. output_FL       > VT1708S Analog:playback_AUX0	[active]
       104. FluidSynth                                                  
            103. output_FL       > VT1708S Analog:playback_AUX0	[active]
            111. output_FR       > VT1708S Analog:playback_AUX1	[active]
       108. mpv                                                         
            105. output_FR       > VT1708S Analog:playback_AUX1	[active]
            110. output_FL       > VT1708S Analog:playback_AUX0	[active]

Video
 ├─ Devices:
 │  
 ├─ Sinks:
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:

Settings
 └─ Default Configured Node Names:

Running with pipewire set to pro audio:

$ wpctl status
PipeWire 'pipewire-0' [1.0.3, Robin@brike, cookie:2515171525]
 └─ Clients:
        32. pipewire                            [1.0.3, Robin@brike, pid:1636441]
        34. WirePlumber                         [1.0.3, Robin@brike, pid:1636439]
        35. WirePlumber [export]                [1.0.3, Robin@brike, pid:1636439]
        43. PipeWire ALSA [volumeicon]          [1.0.3, Robin@brike, pid:1636479]
        57. Firefox                             [1.0.3, Robin@brike, pid:1956231]
        82. qpwgraph                            [1.0.3, Robin@brike, pid:1614384]
        86. PulseAudio-Lautstärkeregler        [1.0.3, Robin@brike, pid:1987346]
        90. FluidSynth                          [1.0.3, Robin@brike, pid:1970103]
       101. wpctl                               [1.0.3, Robin@brike, pid:2031989]
       112. FluidSynth                          [1.0.3, Robin@brike, pid:1969840]
       135. mpv                                 [1.0.3, Robin@brike, pid:1992276]

Audio
 ├─ Devices:
 │      42. Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series] [alsa]
 │      48. Internes Audio                      [alsa]
 │  
 ├─ Sinks:
 │      47. Cedar HDMI Audio [Radeon HD 5400/6300/7300 Series] Digital Stereo (HDMI) [vol: 1.00]
 │  *   53. Internes Audio Pro                  [vol: 0.65]
 │      56. Internes Audio Pro 1                [vol: 1.00]
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  *   78. Internes Audio Pro                  [vol: 1.00]
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:
        83. PulseAudio-Lautstärkeregler                                
             91. monitor_FL     
             99. input_FR        < VT1708S Analog:capture_AUX1	[init]
            100. input_FL        < VT1708S Analog:capture_AUX0	[active]
            116. monitor_FR     
        84. PulseAudio-Lautstärkeregler                                
             58. monitor_FL     
             62. monitor_FR     
             64. input_FR        < PMO S321-IQSC:monitor_FR	[active]
             87. input_FL        < PMO S321-IQSC:monitor_FL	[active]
        85. PulseAudio-Lautstärkeregler                                
             61. input_FR        < VT1708S Analog:monitor_AUX1	[active]
             63. input_FL        < VT1708S Analog:monitor_AUX0	[active]
             73. monitor_FR     
             74. monitor_FL     
        88. PulseAudio-Lautstärkeregler                                
             89. input_FL        < VT1708S Digital:monitor_AUX0	[active]
             92. input_FR        < VT1708S Digital:monitor_AUX1	[active]
             93. monitor_FR     
             94. monitor_FL     
        98. FluidSynth                                                  
             95. output_FR       > VT1708S Analog:playback_AUX1	[active]
             97. output_FL       > VT1708S Analog:playback_AUX0	[active]
       104. FluidSynth                                                  
            103. output_FL       > VT1708S Analog:playback_AUX0	[active]
            111. output_FR       > VT1708S Analog:playback_AUX1	[active]
       110. PulseAudio-Lautstärkeregler                                
            109. input_FL        < mpv:output_FL	[active]
            120. input_FR        < mpv:output_FR	[active]
            131. monitor_FL     
            145. monitor_FR     
       118. PulseAudio-Lautstärkeregler                                
            126. monitor_FL     
            128. input_FL        < FluidSynth:output_FL	[active]
            136. input_FR        < FluidSynth:output_FR	[active]
            140. monitor_FR     
       119. PulseAudio-Lautstärkeregler                                
            130. monitor_FR     
            137. input_FR        < FluidSynth:output_FR	[active]
            138. input_FL        < FluidSynth:output_FL	[active]
            139. monitor_FL     
       133. mpv                                                         
            106. output_FR       > PulseAudio-Lautstärkeregler:input_FR	[active]
            115. output_FL       > VT1708S Analog:playback_AUX0	[active]

Video
 ├─ Devices:
 │  
 ├─ Sinks:
 │  
 ├─ Sink endpoints:
 │  
 ├─ Sources:
 │  
 ├─ Source endpoints:
 │  
 └─ Streams:

Settings
 └─ Default Configured Node Names:
$ pactl list short source-outputs
431	47	430	PipeWire	float32le 1ch 25Hz
432	98	430	PipeWire	float32le 1ch 25Hz
433	99	430	PipeWire	float32le 1ch 25Hz
434	100	430	PipeWire	float32le 1ch 25Hz
459	4294967295	430	PipeWire	float32le 1ch 25Hz
460	4294967295	430	PipeWire	float32le 1ch 25Hz
512	4294967295	430	PipeWire	float32le 1ch 25Hz


$ pactl list short sources
47	alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor	PipeWire	s32le 2ch 48000Hz	IDLE
98	alsa_output.pci-0000_00_1b.0.pro-output-0.monitor	PipeWire	s32le 8ch 48000Hz	RUNNING
99	alsa_output.pci-0000_00_1b.0.pro-output-1.monitor	PipeWire	s32le 2ch 48000Hz	IDLE
100	alsa_input.pci-0000_00_1b.0.pro-input-0	PipeWire	s32le 2ch 48000Hz	RUNNING
$ pactl list short clients
32	PipeWire	pipewire
34	PipeWire	wireplumber
35	PipeWire	wireplumber
52	PipeWire	volumeicon
353	PipeWire	firefox-esr
399	PipeWire	vmpk
412	PipeWire	qsynth
429	PipeWire	qpwgraph
430	PipeWire	pavucontrol
506	PipeWire	mpv
523	PipeWire	pactl

System info:
antiX 23.1 full runit 64 bit (Live)

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 12 (bookworm)
Release:	12
Codename:	bookworm
$ uname -a
Linux birke 6.5.0-0.deb12.4-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.5.10-1~bpo12+1 (2023-11-23) x86_64 GNU/Linux

Please let me know if you need further information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant