mdonoughe/sbz-switch

Unexpected HRESULT: 80004005

Closed this issue · 3 comments

Running sbz-switch dump crashes, with:

CRIT Unexpected error: Unexpected HRESULT: 80004005, module: sbz_switch:172

80004005 being "E_FAIL": "Unspecified error." (very cool)

This is with a Sound Blaster X7 running as the primary device, but calling dump with the id does the same.
I am running this on Windows 11.

Happy to provide any additional information/run debug builds, would love to have this app work.

Full debug run log:

Spoiler
❯ cargo run -- list-devices
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target\i686-pc-windows-msvc\debug\sbz-switch.exe list-devices`
Sep 17 17:18:53.092 DEBG Querying endpoint {0.0.0.00000000}.{01862bd4-f4f2-4e72-b547-64d10ad654af}..., module: sbz_switch:94
Sep 17 17:18:53.093[[]]
id = '{0.0.0.00000000}.{01862bd4-f4f2-4e72-b547-64d10ad654af}'
interface = 'AMD High Definition Audio Device'
description = '6 - LG ULTRAGEAR'

[[]]
id = '{0.0.0.00000000}.{af46a412-f9eb-4b94-bd89-ce5196aef924}'
interface = 'Sound Blaster X7'
description = 'Speakers'
 DEBG Querying endpoint {0.0.0.00000000}.{af46a412-f9eb-4b94-bd89-ce5196aef924}..., module: sbz_switch:94
Sep 17 17:18:53.094 DEBG Completed successfully, module: sbz_switch:168
❯ cargo run -- dump
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target\i686-pc-windows-msvc\debug\sbz-switch.exe dump`
Sep 17 17:19:41.964 DEBG Getting volume..., module: sbz_switch::media:229
Sep 17 17:19:41.966 DEBG volume = 0.1499588, module: sbz_switch::media:236
Sep 17 17:19:41.966 DEBG Found device {0.0.0.00000000}.{af46a412-f9eb-4b94-bd89-ce5196aef924}, module: sbz_switch:129
Sep 17 17:19:41.968 DEBG Found clsid {495E4C24-85ED-4F19-885E-C2D01D7EA26C}, module: sbz_switch:131
Sep 17 17:19:42.184 DEBG 01000001 Malcolm Device Control, module: sbz_switch:151
Sep 17 17:19:42.185 DEBG   14 EnumMultiplexOutputs, module: sbz_switch:156
Sep 17 17:19:42.186 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.186 DEBG     size:       8, module: sbz_switch:159
Sep 17 17:19:42.186 DEBG   15 MultiplexOutput, module: sbz_switch:156
Sep 17 17:19:42.187 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.189 DEBG     minimum:    U32(0), module: sbz_switch:176
Sep 17 17:19:42.190 DEBG     maximum:    U32(0), module: sbz_switch:177
Sep 17 17:19:42.190 DEBG     step:       U32(0), module: sbz_switch:178
Sep 17 17:19:42.191 DEBG     value:      U32(1), module: sbz_switch:179
Sep 17 17:19:42.191 DEBG   16 HeadphoneLoadSelect, module: sbz_switch:156
Sep 17 17:19:42.192 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.195 DEBG     minimum:    U32(0), module: sbz_switch:176
Sep 17 17:19:42.195 DEBG     maximum:    U32(0), module: sbz_switch:177
Sep 17 17:19:42.196 DEBG     step:       U32(0), module: sbz_switch:178
Sep 17 17:19:42.196 DEBG     value:      U32(0), module: sbz_switch:179
Sep 17 17:19:42.197 DEBG   22 AutoSleepMode, module: sbz_switch:156
Sep 17 17:19:42.197 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.200 DEBG     value:      Bool(false), module: sbz_switch:166
Sep 17 17:19:42.200 DEBG 01000002 Processing Control, module: sbz_switch:151
Sep 17 17:19:42.207 DEBG   0 SpeakerConfig, module: sbz_switch:156
Sep 17 17:19:42.207 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.208 DEBG     minimum:    U32(0), module: sbz_switch:176
Sep 17 17:19:42.208 DEBG     maximum:    U32(0), module: sbz_switch:177
Sep 17 17:19:42.209 DEBG     step:       U32(0), module: sbz_switch:178
Sep 17 17:19:42.209 DEBG     value:      U32(12291), module: sbz_switch:179
Sep 17 17:19:42.210 DEBG   1 PhysicalSpeakerConfig, module: sbz_switch:156
Sep 17 17:19:42.210 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.211 DEBG     minimum:    U32(0), module: sbz_switch:176
Sep 17 17:19:42.212 DEBG     maximum:    U32(0), module: sbz_switch:177
Sep 17 17:19:42.212 DEBG     step:       U32(0), module: sbz_switch:178
Sep 17 17:19:42.213 DEBG     value:      U32(3), module: sbz_switch:179
Sep 17 17:19:42.213 DEBG   2 SizeSpeakerConfig, module: sbz_switch:156
Sep 17 17:19:42.214 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.236 DEBG     minimum:    U32(0), module: sbz_switch:176
Sep 17 17:19:42.237 DEBG     maximum:    U32(0), module: sbz_switch:177
Sep 17 17:19:42.237 DEBG     step:       U32(0), module: sbz_switch:178
Sep 17 17:19:42.238 DEBG     value:      U32(11), module: sbz_switch:179
Sep 17 17:19:42.238 DEBG   3 EnumSpeakerConfig, module: sbz_switch:156
Sep 17 17:19:42.239 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.239 DEBG     size:       8, module: sbz_switch:159
Sep 17 17:19:42.240 DEBG   7 DirectMode, module: sbz_switch:156
Sep 17 17:19:42.240 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.241 DEBG     minimum:    U32(0), module: sbz_switch:176
Sep 17 17:19:42.241 DEBG     maximum:    U32(0), module: sbz_switch:177
Sep 17 17:19:42.242 DEBG     step:       U32(0), module: sbz_switch:178
Sep 17 17:19:42.242 DEBG     value:      U32(1), module: sbz_switch:179
Sep 17 17:19:42.243 DEBG   9 SPDIFInPassThrough, module: sbz_switch:156
Sep 17 17:19:42.243 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.244 DEBG     minimum:    U32(0), module: sbz_switch:176
Sep 17 17:19:42.245 DEBG     maximum:    U32(0), module: sbz_switch:177
Sep 17 17:19:42.245 DEBG     step:       U32(0), module: sbz_switch:178
Sep 17 17:19:42.246 DEBG     value:      U32(0), module: sbz_switch:179
Sep 17 17:19:42.246 DEBG   11 HighPowerAmplifier, module: sbz_switch:156
Sep 17 17:19:42.247 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.247 DEBG     minimum:    U32(0), module: sbz_switch:176
Sep 17 17:19:42.248 DEBG     maximum:    U32(0), module: sbz_switch:177
Sep 17 17:19:42.248 DEBG     step:       U32(0), module: sbz_switch:178
Sep 17 17:19:42.249 DEBG     value:      U32(0), module: sbz_switch:179
Sep 17 17:19:42.249 DEBG   14 SpeakersModel, module: sbz_switch:156
Sep 17 17:19:42.250 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.250 DEBG     minimum:    U32(0), module: sbz_switch:176
Sep 17 17:19:42.251 DEBG     maximum:    U32(0), module: sbz_switch:177
Sep 17 17:19:42.251 DEBG     step:       U32(0), module: sbz_switch:178
Sep 17 17:19:42.252 DEBG     value:      U32(0), module: sbz_switch:179
Sep 17 17:19:42.252 DEBG   16 SpeakersPreset, module: sbz_switch:156
Sep 17 17:19:42.253 DEBG     attributes: 0, module: sbz_switch:157
Sep 17 17:19:42.253 CRIT Unexpected error: Unexpected HRESULT: 80004005, module: sbz_switch:172
error: process didn't exit successfully: `target\i686-pc-windows-msvc\debug\sbz-switch.exe dump` (exit code: 1)

Digged around a bit
The trace is:
in the 0 | 2 | 3 match arm in dump, when calling parameter.get()
in the Err(error) match arm in soundcore::paramter::get() (It is not an access denied error)

The last param (and the one i assume is erroring?) is

param: Param {
    param: 16,
    feature: 16777218,
    context: 0,
}

#11 should help.

It does! I can see all the valid parameters now, change settings, and it works perfectly fine with dump -o/apply as well.

Thanks for the fast fix!