sonic-pi-net / sonic-pi

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

Synth sound_in only working with default mic #2157

Open saturnation opened 5 years ago

saturnation commented 5 years ago

I'm using a RockSmith real tone cable to connect my midi synth to my computer and using Sonic Pi to send midi events to the synth.

If the RockSmith cable is not set as the default mic then I sound_in's input parameter can't 'find' the input. It only seems to be able to find whatever mic is default. So when it's not default, input 1 and 2 pick up the left and right channel of the built in mic. 3, 4 and 5 don't pick up anything. But when it is default then 1 picks it up, but 2 or 3 can't find the mic.

scsynth log when RockSmith is set as default

# Starting SuperCollider 2019-11-04 16:19:38

Device options:
  - MME : Microsoft Sound Mapper - Input   (device #0 with 2 ins 0 outs)
  - MME : Microphone (Rocksmith USB Guita   (device #1 with 1 ins 0 outs)
  - MME : Microphone (Cirrus Logic CS4206   (device #2 with 2 ins 0 outs)
  - MME : Microsoft Sound Mapper - Output   (device #3 with 0 ins 2 outs)
  - MME : Headphones (Cirrus Logic CS4206   (device #4 with 0 ins 2 outs)
  - MME : Speakers (Cirrus Logic CS4206B    (device #5 with 0 ins 2 outs)
  - MME : Digital Audio (S/PDIF) (Cirrus    (device #6 with 0 ins 2 outs)
  - Windows DirectSound : Primary Sound Capture Driver   (device #7 with 2 ins 0 outs)
  - Windows DirectSound : Microphone (Rocksmith USB Guitar Adapter)   (device #8 with 1 ins 0 outs)
  - Windows DirectSound : Microphone (Cirrus Logic CS4206B (AB 06))   (device #9 with 2 ins 0 outs)
  - Windows DirectSound : Primary Sound Driver   (device #10 with 0 ins 2 outs)
  - Windows DirectSound : Headphones (Cirrus Logic CS4206B (AB 06))   (device #11 with 0 ins 2 outs)
  - Windows DirectSound : Speakers (Cirrus Logic CS4206B (AB 06))   (device #12 with 0 ins 2 outs)
  - Windows DirectSound : Digital Audio (S/PDIF) (Cirrus Logic CS4206B (AB 06))   (device #13 with 0 ins 2 outs)
  - Windows WASAPI : Headphones (Cirrus Logic CS4206B (AB 06))   (device #14 with 0 ins 2 outs)
  - Windows WASAPI : Speakers (Cirrus Logic CS4206B (AB 06))   (device #15 with 0 ins 2 outs)
  - Windows WASAPI : Digital Audio (S/PDIF) (Cirrus Logic CS4206B (AB 06))   (device #16 with 0 ins 2 outs)
  - Windows WASAPI : Microphone (Cirrus Logic CS4206B (AB 06))   (device #17 with 2 ins 0 outs)
  - Windows WASAPI : Microphone (Rocksmith USB Guitar Adapter)   (device #18 with 1 ins 0 outs)
  - Windows WDM-KS : Headphones (HD Audio Headphone)   (device #19 with 0 ins 2 outs)
  - Windows WDM-KS : Microphone (HD Audio Microphone)   (device #20 with 2 ins 0 outs)
  - Windows WDM-KS : SPDIF Out (HD Audio SPDIF out)   (device #21 with 0 ins 2 outs)
  - Windows WDM-KS : Speakers (HD Audio Speaker)   (device #22 with 0 ins 2 outs)
  - Windows WDM-KS : CABLE Output (VB-Audio Point)   (device #23 with 8 ins 0 outs)
  - Windows WDM-KS : Speakers (VB-Audio Point)   (device #24 with 0 ins 8 outs)
  - Windows WDM-KS : Microphone (Rocksmith USB Guitar Adapter)   (device #25 with 1 ins 0 outs)

Booting with:
  In: MME : Microphone (Rocksmith USB Guita
  Out: MME : Headphones (Cirrus Logic CS4206
  Sample rate: 44100.000
  Latency (in/out): 0.013 / 0.091 sec
SC_AudioDriver: sample rate = 44100.000000, driver's block size = 64
SuperCollider 3 server ready.
FAILURE IN SERVER /n_free Node 66 not found

and when not default

# Starting SuperCollider 2019-11-04 16:08:01

Device options:
  - MME : Microsoft Sound Mapper - Input   (device #0 with 2 ins 0 outs)
  - MME : Microphone (Cirrus Logic CS4206   (device #1 with 2 ins 0 outs)
  - MME : Microphone (Rocksmith USB Guita   (device #2 with 1 ins 0 outs)
  - MME : Microsoft Sound Mapper - Output   (device #3 with 0 ins 2 outs)
  - MME : Headphones (Cirrus Logic CS4206   (device #4 with 0 ins 2 outs)
  - MME : Speakers (Cirrus Logic CS4206B    (device #5 with 0 ins 2 outs)
  - MME : Digital Audio (S/PDIF) (Cirrus    (device #6 with 0 ins 2 outs)
  - Windows DirectSound : Primary Sound Capture Driver   (device #7 with 2 ins 0 outs)
  - Windows DirectSound : Microphone (Cirrus Logic CS4206B (AB 06))   (device #8 with 2 ins 0 outs)
  - Windows DirectSound : Microphone (Rocksmith USB Guitar Adapter)   (device #9 with 1 ins 0 outs)
  - Windows DirectSound : Primary Sound Driver   (device #10 with 0 ins 2 outs)
  - Windows DirectSound : Headphones (Cirrus Logic CS4206B (AB 06))   (device #11 with 0 ins 2 outs)
  - Windows DirectSound : Speakers (Cirrus Logic CS4206B (AB 06))   (device #12 with 0 ins 2 outs)
  - Windows DirectSound : Digital Audio (S/PDIF) (Cirrus Logic CS4206B (AB 06))   (device #13 with 0 ins 2 outs)
  - Windows WASAPI : Headphones (Cirrus Logic CS4206B (AB 06))   (device #14 with 0 ins 2 outs)
  - Windows WASAPI : Speakers (Cirrus Logic CS4206B (AB 06))   (device #15 with 0 ins 2 outs)
  - Windows WASAPI : Digital Audio (S/PDIF) (Cirrus Logic CS4206B (AB 06))   (device #16 with 0 ins 2 outs)
  - Windows WASAPI : Microphone (Cirrus Logic CS4206B (AB 06))   (device #17 with 2 ins 0 outs)
  - Windows WASAPI : Microphone (Rocksmith USB Guitar Adapter)   (device #18 with 1 ins 0 outs)
  - Windows WDM-KS : Headphones (HD Audio Headphone)   (device #19 with 0 ins 2 outs)
  - Windows WDM-KS : Microphone (HD Audio Microphone)   (device #20 with 2 ins 0 outs)
  - Windows WDM-KS : SPDIF Out (HD Audio SPDIF out)   (device #21 with 0 ins 2 outs)
  - Windows WDM-KS : Speakers (HD Audio Speaker)   (device #22 with 0 ins 2 outs)
  - Windows WDM-KS : CABLE Output (VB-Audio Point)   (device #23 with 8 ins 0 outs)
  - Windows WDM-KS : Speakers (VB-Audio Point)   (device #24 with 0 ins 8 outs)
  - Windows WDM-KS : Microphone (Rocksmith USB Guitar Adapter)   (device #25 with 1 ins 0 outs)

Booting with:
  In: MME : Microphone (Cirrus Logic CS4206
  Out: MME : Headphones (Cirrus Logic CS4206
  Sample rate: 44100.000
  Latency (in/out): 0.013 / 0.091 sec
SC_AudioDriver: sample rate = 44100.000000, driver's block size = 64
SuperCollider 3 server ready.
FAILURE IN SERVER /n_free Node 625 not found
FAILURE IN SERVER /n_free Node 643 not found
FAILURE IN SERVER /n_free Node 657 not found
ibz commented 3 years ago

I can confirm, I have this issue on Linux as well. And since I can't seem to find a way to change the default ALSA capture device, it means I can't use an external mic. :(

Is this a known limitation?

lilyinstarlight commented 3 years ago

@ibz As a potential workaround, if you start a JACK server with QJackCtl instead of letting Sonic Pi start one itself you can select different default input/output devices under Setup (button on main QJackCtl window) -> Settings (tab at top) -> Advanced (tab under presets). I think both devices will need to support common sample rates, but if so that might let you use a different capture device with sound_in

It is likely QJackCtl was already installed when you installed Sonic Pi, but if not it should be available to install from your distro's repository

ibz commented 3 years ago

@lilyinstarlight indeed, I did that and it works! Thanks!

So basically Sonic Pi uses whatever the system provides as default. And in the case of Linux, it is JACK rather than ALSA that sits directly under Sonic Pi.

Now, it would be of course nice if it was possible to select inputs/outputs in Sonic Pi directly, but that's another story.

ethancrawford commented 3 years ago

@ibz we're hopefully adding that in the not too distant future 🙂