sonic-pi-net / sonic-pi

Code. Music. Live.
https://sonic-pi.net
Other
10.84k stars 923 forks source link

Change output device in Linux #3419

Open igorgue opened 2 months ago

igorgue commented 2 months ago

I'm having a problem that sonic-pi only outputs to the first interface in the pw-cli list-objects Node [1] list.

In this case it'd be id 50, but that doesn't sound on my Nvidia card, I need it on HDA NVidia HDMI / DisplayPort 1 Output instead:

        object.serial = "50"
        object.path = "alsa:pcm:0:hw:NVidia,9:playback"
        factory.id = "18"
        client.id = "42"
        device.id = "44"
        priority.session = "600"
        priority.driver = "600"
        node.description = "HDA NVidia HDMI / DisplayPort 4 Output"
        node.name = "alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_9__sink"
        node.nick = "HDMI 3"
        media.class = "Audio/Sink"

But I actually need id 53, type PipeWire:Interface:Node/3

    id 53, type PipeWire:Interface:Node/3
        object.serial = "53"
        object.path = "alsa:pcm:0:hw:NVidia,3:playback"
        factory.id = "18"
        client.id = "42"
        device.id = "44"
        priority.session = "696"
        priority.driver = "696"
        node.description = "HDA NVidia HDMI / DisplayPort 1 Output"
        node.name = "alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_3__sink"
        node.nick = "DELL U2518D"
        media.class = "Audio/Sink"

I tried to edit ~/.sonic-pi/config/audio-settings.toml and change sound_card_name = "hw:NVidia,3" and it doesn't work, same goes with output_sound_card_name = "hw:NVidia,3" it shows an error on the screen to look at this log:

Found 0 LADSPA plugins
could not initialize audio.
terminate called without an active exception

But it's not that useful, I can only hear Sonic Pi from the builtin speakers.

Here's the output of pactl as well:

 >>> pactl list short sinks                                 ~ 
50  alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_9__sink    PipeWire    s32le 2ch 48000Hz   SUSPENDED
51  alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_8__sink    PipeWire    s32le 2ch 48000Hz   SUSPENDED
52  alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_7__sink    PipeWire    s32le 2ch 48000Hz   SUSPENDED
53  alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_3__sink    PipeWire    s32le 2ch 48000Hz   SUSPENDED
56  alsa_output.pci-0000_65_00.6.HiFi__hw_Generic_1__sink   PipeWire    s32le 2ch 48000Hz   SUSPENDED
 >>> pactl info                                                                                                                                                                                ~ 
Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 952
Tile Size: 65472
User Name: igor
Host Name: igorlaptop
Server Name: PulseAudio (on PipeWire 1.0.7)
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_3__sink
Default Source: alsa_input.pci-0000_65_00.6.HiFi__hw_Generic_1__source
Cookie: 13ae:4e2a

[1]:

$ pw-cli list-objects Node

    id 30, type PipeWire:Interface:Node/3
        object.serial = "30"
        factory.id = "10"
        priority.driver = "20000"
        node.name = "Dummy-Driver"
    id 31, type PipeWire:Interface:Node/3
        object.serial = "31"
        factory.id = "10"
        priority.driver = "19000"
        node.name = "Freewheel-Driver"
    id 47, type PipeWire:Interface:Node/3
        object.serial = "47"
        factory.id = "10"
        client.id = "42"
        priority.session = "100"
        priority.driver = "1"
        node.name = "Midi-Bridge"
        media.class = "Midi/Bridge"
    id 50, type PipeWire:Interface:Node/3
        object.serial = "50"
        object.path = "alsa:pcm:0:hw:NVidia,9:playback"
        factory.id = "18"
        client.id = "42"
        device.id = "44"
        priority.session = "600"
        priority.driver = "600"
        node.description = "HDA NVidia HDMI / DisplayPort 4 Output"
        node.name = "alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_9__sink"
        node.nick = "HDMI 3"
        media.class = "Audio/Sink"
    id 51, type PipeWire:Interface:Node/3
        object.serial = "51"
        object.path = "alsa:pcm:0:hw:NVidia,8:playback"
        factory.id = "18"
        client.id = "42"
        device.id = "44"
        priority.session = "616"
        priority.driver = "616"
        node.description = "HDA NVidia HDMI / DisplayPort 3 Output"
        node.name = "alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_8__sink"
        node.nick = "HDMI 2"
        media.class = "Audio/Sink"
    id 52, type PipeWire:Interface:Node/3
        object.serial = "52"
        object.path = "alsa:pcm:0:hw:NVidia,7:playback"
        factory.id = "18"
        client.id = "42"
        device.id = "44"
        priority.session = "632"
        priority.driver = "632"
        node.description = "HDA NVidia HDMI / DisplayPort 2 Output"
        node.name = "alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_7__sink"
        node.nick = "HDMI 1"
        media.class = "Audio/Sink"
    id 53, type PipeWire:Interface:Node/3
        object.serial = "53"
        object.path = "alsa:pcm:0:hw:NVidia,3:playback"
        factory.id = "18"
        client.id = "42"
        device.id = "44"
        priority.session = "696"
        priority.driver = "696"
        node.description = "HDA NVidia HDMI / DisplayPort 1 Output"
        node.name = "alsa_output.pci-0000_01_00.1.HiFi__hw_NVidia_3__sink"
        node.nick = "DELL U2518D"
        media.class = "Audio/Sink"
    id 56, type PipeWire:Interface:Node/3
        object.serial = "56"
        object.path = "alsa:pcm:2:hw:Generic_1:playback"
        factory.id = "18"
        client.id = "42"
        device.id = "46"
        priority.session = "1000"
        priority.driver = "1000"
        node.description = "Family 17h/19h HD Audio Controller Speaker + Headphones"
        node.name = "alsa_output.pci-0000_65_00.6.HiFi__hw_Generic_1__sink"
        node.nick = "ALC298 Analog"
        media.class = "Audio/Sink"
    id 57, type PipeWire:Interface:Node/3
        object.serial = "57"
        object.path = "alsa:pcm:2:hw:Generic_1:capture"
        factory.id = "18"
        client.id = "42"
        device.id = "46"
        priority.session = "2000"
        priority.driver = "2000"
        node.description = "Family 17h/19h HD Audio Controller Headphones Stereo Microphone"
        node.name = "alsa_input.pci-0000_65_00.6.HiFi__hw_Generic_1__source"
        node.nick = "ALC298 Analog"
        media.class = "Audio/Source"
    id 58, type PipeWire:Interface:Node/3
        object.serial = "58"
        object.path = "alsa:pcm:2:hw:acp63:capture"
        factory.id = "18"
        client.id = "42"
        device.id = "46"
        priority.session = "2000"
        priority.driver = "2000"
        node.description = "Family 17h/19h HD Audio Controller Digital Microphone"
        node.name = "alsa_input.pci-0000_65_00.6.HiFi__hw_acp63__source"
        node.nick = "Digital Microphone"
        media.class = "Audio/Source"
    id 60, type PipeWire:Interface:Node/3
        object.serial = "60"
        factory.id = "13"
        client.id = "42"
        node.description = "BLE MIDI 1"
        node.name = "bluez_midi.server"
        media.class = "Midi/Bridge"
    id 90, type PipeWire:Interface:Node/3
        object.serial = "92"
        object.path = "v4l2:/dev/video0"
        factory.id = "10"
        client.id = "42"
        device.id = "55"
        priority.session = "1000"
        node.description = "Integrated RGB Camera (V4L2)"
        node.name = "v4l2_input.pci-0000_65_00.4-usb-0_1_1.0"
        node.nick = "Integrated RGB Camera"
        media.class = "Video/Source"
        media.role = "Camera"
    id 92, type PipeWire:Interface:Node/3
        object.serial = "94"
        object.path = "v4l2:/dev/video2"
        factory.id = "10"
        client.id = "42"
        device.id = "63"
        priority.session = "980"
        node.description = "Integrated RGB Camera (V4L2)"
        node.name = "v4l2_input.pci-0000_65_00.4-usb-0_1_1.2"
        node.nick = "Integrated RGB Camera"
        media.class = "Video/Source"
        media.role = "Camera"
    id 153, type PipeWire:Interface:Node/3
        object.serial = "283"
        factory.id = "6"
        client.id = "97"
        client.api = "pipewire-pulse"
        application.name = "Firefox"
        node.name = "Firefox"
        media.class = "Stream/Output/Audio"
igorgue commented 2 months ago

Looks like the only way I can do it is with qpwgraph and dragging the input from Supercollider into the right output, would be cool to configure it though