vrubleg/soundkeeper

bluetooth headset works with Primary but not with All

phpmoli opened this issue · 14 comments

I have a bluetooth headset which soft-disconnects from windows (bluetooth settings still shows "Connected" but not showing "Connected voice, music" anymore, and no sound is played through the headset until a power-recycle) after 6 SECONDS! Unbelivable. You finish watching a youtube video, and really dont have time to start another one.

Soundkeeper helps fixing that, even with the OpenOnly setting, but All does not work, i have to use Primary.

You asked for logs using the debug version, please see attached.

soundkeeper-debug-Acme_BH203-openonly-primary.log
soundkeeper-debug-Acme_BH203-openonly-all.log
soundkeeper-debug-Acme_BH203-openonly-analog.log
soundkeeper-debug-Acme_BH203-white-primary.log
soundkeeper-debug-Acme_BH203-white-all.log
soundkeeper-debug-Acme_BH203-white-analog.log

measurement method:

  1. using administrator powershell
  2. powering off the bluetooth headset
  3. waiting ~10 seconds
  4. executing soundkeeper
  5. waiting ~10 seconds
  6. powering on bluetooth headset
  7. waiting ~20 seconds
  8. killing soundkeeper

Didn't notice anything unexpected in the logs. At this moment I have no idea what could go wrong.

Can you try the same experiment, but with with SineF1000A10? It will make an audible sine so you will able to hear when Sound Keeper tries to render something on that particular audio output. Does it actually produce any sound on that Bluetooth output?

That's why i tried the White argument, to hear, what's happening. I heard the white noise for the first few seconds, then when the "can-you-believe-sleeps-after-6-seconds"-thing happens (actually a little bit more, 8-10 seconds, when this happens, there are device loss(?)/reconnect(?) lines in the log), the white noise disappears, and nothing can be heard on that bluetooth headset anymore, till the end of times, until a power-recycle.

It this enough info, or do i need to test with the sine?

White is fine too, just wanted to make sure that you heard anything before the device was turned off by the system.

Well, this is really weird. All basically means that Sound Keeper runs as many threads as amount of active audio outputs that you have. Primary means that only one thread with the same code is running, for the current default output only.

This time noticed some unusual stuff. For example, you have a device {0.0.1.00000000}.{ee0b857b-2329-494d-96f2-94926c767ccc}. It is WASAPI identifier of a device, and before this I saw only {0.0.0.00000000} as the first part, I even thought to trim this part because it is usually the same. Now I wonder what it could mean for the system.

Could you please share the full list of your audio devices? Can you try to disable as many audio outputs as possible, keeping the required one only, and checking if it affects the issue anyhow? Maybe there are some limitations like "when this audio device is used, another device can't be used, because they share some resources". In this case disabling all the devices except the primary one should make All working. If it is the case, try to re-enable disabled audio devices back one by one, until you find the device that causes issues.

I probably need to add output of audio device names in the log to make it easier to interpret =)

You can conveniently enable and disable audio outputs from the Sound Control Panel:

image

I disabled all the devices, i could without losing the audio (took me several reboots to try)

  • speakers
  • realtek digital output
  • frontmic
  • microphone
  • line in
  • stereo mix
  • amd high definition audio device
  • amd streaming audio device
  • 2x display monitor audio devices (i lost their names, as their parent devices are disabled now)

What i could not disable without affecting audio:

  • realtek high definition audio (i guess it is the "sound card", i dont understand why it does not have "sound card/sound chip" in it's name then..)

I deleted all the bluetooth devices too. When i re-pair the bad headphone, it creates 3 devices:

  • headset (BH203 hands-free ag audio) - this is shown on the playback tab
  • headset (BH203 hands-free ag audio) - this is shown on the recording tab
  • headphones (BH203 stereo)

To my knowledge, all bluetooth headsets are like this.

Now when all these 3 are enabled, and soundkeeper is not running, and music is playing, and i power on the headphone, i hear the music alright.

When all these 3 are enabled, and soundkeeper is running, and music is playing, and i power on the headphone, i do not hear music, but the VU-meter shows the music playing on headphones (BH203 stereo) device. And after "6" seconds all 3 devices go "disconnected" in the "sound" control panel interface.

When only headphones (BH203 stereo) is enabled, and the 2 headset (BH203 hands-free ag audio) devices are disabled, and soundkeeper is running, and music is playing, and i power on the headphone, i hear the music alright forever good. When i enable the headset (BH203 hands-free ag audio) - this is shown on the playback tab the audio stops, but the VU-meter shows the music playing on headphones (BH203 stereo). If i disable the headset (BH203 hands-free ag audio) - this is shown on the playback tab the audio resumes.

I am attaching a log. Events:

  1. using powershell with admin privileges
  2. remove headphone device
  3. stop soundkeeper
  4. power off headphone
  5. start soundkeeper @10:20
  6. power on headphone
  7. re-pair headphone @10:31
  8. i hear the music playing for 0.1 seconds at about 10:33
  9. music stops playing
  10. disabling headset (BH203 hands-free ag audio) - this is shown on the playback tab @10:53
  11. i hear music
  12. enabling headset (BH203 hands-free ag audio) - this is shown on the playback tab @11:15
  13. audio stops

soundkeeper-debug-Acme_BH203-sine-all-devices.log

(is it maybe, when something is playing on both the headphones and the headset device the same time, the headset/driver/windows/? decides, that i want to hear the headset , and so i do not hear the music what is shown playing on the headphone's VU-meter? But i do not hear the sine neither... And doesnt this decision switch the primary playback device onto the headset? Because Chrome still plays on the headphone )

You could just disable audio outputs in the dialog that I posted on a screenshot. You can disable all of them and enable them back quickly without reboots there.

But i do not hear the sine neither...

11:10:20.625 [ 2720] Command Line: SineF1000A10 All.
11:10:20.625 [ 2720] Device Type: All.
11:10:20.625 [ 2720] Stream Type: Sine (Frequency: 1000.000Hz; Amplitude: 0.000%; Fading: 0.100s).

There is a bug in parsing parameters (that I will fix). You should put device type All before signal type SineF1000A10, otherwise it sets amplitude to 0 that is absolute silence.

I updated the debug and beta versions, now All can go as the last argument as well.

https://veg.by/files/winsoft/soundkeeper_beta.7z
https://veg.by/files/winsoft/soundkeeper_debug.7z

I just needed to reboot because of disabling the sound card.. I just dont get modern computing, where everything is so user-friendly, they do not want to share critical information with you, because of the fear they might overload the user, so the marketing department steps in, and puts "High Definition" in the device name, like that would matter, or like i would care. Just name it Realtek ALC1150 sound chip device.

I get the argument parsing bug, but i dont get what difference does it make, that i did not hear the sine? The music disappeared anyway. So what tests do you need me to run now? Can you please give me the steps? Thank you, VEG

I just needed to reboot because of disabling the sound card

You don't need to disable the whole sound card (I suppose in the Device Manager?) just to disable one or a few audio outputs in the Sound Control Panel (it is available on main page of sound settings, a link is in the "Related Settings").

but i dont get what difference does it make

SineF1000A10 All had to set amplitude to 10%, but because of the bug it was set to 0%, so no sound was produced.

So what tests do you need me to run now?

It looks more like an issue with some specific hardware or drivers than with Sound Keeper. So maybe there is nothing to do with Sound Keeper anymore =)

Yeah, this hardware behaves abnormal, my other ~7 bluetooth headphones does not have this problem. Is there a way to view the system logs for the audio subsystem in windows? Like a /var/log/syslog ? I am a linux guy, i am just gaming on windows. I googled it, found nothing, i looked around in Event Viewer, but, man...

Unfortunately, I don't know where exactly in the Event Logs you could find something related. But yeah, it is the place where it should be.

As far as I understand, enabling Sound Keeper not on all, but on specific outputs would help? I think about adding such options. At least in the future when a GUI version will be ready.

11:11:15.631 [ 3876] Enter rendering thread. Device ID: '{0.0.0.00000000}.{a110b378-4f81-4170-8029-560f03a99956}'.
11:11:15.632 [ 3876] Rendering thread mode: 1. Delay: 0.
11:11:15.632 [ 3876] Render. Device State: 1.
11:11:15.632 [ 3876] Getting output format...
11:11:15.632 [ 3876] Format: PCM 1ch 16000Hz 16-bit integer.
11:11:15.632 [ 3876] Getting mixing format...
11:11:15.632 [ 3876] Format: PCM 1ch 16000Hz 32-bit float.

16KHz sample rate mono 🤔 What is it? Is it that device?

I definitely need to add output of more information like device names into debug builds to not ask such questions.

BTW, what is the exact name of the problematic headset? Just to know what is better to avoid =)

I am not an expert on windows, but my guess it that the headphone and the headset is racing for some resources.

Yes, enabling only on specific device would help, but what would be better is to blacklist devices, as i am switching bluetooth headsets when their batteries deplete, and the same soundkeeper is still running at the time of switching headphones.

About mono, yes, the headset output (speaker) device has it's output format set to 1 channel, 16 bit, 16000 Hz (Tape Recorder Q... on the properties/advanced page, and it dropdown menu is greyed out, not changeable.

About the ids, I checked all the key-value data available on the properties/details page of the device, this is where there is a dropdown menu with 50 properties and then it shows the value, like Class Guid = {4d36e96c-e325-11ce-bfc1-08002be10318} . I have found Bus relations with 2 values, one of them is SWD\MMDEVAPI\{0.0.0.00000000}.{a110b378-4f81-4170-8029-560f03a99956} , same 2 values on Children property. I dont know if this means, this is that device, though.

Yeah, this is a bit hard to backtrack, the current ids could stay in the logs as is, but adding ~3 more lines for every new device with their user-friendly names and bluetooth mac addresses, and the like would be nice.

Problematic headphone is Acme BH203 , cheap chinese stuff with good bass and good battery life.

Thanks for your time.