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

Win 10 Sonic Pi No sound using bluetooth speakers #2781

Closed
xtramo opened this issue Jun 7, 2021 · 19 comments
Closed

Win 10 Sonic Pi No sound using bluetooth speakers #2781

xtramo opened this issue Jun 7, 2021 · 19 comments

Comments

@xtramo
Copy link

xtramo commented Jun 7, 2021

Hi
I recently replaced my pc with a new pc win 10 as well as reinstalled and tried sonic pi and now have no sound!?
I used Bluetooth speakers on my old pc and no issue - Im using the same speakers and can play music with them no issue but now sonic pi is dead?
When I run loops they show in the scope as playing but no music?
I need this to work with Bluetooth please help.
I uninstalled the new version of sonic pi and installed the older version to see if that helps but it made no difference.

@xtramo
Copy link
Author

xtramo commented Jun 7, 2021

when spi runs I have no audio output - I can run vlc player and there is no sound the minute I close spi there is sound again.

@ethancrawford
Copy link
Collaborator

ethancrawford commented Jun 8, 2021

Hello @xtramo 🙂

As mentioned on in_thread, please provide information from Sonic Pi's log files. (You can find these at C:\Users\[you]\.sonic-pi\log).
The most helpful parts to begin with might be scsynth.log or server-errors.log.

@xtramo
Copy link
Author

xtramo commented Jun 8, 2021

Starting SuperCollider 2021-06-07 20:18:14

Device options:

MME : Microsoft Sound Mapper - Input (device #0 with 2 ins 0 outs)
MME : Headset Microphone (JBL Flip 4 (device #1 with 1 ins 0 outs)
MME : Microsoft Sound Mapper - Output (device #2 with 0 ins 2 outs)
MME : Speakers (Realtek(R) Audio) (device #3 with 0 ins 8 outs)
MME : Headset Earphone (JBL Flip 4 Ha (device #4 with 0 ins 1 outs)
MME : Speakers (JBL Flip 4 Stereo) (device #5 with 0 ins 2 outs)
MME : Realtek Digital Output (Realtek (device #6 with 0 ins 2 outs)
Windows DirectSound : Primary Sound Capture Driver (device #7 with 2 ins 0 outs)
Windows DirectSound : Headset Microphone (JBL Flip 4 Hands-Free AG Audio) (device #8 with 1 ins 0 outs)
Windows DirectSound : Primary Sound Driver (device #9 with 0 ins 2 outs)
Windows DirectSound : Speakers (Realtek(R) Audio) (device #10 with 0 ins 8 outs)
Windows DirectSound : Headset Earphone (JBL Flip 4 Hands-Free AG Audio) (device #11 with 0 ins 1 outs)
Windows DirectSound : Speakers (JBL Flip 4 Stereo) (device #12 with 0 ins 2 outs)
Windows DirectSound : Realtek Digital Output (Realtek(R) Audio) (device #13 with 0 ins 2 outs)
ASIO : Realtek ASIO (device #14 with 2 ins 8 outs)
Windows WASAPI : Headset Earphone (JBL Flip 4 Hands-Free AG Audio) (device #15 with 0 ins 1 outs)
Windows WASAPI : Speakers (JBL Flip 4 Stereo) (device #16 with 0 ins 2 outs)
Windows WASAPI : Realtek Digital Output (Realtek(R) Audio) (device #17 with 0 ins 2 outs)
Windows WASAPI : Speakers (Realtek(R) Audio) (device #18 with 0 ins 2 outs)
Windows WASAPI : Headset Microphone (JBL Flip 4 Hands-Free AG Audio) (device #19 with 1 ins 0 outs)
Windows WDM-KS : SPDIF Out (Realtek HDA SPDIF Out) (device #20 with 0 ins 2 outs)
Windows WDM-KS : Stereo Mix (Realtek HD Audio Stereo input) (device #21 with 2 ins 0 outs)
Windows WDM-KS : Speakers (Realtek HD Audio output) (device #22 with 0 ins 8 outs)
Windows WDM-KS : Line In (Realtek HD Audio Line input) (device #23 with 2 ins 0 outs)
Windows WDM-KS : Microphone (Realtek HD Audio Mic input) (device #24 with 2 ins 0 outs)
Windows WDM-KS : Speakers () (device #25 with 0 ins 2 outs)
Windows WDM-KS : Headset Earphone (@System32\drivers\bthhfenum.sys,#2;%1 Hands-Free AG Audio%0

;(JBL Flip 4)) (device #26 with 0 ins 1 outs)

Windows WDM-KS : Headset Microphone (@System32\drivers\bthhfenum.sys,#2;%1 Hands-Free AG Audio%0

;(JBL Flip 4)) (device #27 with 1 ins 0 outs)

Windows WDM-KS : Headset (@System32\drivers\bthhfenum.sys,#2;%1 Hands-Free AG Audio%0

;(JOWAY H96)) (device #28 with 0 ins 1 outs)

Windows WDM-KS : Headset (@System32\drivers\bthhfenum.sys,#2;%1 Hands-Free AG Audio%0

;(JOWAY H96)) (device #29 with 1 ins 0 outs)

Windows WDM-KS : Headphones () (device #30 with 0 ins 2 outs)

Requested devices:
In:

(default)
Out:
(default)

Selecting default system input/output devices

Booting with:
In: MME : Headset Microphone (JBL Flip 4
Out: MME : Speakers (Realtek(R) Audio)
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.

@xtramo
Copy link
Author

xtramo commented Jun 8, 2021

server-errors is empty

@ethancrawford
Copy link
Collaborator

ethancrawford commented Jun 8, 2021

Continuing on from a discussion on in_thread, (https://in-thread.sonic-pi.net/t/no-sound-whatsoever/4586/10) it was mentioned that the computer popped up a seemingly new notification indicating that scsynth was using the microphone:
image

Thinking about it, this could be related.
@xtramo - what sample rates are your headset microphone and RealTek speakers running at?

@ethancrawford
Copy link
Collaborator

ethancrawford commented Jun 8, 2021

Oh yes, right. You want to get Sonic Pi to use the bluetooth speakers 😅
So, the way to do that is by editing the audio config file at C:\Users\[you]\.sonic-pi\config\audio-settings.toml, and telling Sonic Pi which audio device to use by uncommenting the line that says:

# sound_card_name = ""

...by removing the #, and adding in a bit of text that matches your preferred audio device. (So in this case, you could try):

sound_card_name = "Headset"

Or maybe,

sound_card_name = "JBL Flip 4"

That's at least a step in the right direction 🙂

@ethancrawford
Copy link
Collaborator

Let us know how that goes 👍
@samaaron - do you have any further advice about this?

@xtramo
Copy link
Author

xtramo commented Jun 8, 2021

scsynth.log

audio-settings.zip
didnt work - but at least this time I could still hear my music from vlc player while spi was open.

@ethancrawford
Copy link
Collaborator

ethancrawford commented Jun 9, 2021

From the audio settings file, I see you tried "Headset Microphone (JBL Flip 4 Hands-Free AG Audio)".
There's a chance I misunderstand it, but as far as I know, the text you write there is what Sonic Pi uses to try to find both the input and output devices. See here in the result in scsynth.log where scsynth (AKA Supercollider server, AKA Sonic Pi's sound engine tries to connect to both an input and output device whose names contain all of those words):

Requested devices:
  In (matching device found):
  - Headset Microphone (JBL Flip 4 Hands-Free AG Audio)
  Out (matching device NOT found):
  - Headset Microphone (JBL Flip 4 Hands-Free AG Audio)

Notice that although there is an input device that matches the text you wrote in the audio settings, there isn't any output device that matches all of those words.

Did you try any of the exact suggestions I talked about above? The first one might get sound working in both your headset mic and headphones, the second possibly in both the headset microphone and external Bluetooth speakers.

@xtramo
Copy link
Author

xtramo commented Jun 10, 2021

this is sooooo frustrating?
i plugged in my mobile headphones no bluetooth and still no audio from sonic pi?
ive commented back the

sound_card_name = "Headset Microphone (JBL Flip 4 Hands-Free AG Audio)"

sound_card_sample_rate = 44100

sound_card_buffer_size = 64

num_inputs = 16

num_outputs = 16

ive no idea what to do but your feedback hasnt helped!

@ethancrawford
Copy link
Collaborator

ethancrawford commented Jun 10, 2021

Sure. Troubleshooting can be slow and awkward - particularly done remotely here through GitHub.

Windows audio driver setup is a challenging thing - and to a certain extent we're also at the mercy of the Supercollider server (ie, the third party tool that we use as Sonic Pi's sound engine and have no direct control over).

When you commented out any changes to audio-settings.toml, I take it you restarted Sonic Pi before trying to play audio with wired headphones? What if you also temporarily disable bluetooth beforehand?

My instinct is that it's a configuration setting of some kind that needs to be changed somewhere. Exactly what, I am not sure, but fortunately there are things to try, and other people that also have ideas. I'm pretty sure that there is a solution within reach.

@ethancrawford
Copy link
Collaborator

I've asked @xavriley if he has any advice to share 🙂

@samaaron
Copy link
Collaborator

I think an issue here is that I'm not sure any of the main Sonic Pi developers use Bluetooth speakers on a Windows system. I certainly have never tried it. I've only ever used Bluetooth audio on macOS in the past.

Hopefully it should just be a matter of putting the right values into audio-settings.toml but without a working Bluetooth/Windows setup it's really hard to be of any instant help.

I hope that we manage to get to the bottom of it...

@xtramo
Copy link
Author

xtramo commented Jun 10, 2021

Its really weird - my previous pc also win 10 never had this issue. it crashed about 2 weeks ago and got this new win 10 pro pc i7 loaded sonic pi and then this issue?
it works without blt speakers but i dont use headphones that often find them a nuisance when working.

@ethancrawford
Copy link
Collaborator

ethancrawford commented Jun 10, 2021

@xtramo - thanks, fair enough. Maybe it's something different about the low level drivers on the new PC somewhere.
Also to just double check - You mention 'your feedback hasnt helped!'. Bear with me, but which feedback? (I'm still not sure whether you tried either of the two suggestions I made above for audio-settings.toml. The one that I hoped would get closest to what you want was):

sound_card_name = "JBL Flip 4"

(Since there are both input and output devices that would match that string).

@ethancrawford
Copy link
Collaborator

ethancrawford commented Jun 10, 2021

There might be a few clues here, but it's saying mostly stuff I already know:
https://doc.sccode.org/Reference/AudioDeviceSelection.html
A few important notes like partial device name matching is available on Windows (which is why I was hoping sound_card_name = "JBL Flip 4" would match both an appropriate input and output device), and the Windows sound API (ie MME, DirectSound, WASAPI or WDM-KS) must match between the selected input and output devices. Also the important note that 'both input and output device should use the same sample rate (although some APIs might provide resampling). This can be set in Windows's Audio Control Panel'.

@ethancrawford
Copy link
Collaborator

(These are not strictly bluetooth specific points, but still important).

@xtramo
Copy link
Author

xtramo commented Jun 10, 2021

Hi Ethan
appreciate your help!
Ok the name I saw now on my audio was both the one you mentioned above which didn't work and this 2- JBL Flip 4 Stereo. 2 options for the same device.
I put this in the audio settings file and it works! what a mission.
Hope this helps other spi users - note dont use the ( braces before and after the speaker name in the toml file.

@ethancrawford
Copy link
Collaborator

Brilliant!
So glad it's working for you 😄
You're welcome!
I'll close this ticket for now, since your particular problem is solved. Others with the same problem can always search closed issues 👍
Enjoy!

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

No branches or pull requests

3 participants