frgnca / AudioDeviceCmdlets

AudioDeviceCmdlets is a suite of PowerShell Cmdlets to control audio devices on Windows
MIT License
764 stars 92 forks source link

"Get-AudioDevice -List" throws 0x80070490 Exception #71

Open lamrongol opened 1 year ago

lamrongol commented 1 year ago

Get-AudioDevice -List command outputs:

Index   : 1
Default : True
Type    : Playback
Name    : Speaker (XMOS USB Audio)
ID      : {0.0.0.00000000}.{xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx}
Device  : CoreAudioApi.MMDevice

Get-AudioDevice : "Element not found. (Exception from HRESULT: 0x80070490)"
At line:1 char:1
+ Get-AudioDevice -List
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-AudioDevice], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,AudioDeviceCmdlets.GetAudioDevice

(The message is actually in Japanese, but I have replaced it with an English message that I think is relevant. ID is masked just in case.)

When default device is set to "Headphone", device information is not displayed and only error messages are displayed("Get-AudioDevice : "Element not found. (Exception from HRESULT: 0x80070490)" and below).

I've looked at past Issues and they have been resolved, but it happens in my environment. Windows 10 Home 22H2 19045.2913 Windows Feature Experience Pack 1000.19041.1000.0 Powershell version is 5.1.19041.2673 Installed by Install-Module -Name AudioDeviceCmdlets -RequiredVersion 3.1.0.2

lamrongol commented 1 year ago

For the newest Windows 10, this error no longer occurs. Detail: Windows 10 Home 22H2 19045.3030 Windows Feature Experience Pack 1000.19041.1000.0 Powershell version is 5.1.19041.3030

feoh commented 1 month ago

It's back in Windows 11 :(

get-audioDevice : Element not found. (Exception from HRESULT: 0x80070490)
At line:1 char:1
+ get-audioDevice -List
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Get-AudioDevice], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,AudioDeviceCmdlets.GetAudioDevice