Apalis T30, WEC2013, MIPI CSI2 Camera, Capture, Preview

Hello.

I flashed WEC2013 on Apalis T30

T20 / T30 WEC Software

Tegra WinCE Image (2.3 | 2019-07-10 | 61.49 MB)

Analog Camera <–> NEXT Chip N6 <–> MIPI CSI2 <–> Apalis T30 <–> WEC 2013

I confirmed that NEXT Chip N6 works well.(I2C Register read/write)

If I list the devices, there is no device called “CAM1:”

I’m wondering that Windows CE does have the CSI Camera Driver.

Do you have a detailed guide about this?

I need preview and capture camera image(s) with DirectShow or any other method.

Thank you in advance for the response.

Best regards, Bruce

Hi @snswin,

Please, can you check if this article helps you?

Best regards,
André Curvello

Thank you for the response.

I already check that codes.

HRESULT GetCameraDriver(TCHAR* name)
{
	HANDLE	                    handle=NULL;


	DEVMGR_DEVICE_INFORMATION   di;
	GUID                        guidCamera
	= { 0xCB998A05, 0x122C, 0x4166, 0x84, 0x6A, 0x93, 0x3E, 0x4D, 0x7E, 0x3C, 0x86 };
	// Note about the above: The driver material doesn't ship as part of the SDK. This GUID is hardcoded
	// here to be able to enumerate the camera drivers and pass the name of the driver to the video capture filter

	//GUID                        guidCamera =
	//{ 0x6bdd1fc6, 0x810f, 0x11d0, 0xbe, 0xc7, 0x08, 0x00, 0x2b, 0xe2, 0x09, 0x2f };

	EnumDeviceList();

	if (!name) return E_POINTER;

	di.dwSize=sizeof(di);

	//TCHAR Str[1024];
	//int iret = EnumDevices(Str, 1024);

	handle = FindFirstDevice(DeviceSearchByGuid, &guidCamera, &di);
	// fail : INVALID_HANDLE_VALUE
	//handle = FindFirstDevice(DeviceSearchByDeviceName, _T("*"), &di);

	if((handle==NULL)||(di.hDevice==NULL)||(handle==INVALID_HANDLE_VALUE))
	{
		if (handle) FindClose(handle);
		return HRESULT_FROM_WIN32(GetLastError());
	}

	StringCchCopy(name,MAX_PATH,di.szLegacyName);
	return S_OK;
}

void EnumDeviceList()
{
	HANDLE	                    hFind = NULL;
	DEVMGR_DEVICE_INFORMATION   di;

	di.dwSize = sizeof(di);
	hFind = FindFirstDevice(DeviceSearchByDeviceName, _T("*"), &di);

	if ((hFind == NULL) || (di.hDevice == NULL) || (hFind == INVALID_HANDLE_VALUE))
	{
		return;
	}

	int i = 0;
	while (1)
	{
		++i;
		_tprintf(_T("%d. Bus'%s' Key'%s' Name'%s' LegName'%s'\n")
			, i, di.szBusName, di.szDeviceKey, di.szDeviceName, di.szLegacyName);
		if (!FindNextDevice(hFind, &di)) break;
		if (di.hDevice == NULL) break;
	}

	FindClose(hFind);

}

handle = FindFirstDevice(DeviceSearchByDeviceName, _T("*"), &di);
→ all device list → there is no device called “CAM1:”

here is all device list

usage: preview [seconds]

Preview is going to be active for [seconds], or 30 seconds if no value is provided.

is mandatory and can be one of the following values:

1. Bus'$bus\BuiltInPhase1_0_0_0' Key'Drivers\BuiltIn\ccfgsvc' Name'$device\CCS0' LegName'CCS0:'
2. Bus'$bus\NFY0' Key'Notify' Name'$device\NFY0' LegName'NFY0:'
3. Bus'$bus\BuiltIn_0_41_0' Key'Drivers\BuiltIn\nvrm' Name'$device\NRM1' LegName'NRM1:'
4. Bus'$bus\BuiltIn_0_43_0' Key'Drivers\BuiltIn\NLed' Name'$device\NLD1' LegName'NLD1:'
5. Bus'$bus\BuiltIn_0_44_0' Key'Drivers\BuiltIn\Battery' Name'$device\BAT1' LegName'BAT1:'
6. Bus'$bus\BuiltIn_0_32_0' Key'Drivers\BuiltIn\eMMC' Name'$device\DSK1' LegName'DSK1:'
7. Bus'$bus\BuiltIn_0_33_0' Key'Drivers\BuiltIn\NTLMSSP_SVC' Name'$device\SSP0' LegName'SSP0:'
8. Bus'$bus\BuiltIn_0_36_0' Key'Drivers\BuiltIn\SmartCard' Name'$device\SCA1' LegName'SCA1:'
9. Bus'$bus\BuiltIn_0_37_0' Key'Drivers\BuiltIn\WAPIMAN' Name'$device\WAM1' LegName'WAM1:'
10. Bus'$bus\BuiltIn_0_39_0' Key'Drivers\BuiltIn\ALPCD' Name'$device\LPC2' LegName'LPC2:'
11. Bus'$bus\BuiltIn_0_34_0' Key'Drivers\BuiltIn\SIP' Name'$device\SIP0' LegName'SIP0:'
12. Bus'$bus\BuiltIn_0_30_0' Key'Drivers\BuiltIn\nvmm' Name'$device\NMM1' LegName'NMM1:'
13. Bus'$bus\BuiltIn_0_29_0' Key'Drivers\BuiltIn\nvwavedev' Name'$device\WAV1' LegName'WAV1:'
14. Bus'$bus\BuiltIn_0_25_0' Key'Drivers\BuiltIn\Serial3' Name'$device\COM3' LegName'COM3:'
15. Bus'$bus\BuiltIn_0_24_0' Key'Drivers\BuiltIn\ACCELEROMETER' Name'$device\ACC1' LegName'ACC1:'
16. Bus'$bus\BuiltIn_0_26_0' Key'Drivers\BuiltIn\Serial2' Name'$device\COM2' LegName'COM2:'
17. Bus'$bus\BuiltIn_0_27_0' Key'Drivers\BuiltIn\Serial1' Name'$device\COM1' LegName'COM1:'
18. Bus'$bus\BuiltIn_0_23_0' Key'Drivers\BuiltIn\credsvc' Name'$device\CRD0' LegName'CRD0:'
19. Bus'$bus\BuiltIn_0_22_0' Key'Drivers\BuiltIn\SDBusDriver' Name'$device\SDC1' LegName'SDC1:'
20. Bus'$bus\BuiltIn_0_19_0' Key'Drivers\BuiltIn\NFS' Name'$device\NFS1' LegName'NFS1:'
21. Bus'$bus\BuiltIn_0_21_0' Key'Drivers\BuiltIn\SDIO' Name'$device\NSD1' LegName'NSD1:'
22. Bus'$bus\BuiltIn_0_45_0' Key'Drivers\BuiltIn\SDIO2' Name'$device\NSD2' LegName'NSD2:'
23. Bus'$bus\PCI_3_0_0' Key'Drivers\BuiltIn\PCI\Instance\E1Q1' Name'$device\NDS1' LegName'NDS1:'
24. Bus'$bus\BuiltIn_0_15_0' Key'Drivers\BuiltIn\USBOTG' Name'$device\OTG0' LegName'OTG0:'
25. Bus'$bus\BuiltIn_0_16_0' Key'Drivers\BuiltIn\USBEHCI3' Name'$device\HCD2' LegName'HCD2:'
26. Bus'$bus\BuiltIn_0_17_0' Key'Drivers\BuiltIn\USBEHCI2' Name'$device\HCD1' LegName'HCD1:'
27. Bus'$bus\BuiltIn_0_20_0' Key'Drivers\BuiltIn\NDIS' Name'$device\NDS0' LegName'NDS0:'
28. Bus'$bus\USBHC' Key'Drivers\USB\USBHCK' Name'$device\USB1' LegName'USB1:'
29. Bus'$bus\NWF1' Key'Comm\nwifi' Name'$device\NWF1' LegName'NWF1:'
30. Bus'$bus\DP60' Key'Comm\Devices\TCPIP6\DHCPV6' Name'$device\DP60' LegName'DP60:'
31. Bus'$bus\DP40' Key'Comm\Devices\TCPIP\DHCP' Name'$device\DP40' LegName'DP40:'
32. Bus'$bus\BuiltIn_0_12_0' Key'Drivers\BuiltIn\Ws2Serv' Name'$device\WSS1' LegName'WSS1:'
33. Bus'$bus\BuiltIn_0_10_0' Key'Drivers\BuiltIn\NDISUIO' Name'$device\UIO1' LegName'UIO1:'
34. Bus'$bus\BuiltIn_0_9_0' Key'Drivers\BuiltIn\autoras' Name'$device\ARS1' LegName'ARS1:'
35. Bus'$bus\BuiltIn_0_7_0' Key'Drivers\BuiltIn\Ethman' Name'$device\ETM1' LegName'ETM1:'
36. Bus'$bus\BuiltIn_0_8_0' Key'Drivers\BuiltIn\NdisPower' Name'$device\NPW1' LegName'NPW1:'
37. Bus'$bus\BuiltIn_0_5_0' Key'Drivers\BuiltIn\EAP3SVC' Name'$device\ETS0' LegName'ETS0:'
38. Bus'$bus\BuiltIn_0_6_0' Key'Drivers\BuiltIn\NSIPROXY' Name'$device\NSI1' LegName'NSI1:'
39. Bus'$bus\BuiltIn_0_4_0' Key'Drivers\BuiltIn\NSISVC' Name'$device\NSI0' LegName'NSI0:'
40. Bus'$bus\BuiltIn_0_3_0' Key'Drivers\BuiltIn\EAPSVC' Name'$device\EHS0' LegName'EHS0:'
41. Bus'$bus\BuiltIn_0_1_0' Key'Drivers\BuiltIn\Redir' Name'$device\RDR0' LegName'RDR0:'
42. Bus'$bus\BuiltIn_0_2_0' Key'Drivers\BuiltIn\CmService' Name'$device\CMS0' LegName'CMS0:'
43. Bus'$bus\services_0_10_0' Key'Services\LPCD' Name'$device\LPC1' LegName'LPC1:'
44. Bus'$bus\services_0_7_0' Key'Services\DCOMSSD' Name'$device\DCM1' LegName'DCM1:'
45. Bus'$bus\services_0_5_0' Key'Services\HTTPD' Name'$device\HTP0' LegName'HTP0:'
46. Bus'$bus\services_0_4_0' Key'Services\FTPD' Name'$device\FTP0' LegName'FTP0:'
47. Bus'$bus\services_0_6_0' Key'Services\TELNETD' Name'$device\TEL0' LegName'TEL0:'
48. Bus'$bus\services_0_2_0' Key'Services\DSTSVC' Name'$device\DST0' LegName'DST0:'
49. Bus'$bus\services_0_3_0' Key'Services\TIMESVC' Name'$device\NTP0' LegName'NTP0:'
50. Bus'$bus\services_0_9_0' Key'Services\Proxy' Name'$device\PXY0' LegName'PXY0:'
51. Bus'$bus\services_0_8_0' Key'Services\SNApi' Name'$device\SNA0' LegName'SNA0:'
52. Bus'$bus\HID1' Key'Drivers\USB\ClientDrivers\Hid\Hid_Class' Name'$device\HID1' LegName'HID1:'
53. Bus'$bus\KBD1' Key'Drivers\HID\ClientDrivers\Keyboard' Name'$device\KBD1' LegName'KBD1:'
54. Bus'$bus\DSK2' Key'Drivers\USB\ClientDrivers\Mass_Storage_Class\6' Name'$device\DSK2' LegName'DSK2:'
55. Bus'$bus\CON1' Key'Drivers\Console' Name'$device\CON1' LegName'CON1:'
56. Bus'$bus\CON2' Key'Drivers\Console' Name'$device\CON2' LegName'CON2:'
57. Bus'$bus\CON3' Key'Drivers\Console' Name'$device\CON3' LegName'CON3:'
58. Bus'$bus\CON4' Key'Drivers\Console' Name'$device\CON4' LegName'CON4:'

Error loading property bag.

Code: -2147024809(80070057)

I still need help desperately. Please help.

Hi @snswin ,

For Tegra Module there is no real Camera Driver. There is only a generic Capture filter and a customizable Camera Plugin DLL.

Take a looks at the sample code here:
https://developer.toradex.com/software/windows-embedded-compact/toradex-ce-libraries-and-code-samples#Sample_codes

NOTE: you need to adapt the Camera Plugin to match your CSI camera.

Thank you for answer.

Previously, the project failed to load.

Let’s take a closer look at that code.

Hi @snswin ,

Can you share the error you get on project load?

Did you follow all the installation instructions? You need to install the SDK, libraries and copy a folder to the right place before opening the project.

Also: there is a VS2015 specific project

I followed build steps.

    1. Copy \CameraTegra\VSproperty directory files to \wincelib_bin_V2_0bis_2868(Windows CE software library directory).

Where can i find \CameraTegra\VSproperty directory?

This is VS2015 load message. (CameraTegra_VS2015.sln)
It seems like I did not do build steps 4,5,6.

D:\Bruce\test-src\wec2003\camera\camerategra\CameraDemo.vcxproj : error : An exception was thrown while initializing part “Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator”.

D:\Bruce\test-src\wec2003\camera\camerategra\CameraPlugin.vcxproj : error : An exception was thrown while initializing part “Microsoft.VisualStudio.Project.VisualC.VCProjectEngine.VCLegacyEventsTranslator”.

Hi @snswin ,

Sorry, the documentation on the webpage is a bit inconsistent… it was written for an older version of the project where we distributed the vsprop files separately. Now they should be part of the library packet… but i just saw that for some reason they were not included.

Here a download to the missing files in the library package:

https://share.toradex.com/vd6bdtphbdqhxty

just use those files as a replacement to Item 4 in the instructions.

Hope it then works for you.