I tried to attach the same Video Source Device (the WEB CAM) to two different CaptureSource objects but it looks like that want work.
The system throws an exception: A device attached to the system is not functioning. (Exception from HRESULT: 0x8007001F)
I think the web cam is locked on first CaptureSource.
Does anybody has an idea how to display two images from the same Device but from different capture source? I wanted to use a simple CaptureSource on one side and MediaStremSource with some filtering on the other side to see differences between original and filtered video source.
I wanted to use the plain CaptureSource because it's performance is better than MediaStreamSource. MediaStreamSource loses time when raises OnSample Event which is not happening with CaptureSource.
I know this exception, When you work on debug mode silverlight fails.
Run project by Ctrl+F5. (Release mode)
In addition use ask for permission methods this will display permission window for camera.
It is very capable, just did it myself. However, in experimenting with different cameras and different inputs.... 2 MS LifeCams connected to USB3 = same error. Connecting to USB2 hub to USB2 MB works like a charm. Also, if I run something like ActiveCam and it crashes, may need a reboot. Oh, you will need to use 2 capture sources.... but can still ask permission once.
Also remember not to use DefaultCaptureDevice but:
var dev1 = CaptureDeviceConfiguration.GetAvailableVideoCaptureDevices()[0];
var dev2 = CaptureDeviceConfiguration.GetAvailableVideoCaptureDevices()[1];
With perhaps better naming conventions and logic to check if devices exist etc...
Related
I have a simple app that launches and then draws a color full-screen using EGL/OpenGL ES. I am using DRM and GBM. It works great if I switch to a framebuffer console and launch from there. However, if I try to run it while the X server is active, the DRM permissions prevent me from doing so. I assume this is because the X server already has "master" control over DRM. Is there any way to override this and have a DRM app take over the screen, then return control to the X server once it completes? This would be preferable to having to switch to a console using ctrl+alt+FX first. I am running Ubuntu 22.
Mesa includes a "drmSetMaster" function in xf86drm.h:
https://github.com/freedesktop/mesa-drm/blob/master/xf86drm.h
However, I just get the same "permission denied" error. When I run as root, I get a "Device or resource busy" error.
What you want to do is to use the KMS API to create a new “DRM plane” (a.k.a. “overlay”) and display your content there. The DRM API does not have a mechanism to “take over the screen”, what it gives you is a way to create new planes and display content on those planes. The display controller will then take care of compositing those planes together and displaying the result. Each display controller has its own way of handling planes, but typically the most complex display controllers will give you the greatest control over how the planes are composed. The best way to get started on this is to look at the source code for the DRM drivers in the kernel. For example, the Intel DRM driver contains a full-featured KMS API implementation. This is a large and complex driver, but it should give you a good idea of what’s possible with the KMS API.
I asked this question in the Raspberry PI section, so please forgive me for posting this here again. Its just there doesn't seem to be as active as this section of the forum. So, onto my question...
I have an idea and I'm working on it right now. I just wanted to see what the community's thought was on using a screensaver as digital signage. Every tutorial I've read shows someone using chromium in kiosk mode, and while that's fine and works well for some uses, it doesn't work for what I need. I have successfully completed a chromium kiosk, and it was cool. But the signage that I need to create now, has to work without internet. I've thought about installing LAMP locally on the PI, and still using chromium. I still may have to if this idea doesn't pan out. All I need from the signage is a Title Message in the top center, and a message body underneath it, with roughly 300-400 character limit. My idea is to write a screensaver module, in C, that will work with a screensaver such as xscreensaver. The module would need to be able to load messages from a directory on the pi. Then for my clients to update their signage text, I would write a simple client that sent commands as well as the text via SSH to the pi. I want to know what other people think about this. Is it a good idea? Bad idea? Should I "waste" my time doing something like this?
Thanks in advance.
I am already using a rPi as digital signage, just over a year. I am using two different setups:
version 1 uses Raspian loading xdesktop and qiv image viewer to cycle images stored on the Pi itself, synchronized with a remote server. The problem I found was power and SD stability, when the power fails, which it will do no matter what, just when... The Sd card can become corrupt due to all the writing that Raspian does all the time. Certainly does not really need to write to SD.
version 2 uses a RO-filesystem and a command line image tool. Uses the same process to show images from local, and sync with server. But power fail causes no ill effects.
I am not using screensaver to display images, that seemed redundant to me, and unnecessary to wait for the SS to start just to display the images.
Some of the images are created using imagemagik, which is nicely dynamic where needed.
Probably there are a lot of similar questions around, but since I know only few solutions to this which I am not sure will work for us, I am looking for something else, maybe new technologies...
What we have is this USB device which is not so fancy (of course, it requires a driver to be loaded), and it has couple of C++ dlls to help getting certain output from it. On top, we made a C# desktop application which makes use of the device in a more attractive way (plenty of interop inside).
So far so good, but to have the application lifted up to the web in order to gain more flexibility... What options are there?
Known solutions are:
1) ActiveX - kinda old technology and not cross-browser;
2) .Net 'applet' - not so common (is this even a solution?)
3) Java applet - well known, but JVM needed (since we went for C++ C#
maybe is out of scope);
4) Web service on the usb device itself - our device is very
light, we cannot have it there.
Are there other ways? Is Silverlight 4, 5 (maybe "out of browser") a feasable solution? What about these new technologies nowadays? Html 5 or something?
EDIT1: In particular I am interested in Silverlight. Is there a way using Silverlight?
EDIT2: I found this question: Can Silverlight access a .Net library that accesses a USB port? . What shall I understand from that? Is really Silverlight not a feasable solution for my scenario?
EDIT 3: VERY IMPORTANT!
These devices need to be used on customer side! People browsing must use them locally on their PCs!
Thanks in advance.
to have the application lifted up to the web [...]
Simple solution: Let the webserver (http server) run on the PC connected to the USB device, and use one of the webserver's interfaces like CGI to talk to your USB device. This way you need to code only a USB-to-CGI wrapper program, which can be C++ or C#.
Another way is to write a browser plugin.
The issue that you're going to face is that content in a browser is often run in a sandbox, in such a way that the web app does not have access to the computer. There are good reasons for this - security, primarily. One way to have some code running in the context of the computer is to have a browser plugin that can access the computer's hardware resources, but that can interact with browser content. Unfortunately, you may end up writing a different plugin for different browsers.
There do exist frameworks out there that make writing browser plugins more manageable. A simple search should turn up some of those candidates.
You can use Silverlight 5, it can give you access to your file system and USB storage device. If you want to get control for other USB device (printer, scanner, etc), you should give a device type. I know, Silverlight 5 works fine with a file system and web-cams...)
I know that we can find the screen resolution of the client's monitor.
Is it possible to find out whether the type of device is Monitor or Projector?
If I want my web-based silverlight client to work only in Monitors and not on Projectors or vice versa, is it possible to enforce that?
The following SO question deals a similar matter in the case of java applets.
Detect Display Type (Projector) from within the browser
So whats the case with silverlight?
I don't think even Windows knows that. Most of the time it's the display driver and only on laptops. So, I don't know of any easy way of doing that. You could use encrypted DRM to enforce HDCP but even then...no go more than likely. Silverlight is basically VB .net or C# so perhaps try to find an example in those languages.
EDIT: I did some more looking around and found no real API that provided a way to detect an outputs type (Monitor or Projector)
I have registered my Phone 7 app as a Share Picker Extension. It works—my app is in the list of Share options and it gets launched and I can load the chosen image. Okay, great.
But then things go wrong in my code. I would like to be able to debug the issues, but I can't seem to keep the debugger attached.
I cannot debug this in the simulator, since the Pictures app (and thus the Share Picker functionality) is not present in the simulator.
I cannot debug this on the phone because as soon as I pick my app from the Share list, the debugger detaches... right as my app is "launching" again.
Is it possible to attach the debugger to a running WP7 app? Is it possible to keep the debugger attached? Am I doing it wrong? Any suggestions, advice or guesses are welcome because I'm tearing my hair out.
When doing M+V hub integration (sorry, haven't done any pictures hub integration yet) I initially used a crude debug technique (Messagebox.Show, etc. - like Justin mentioned) to verify what was being passed to the NavigationEventArgs of OnNavigatedTo and wrapped the whole method in a try..catch block to learn what was going on. I then refactored the code when I knew what could be expected. (Remember OnNavigatedTo will be called when your app is launched normally too and so e won't be populated in the same way.)
When the app is launched from a/the hub it creates a new instance of the app and there is currently no way to connect to this for debugging while the main page is being navigated to.
Great question. I'm unsure if that's possible. As far as I know, there's no way to attach the debugger to when the WP7 O/S starts an app (which wasn't triggered by the debugger).
Photo Share picker extensibility, music+Video hub extensibility and other O/S extensibility points seem to not play nicely with the VS debugger. Normally I resort to MessageBox.Show to debug any problems with WP7 O/S integration.
1) Connect the Device
2) Turn off Zune
3) Start C:\Program Files\Microsoft SDKs\Windows Phone\v7.1\Tools\WPConnect\x86\WPConnect.exe
To properly debug your application that uses the Media Library, you'll need to use the Windows Phone Connect Tool (WPConnect.exe) as described on MSDN. Jaime has some additional tips on his blog.
Once you are connected, you should be able to debug your application. Fingers crossed anyway. If that doesn't help, I'll dig a bit further.
It's not so much about the WPConnect tool. The nature of your application means that you have to have it closed and the user should pick a photo. Only after that the data is returned to the application.
You should read about the application execution model on Windows Phone 7. Also a good explanation is available here.
Initially, I would say that you should look at tombstoning (a good explanation here) but then again, the image returned will re-start the app and won't allow you to directly attach the debugger.
Yeah, looks like this is impossible...
All the answers above seem to be missing the point: I presume you're able to debug your app in the "standalone" mode (when it's launched normally), but not when it's launched via the Share Picker Extension. Am I write? This is the wall I'm hitting... :-(
I thought the proper way would be to attach to the process once it's launched.
I tried to use Debug > Attach to Process, then select Smart Device as the Transport and Windows Phone Device as the Qualifier... But in return I get the ugly "Unable to connect to 'Windows Phone Device'. Not implemented" message.
Bummer :-(