I have two outputs?! Headphones and speakers... :sound_out

Windows 11 has the ability to map apps to devices
(although I’m struggling to find the option to toggle device-mixer that I thought I had, maybe on win 10, with a volume slider per app, and a dropdown to switch device, in a classic control panel, IIRC)

With SonicPi, due to SuperCollider, an application restart is required after a hardware change, like plugging in headphones.

If you do this:

  1. open sonicpi, play a sample (on speakers, no headphones in)
  2. plug in headphones, go to sounds, make noises using headphones (in other windows apps, or volume-slider at least)
  3. go back to sonic-pi, and the sounds are still playing.

This is a bit of a revelation as years ago on windows 7 I’d tried to do this, but thought “it’s just one audiobus”.

I’ve tried to make the :sound_out work, but I think the audio_settings need to be configured.

Looking at the sound device properties they have friendly names like “Speakers” and “Headphones”

image
and both have the same controller info

:question:Can I target Speakers / Headphones using :sound_out ?

Conversely, the “other” audio device in my laptop (device manager) is the Intel Display Audio.

image


audio-settings.toml

Previously I tried to do the same switching / setting output to my bluetooth headphones, but that didn’t work

Currently I have these settings (Just increased num_outputs to 4, but now no sound out):

sound_card_name = "Conexant ISST Audio"
sound_card_sample_rate = 48000
sound_card_buffer_size = 64
# num_inputs = 16
 num_outputs = 4

The Hardware ID’s listed from devmgmt are

INTELAUDIO\FUNC_01&VEN_14F1&DEV_50F4&SUBSYS_103C80FD&REV_1001
INTELAUDIO\FUNC_01&VEN_14F1&DEV_50F4&SUBSYS_103C80FD

Compatible ID’s

INTELAUDIO\FUNC_01&VEN_14F1&DEV_50F4&REV_1001
INTELAUDIO\FUNC_01&VEN_14F1&DEV_50F4
INTELAUDIO\FUNC_01&VEN_14F1
INTELAUDIO\FUNC_01

Hopefully a) this is achievable and b) that’s enough info!

Progress: Found another user troubleshooting similar query whilst searching for audio-settings.toml, they were struggling with the names to use too - looks like I guessed that bit right :+1:t2:

Checking prefs with my mentioned settings the requested samplerate is seen, and a device matching the name provided is set on input and output
image

commenting out my soundcard settings and restarting the defaults are seen
image

Reviewing %userprofile%\.sonic-pi\log\scsynth.log I find device id’s
etc…

Can different devices be targetted with :sound_out or any other sonic_pi method (command/synth/fx/config) ?


Device options:
  - MME : Microsoft Sound Mapper - Input   (device #0 with 2 ins 0 outs)
  - MME : Internal Microphone (Conexant I   (device #1 with 2 ins 0 outs)
  - MME : Stereo Mix (Conexant ISST Audio   (device #2 with 2 ins 0 outs)
  - MME : Microsoft Sound Mapper - Output   (device #3 with 0 ins 2 outs)
  - MME : Headphones (Conexant ISST Audio   (device #4 with 0 ins 2 outs)
  - MME : Speakers (Conexant ISST Audio)   (device #5 with 0 ins 6 outs)
  - Windows DirectSound : Primary Sound Capture Driver   (device #6 with 2 ins 0 outs)
  - Windows DirectSound : Internal Microphone (Conexant ISST Audio)   (device #7 with 2 ins 0 outs)
  - Windows DirectSound : Stereo Mix (Conexant ISST Audio)   (device #8 with 2 ins 0 outs)
  - Windows DirectSound : Primary Sound Driver   (device #9 with 0 ins 2 outs)
  - Windows DirectSound : Headphones (Conexant ISST Audio)   (device #10 with 0 ins 2 outs)
  - Windows DirectSound : Speakers (Conexant ISST Audio)   (device #11 with 0 ins 6 outs)
  - Windows WASAPI : Speakers (Conexant ISST Audio)   (device #12 with 0 ins 2 outs)
  - Windows WASAPI : Headphones (Conexant ISST Audio)   (device #13 with 0 ins 2 outs)
  - Windows WASAPI : Stereo Mix (Conexant ISST Audio)   (device #14 with 2 ins 0 outs)
  - Windows WASAPI : Internal Microphone (Conexant ISST Audio)   (device #15 with 2 ins 0 outs)
  - Windows WDM-KS : Headphones (Conexant ISST Audio headphone)   (device #16 with 0 ins 2 outs)
  - Windows WDM-KS : Microphone Array (Conexant ISST Audio capture)   (device #17 with 2 ins 0 outs)
  - Windows WDM-KS : Stereo Mix (Conexant ISST Stereo Mix)   (device #18 with 2 ins 0 outs)
  - Windows WDM-KS : Output 1 (Conexant ISST Audio output)   (device #19 with 0 ins 2 outs)
  - Windows WDM-KS : Output 2 (Conexant ISST Audio output)   (device #20 with 0 ins 6 outs)
  - Windows WDM-KS : Input (Conexant ISST Audio output)   (device #21 with 2 ins 0 outs)

Requested devices:
  In (matching device found):
  - Conexant ISST Audio
  Out (matching device found):
  - Conexant ISST Audio


Booting with:
  In: MME : Stereo Mix (Conexant ISST Audio
  Out: MME : Headphones (Conexant ISST Audio
  Sample rate: 48000.000
  Latency (in/out): 0.001 / 0.001 sec
SC_AudioDriver: sample rate = 48000.000000, driver's block size = 64
SuperCollider 3 server ready.

Thanks to the link mentioned by @ethancrawford (on GH) I see this is a question about aggregate devices, the common solution on windows is ASIO4ALL

Aggregate device

Audio device selection | SuperCollider 3.12.2 Help (sccode.org)

Sometimes you might want to use multiple devices for input or output. macOS provides a way to combine multiple physical devices into a virtual Aggregate Device. To create one, you have to open the Audio MIDI Setup application (in /Applications/Utilities). You should do this from an user account with administrator privileges.

Testing with flexaudio (recommended elsewhere) … stumped. thwarted. sigh.

Maybe with a Mac, apparrently not even with VAC.

Suspect this may not be possible, for reasons not yet known.

In ASIO4ALL I can configure both outputs
image

Adding sound_card_name = "ASIO4ALL" to audio-settings.toml and then launching sonicpi, the log suggests the config may work

Device options (4 outs shown, previously only 2):
- ASIO : ASIO4ALL v2 (device #16 with 2 ins 4 outs)

Requested devices:
  In (matching device found):
  - ASIO4ALL
  Out (matching device found):
  - ASIO4ALL


Booting with:
  In: ASIO : ASIO4ALL v2
  Out: ASIO : ASIO4ALL v2
  Sample rate: 44100.000
  Latency (in/out): 0.014 / 0.014 sec
SC_AudioDriver: sample rate = 44100.000000, driver's block size = 64
SuperCollider 3 server ready.
late 0.190413475
late 0.054649830
late 0.093160629
late 0.079569817
late 0.143821239
late 0.113634586
late 0.186840534
late 0.126227379
late 0.127474785
late 0.167156219

I was just about to confirm same issue, only headphones sound… but I’ve just given myself my second biggest sonic-pi-shock to date, when test succeeded, and :glitch_bass_g came blasting out stereo: 3 .

I think we have reached a milestone!

Resting Retesting!..

test success as