Hello there,
I think this issue maybe doesn’t belong strictly to Sonic Pi, but I need to ask about anyway. I’m trying to figure how to set the audio output to the headphones instead of speakers.
I’m using Linux, and a Flatpak version of Sonic Pi (4.6.0). The audio is running well but through the speakers instead of headphones (cable, mini-jack connected headphones). Pipewire + pulse + Jack work fine with the headphones for the rest of the apps in the system (Firefox + Internet audio, other apps outputting audio, etc).
I was considering that maybe has something to do with SuperCollider’s configuration, because if I leave SC on defaults, this is what I see on the log:
But if I try to set the audio card at “audio-settings.toml”, then SC does not output any sound at all. If anyone has fight on a similar scenario, any help is more than welcome
Thanks in advance, Ibon.
It would be helpful to know exactly what settings you tried in that file (and also what the Sonic Pi logs output when you do) - although it’s probably preferred that you raise an issue on GitHub to continue this…
Thanks Ethan because in fact, looking to already opened issues I’ve found this from 2024:
opened 04:00PM - 13 Sep 24 UTC
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:
``` 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"
```
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"
```
The issuer mentions this helpful tool GitHub - rncbc/qpwgraph: qpwgraph - A PipeWire Graph Qt GUI Interface that I’ve tried, and has solved the issue: thanks to the tool I can “disconnect” the SuperColliders default output device (speakers) and connect it to my preferred one (the headphones).
I have added a comment on the Github issue with a little screenshot of what I see on it.
I can workaround this matter using that tool, but it would be great to know how to finally solve it without using such an external tool. I’m willing to help on this if you agree