Empty device properties in DirectShow - directshow

I am using DirectShow.Net to enumerate DirectShow devices like this:
var devices = DsDevice.GetDevicesOfCat(FilterCategory.AudioInputDevice);
This code returns the expected number of audio devices but all of the items returned have null names and other properties:
devices[0]
{DirectShowLib.DsDevice}
ClassID: System.NullReferenceException: Object reference not set to an instance of an object
DevicePath: null
Mon: null
Name: null
I have confirmed the devices are properly registered with GraphStudioNext and I know the audio devices are working in general. And I have the same issue with other devices like FilterCategory.VideoInputDevice.
Any ideas?
.Net Version: 4
Build target: 64 bit
OS: Win 10

Related

Nest Device Room(id or displayName) does not get updated in SDM api

I add a device for the first time in Nest app, and I set the 'where' parameter e.g. Backyard, and complete the device add flow.
Now, in my own app, when I hit SDM api to get list of devices, it gives me a parentRelation object in there which tells where my device is assigned.
parentRelation: { parent: 'enterprises/eid/structures/sid/rooms/rid, displayName: Backyard}
But when I update the 'where' parameter inside the Nest app, under device settings to 'Family Room' for example.
This change would not appear in the SDM api. It would still give me the first configuration data when I added the device.
Can anyone help me with this?

SQLite.Net.Async.AsyncTableQuery<T> cannot implicitly convert to IEnumerable<T>

We have a Xamarin Forms app that's using SQLite to store some table data. We're using the NuGet package sqlite-net-pcl version 1.3.1. The query looks like:
SqlLiteAsyncConnection database = DependencyService.Get<IDatabaseUtility>().GetDbConnection();
var result = database.Table<MyTable>();
List<MyTable> records = await result.ToListAsync();
When we hit that last line (result.ToListAsync()) we get an exception:
Cannot implicitly convert SQLite.Net.Async.AsyncTableQuery<MyProject.Models.MyTable> to System.Collections.Generic.IEnumerable<MyProject.Models.MyTable>
This happens whether we call ToListAsync() or ToList()
The odd thing is that this only happens when we're running on an Amazon Kindle Fire. We have two phones (Note 5 and a Google Pixel) that it runs fine on.
Can anyone shed some light on what is causing this problem with this device?

BluetoothLEDevice.FromIdAsync returning null

This is UWP code for getting BLE devices. Why I get bleDevice == null for some devices? I didn't find any documentation which explains that.
var devices = await DeviceInformation.FindAllAsync(BluetoothLEDevice.GetDeviceSelector());
foreach (DeviceInformation di in devices)
{
Debug.WriteLine(di.Name);
BluetoothLEDevice bleDevice = await BluetoothLEDevice.FromIdAsync(di.Id);
if (bleDevice == null) {
Debug.WriteLine("--- NULL ----");
continue;
}
Debug.WriteLine(bleDevice.Name);
}
I noticed that I get bleDevice != null for BLE devices that HAVE exclamation mark with STATUS_DEVICE_POWER_FAILURE in device manager in Windows.
I get bleDevice == null for BLE devices that DO NOT HAVE exclamation mark in device manager.
I got the same problem. the previous answer from Chi Lee is in fact good but not enough detailed on how to do it (for non-experts;-) ).
Here the detailed process (assuming you have a c# project under Microsoft visual studio):
Double click the properties field under your project: this will open a new tab
in the opened tab, select Application in the left then click Package Manifest... button
A new tab named "package.appxmanifest" is opened. Select, inside it, the Capabilities tab
Check Bluetooth field under capabilities
Save and recompile your project.
The BluetoothLEDevice.FromIdAsync(di.Id) will no more return null, provided that you already have paired devices (either in your program or manually in Windows .
You have to add Bluetooth capability in your appxmanifest file.

Why can I change volume level on a webRTC call using the native control bar but not programatically?

Reading this question looks like it's not possible to change volume levels to webRTC streams. Even exploring the audio stream object with dev tools, there is no volume property.
MediaStreamTrack {onended: null, onunmute: null, onmute: null, readyState: "live", enabled: true…}
enabled: true
id: "B3o0SZOXfI9PJjesCKxvFW0Gn3J6sYWxebvSa0"
kind: "audio"
label: "Default"
onended: null
onmute: null
onunmute: null
readyState: "live"
__proto__: MediaStreamTrack
Although the embedded controls of the video element, are able to change the volume levels (just to be sure, I checked and they are not changing the system level volume)
So how is it possible to change the volume levels using the controls but not programmatically?.
Does anybody know where these controls are pointing?.
It is possible to change the volume programmatically using jquery or javascript.
jquery was causing me confusion as I was trying to do
$("#videoid").volume
getting undefined as result, but the way to do it with jquery is
$("#videoid").prop("volume",0.5)
or with plain javascript
document.getElementById("videoid").volume=0.5;
With this we can change the volume during a live webrtc communication.

Environment.WorkingSet bug

Environment.WorkingSet returns the working set incorrectly for my asp.net application which is the only application in its application pool.
On a Windows 2003 Server SP2 with 3GBs of Ram which is a VMWare Virtual Machine, it reports working set as 2.047.468.061 bytes(1952MBs) and Process.WorkingSet value is 75.563.008 bytes(72MBs).
• Memory Status values returned by GlobalMemoryStatusEx:
AvailExtendedVirtual : 0
AvailPageFile: 4.674.134.016
AvailPhys: 2.140.078.080
AvailVirtual: 1.347.272.704
TotalPageFile: 6.319.915.008
TotalPhys: 3.245.568.000
TotalVirtual: 2.147.352.576
• GetProcessMemoryInfo()
Working Set : 55.140.352
Peak Working Set: 75.571.200
PageFile : 94.560.256
QuotaPagedPoolUsage : 376.012
QuotaNonPagedPoolUsage : 33.261
• GetProcessWorkingSetSize() - min : 204.800 - max : 1.413.120
• GetPerformanceInfo()
CommitLimit : 1.542.948 pages 6.319.915.008 bytes
CommitPeak : 484.677 pages 1.985.236.992 bytes
CommitTotal : 417.514 pages 1.710.137.344 bytes
HandleCount : 57.012
KernelNonpaged : 8.671 pages 35.516.416 bytes
KernelPaged : 27.302 pages 111.828.992 bytes
KernelTotal : 35.973 pages 147.345.408 bytes
PageSize : 4.096 bytes
PhysicalAvailable : 508.083 pages 2.081.107.968 bytes
PhysicalTotal : 792.375 pages 3.245.568.000 bytes
ProcessCount : 43
SystemCache : 263.734 pages 1.080.254.464 bytes
ThreadCount : 1.038
After loding the new patch, http://support.microsoft.com/kb/983583/en-us, .NET Version changes to 2.0.50727.3615 and Environment.WorkingSet now returns the value: 2.047.468.141.(which is 80 bytes bigger than previous one)
On a Vista machine with 3GBs of Ram, Environment.WorkingSet and Process.WorkingSet values are similar and around 37 MBs.
So, why Environment.WorkingSet returns a fixed value? Restarting the application pool does not change anything, it always return the same magic value, 2.047.468.061.
I have also setup an .NET 1.1.4322.2443 application, and it weirdly WorkingSet is returned a number from a random set of unrelated numbers(193.654.824, 214.101.416, 57.207.080, 287.635.496) each time page refreshed while GetProcessMemoryInfo() returns the expected number.
I have also found that when the application run by impersonating "NT AUTHORITY\NetworkService" account this problem does not occur, Environment.WorkingSet returns the expected number both .net v1.1 and v2.0.
I have checked CodeAccessPermissions like EnvironmentPermission for windows user and NetworkService but could not find anything that restricts reading the WorkingSet value.
So, what could cause this? Is it a bug, some incorrect configuration or corrupt file etc.?
Environment.WorkingSet is a "estimation" by the CLR on the memory space needed by your application. If your application does not change (physically) then it should be the same value on every load (I cannot verify that 100%, but it should be correct enough to proceed.).
It is always bigger than is actually needed as it is unsure of the code branches required, but the OS will reduce the memory if it sees it is not being used. A good example is to minimise the application to the taskbar to see it reduce in size.

Resources