Comments (15)
I just got this error when I disconnected my default recording device, just re-connected it the error is gone.
I have manually compiled "Dev v3.0.1 communicationdevice #30" and "add -ShowDisabled parameter support to List parameter (#24)". I don't try to see if this occurs with the lastest available release (3.0).
It's a shame that this wonderful tweak didn't update anymore ...
from audiodevicecmdlets.
To me, it seems that (possibly after the new windows update) non-default devices are no longer providing an element of data required to populate this list, which makes the query to stop on first non-default device, and stop recursing through the rest of the list.
Here is where the error is probably occuring
AudioDeviceCmdlets/SOURCE/AudioDeviceCmdlets.cs
Lines 163 to 177 in 3d33a5b
[...] latest windows update removes certain details from disconnected devices that this query is looking for. So, instead of gracefully moving to the next device, this query just crashes.
Hopefuly my goal of adding support for disabled/disconnected AudioDevice will bypass this problem.
from audiodevicecmdlets.
I will continue to work on those from pull request #55
Pull request #55 having been merged into the dev_v3.1 branch, I can say that this issue will be fixed when pull request #52 is merged into the master branch.
from audiodevicecmdlets.
Agreed:
> Get-AudioDevice -List
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
Not sure how to get more information / troubleshoot further, @frgnca any pointers?
from audiodevicecmdlets.
Never seen this before. What is the output of say
Get-AudioDevice -Index 1
Does it give a different error message?
from audiodevicecmdlets.
No, same:
> Get-AudioDevice -Index 1
Get-AudioDevice : Element not found. (Exception from HRESULT: 0x80070490)
At line:1 char:1
+ Get-AudioDevice -Index 1
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-AudioDevice], COMException
+ FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,AudioDeviceCmdlets.GetAudioDevice
One more detail that I just become aware of. I have multiple audio devices. The above fails only when issued against a non-default audio device. It succeeds when issued against a default device. I've tested by changing all combinations.
This is with AudioDeviceCmdlets 3.0.0.4 by the way.
from audiodevicecmdlets.
Same issue.
As described above, all switch parameters are working, other than List.
> Get-AudioDevice -List
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
In regards to your question @frgnca , I don't have an active device on Index 1, but if I look for 3, I get a result as expected.
>Get-AudioDevice -Index 3
Index : 3
Default : True
Type : Playback
Name : Speakers (Realtek High Definition Audio)
ID : {0.0.0.00000000}.{94f04e23-d7a2-485e-bd3b-35debef6ba0e}
Device : CoreAudioApi.MMDevice
I have re-installed the module as well. Just to make sure that it wasn't an import issue.
> Get-Module
ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Binary 3.0.0.0 AudioDeviceCmdlets {Get-AudioDevice, Set-AudioDevice, Write-AudioDevice}
Kindly assist.
from audiodevicecmdlets.
Performed some additional tests.
If I disable all devices, leaving only the active device enabled. I get the result. But the moment any other device gets enabled, it stops working again.
> Get-AudioDevice -List
Index : 1
Default : True
Type : Playback
Name : Speakers (Realtek High Definition Audio)
ID : {0.0.0.00000000}.{94f04e23-d7a2-485e-bd3b-35debef6ba0e}
Device : CoreAudioApi.MMDevice
Another interesting finding, if all devices above the Default device are disabled and the ones below the default device are enabled, the list works till it hits the first non-default device.
Get-AudioDevice -List
Index : 1
Default : True
Type : Playback
Name : Speakers (Realtek High Definition Audio)
ID : {0.0.0.00000000}.{94f04e23-d7a2-485e-bd3b-35debef6ba0e}
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
To me, it seems that (possibly after the new windows update) non-default devices are no longer providing an element of data required to populate this list, which makes the query to stop on first non-default device, and stop recursing through the rest of the list.
What do you think @frgnca ?
from audiodevicecmdlets.
I'm also affected by this bug, I installed the dll only with Install-Module -Name AudioDeviceCmdlets
and I confirm I can see the device with Get-AudioDevice -Index 2
and I can set the audio playback with Set-AudioDevice -PlaybackVolume 50
.
I cannot exec Set-AudioDevice 2 -PlaybackVolume 50
nor Set-AudioDevice "{...}" -PlaybackVolume 50
nor with Set-AudioDevice (Get-AudioDevice -Index 2) -PlaybackVolume 50
but I don't know if the behaviour is intentional.
They all gave to me
Set-AudioDevice : Impossibile trovare un parametro posizionale che accetta l'argomento <whatever>
+ CategoryInfo : InvalidArgument: (:) [Set-AudioDevice], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,AudioDeviceCmdlets.SetAudioDevice
from audiodevicecmdlets.
I could see the same error.
Personally, I suspect that the error only occurs on computers with newer hardware.
from audiodevicecmdlets.
I could see the same error.
Personally, I suspect that the error only occurs on computers with newer hardware.
This has nothing to do with newer hardware. My PC is Haswell 4790k from 2015. I found exactly what causes the issue. When Mic is connected issue disappears, when mic is disconnected issue appears.
As posted in my previous message, latest windows update removes certain details from disconnected devices that this query is looking for. So, instead of gracefully moving to the next device, this query just crashes.
from audiodevicecmdlets.
Good find. I think you are correct. It should bypass the issue when there is something in 'recoding device' list, even if it is disabled or disconnected.
Even before this condition we could branch out the 'if', to execute 'iff' there is a device in default recording device list. If there is a default device execute as is, and if not execute modified conditions without recording device conditions. Just a thought, I leave it to you how you think it would be best.
from audiodevicecmdlets.
I just want to confirm being able to replicate this bug by calling the -List parameter when there is no enabled playback device and/or no enabled recording device.
I intent to fix this bug before merging #52 into the master branch.
from audiodevicecmdlets.
With the code as it is now in #52, I think the problem possibly exists in 3 places.
- List parameter
AudioDeviceCmdlets/SOURCE/AudioDeviceCmdlets.cs
Lines 225 to 253 in 02ca185
- ID parameter
AudioDeviceCmdlets/SOURCE/AudioDeviceCmdlets.cs
Lines 269 to 297 in 02ca185
- Index parameter
AudioDeviceCmdlets/SOURCE/AudioDeviceCmdlets.cs
Lines 317 to 345 in 02ca185
from audiodevicecmdlets.
Having fixed the way the List, ID, and Index parameters work, I came to the conclusion that this bug could also happen in the same way in pretty much all of the other parameters. I will continue to work on those from pull request #55
from audiodevicecmdlets.
Related Issues (20)
- Request: control microphone (eg. mute) HOT 2
- Feature Request - Change the playback device of a specific listened recording device HOT 4
- Get-AudioDevice : Parameter set cannot be resolved using the specified named parameters. HOT 1
- Question: How to get a single value from PlaybackStream HOT 2
- The module does not install HOT 2
- Get-AudioDevice -List error when no enabled mic or playback device. HOT 3
- Get-AudioDevice -Playback output is wrong sometimes in scripts HOT 1
- Add support for ErrorAction argument HOT 1
- Get-AudioDevice -PlaybackCommunication HOT 4
- How to check Mute-State of non-default-device HOT 1
- Change status of non-default audio device HOT 1
- [Feature-Request] Include disabled/disconnected devices in Get-AudioDevice -List
- Feature Request - Disable Audio Device like it is possible in mmsys.cpl
- [Feature Request] Control over Communication's "Reduce The Volume" feature.
- [Feature Request] Set Endpoint Friendly Name.
- [Feature Request] Get and Set sampling rate and bit depth
- Write-AudioDevice should be able to adjust -[Timespan]SampleInterval and return floats HOT 3
- Write-AudioDevice should support -Multichannel
- Write-AudioDevice internal cleanup
- Write-AudioDevice should not use parameter sets
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from audiodevicecmdlets.