Why can a SD card be read/write by both the phone and a computer - usb

Some phones carry a SD card and can read/write files on it. If the phone is connected to a computer and placed in mass storage mode, the computer can also read/write files on the SD card as if it's a USB drive. So my question is, how can the computer access a peripheral that belongs to another device (the phone)?
To my understanding, there should be a physical switch in the phone that routes the data buses of the SD card to either the bus of the phone or the micro-USB port? Then there's also a driver that controls this switch? If so, where's such driver (in Android OS or iOS for examples)? If not, what's the mechanism to share this SD card?
Note that I'm not talking about MTP, but the mass storage class. I know that the phone and computer may not be able to access the SD card simultaneously - probably one at a time, depending on the status of USB connection. I'm interested in the mechanism to control/switch the access/connection to the SD card from two hosts.
Comments: The similar mechanism may be found in a mp3 player: when it's plugged into the computer, we can add/remove musics. The mp3 player cannot play musics until it's unplugged from the computer - at least mine is like this. Android OS should do the same but I can't find the related source codes.

To my understanding, there should be a physical switch
No, the switch is in the software.
what's the mechanism to share this SD card?
A piece of the software does the umount of the sdcard and connects
it as a USB Mass storage device to the PC - like a card reader would do.
The Linux kernel itself contains a driver that works as a USB mass storage device, but I don't know whether Android actually uses this.

Related

Is it possible to get data from SD card with SPI on my computer?

I need to try to find ways to corrupt/change some data in a SD card, but the thing is, the SD card is in microcontroller, so it works with SPI. What I would like to do in a perfect world is to clone this card and then play with the cloned card. So is there a way to do that?
you could try the arduino interface to read/write data from/to SD card via SPI.. there are many tutorial on the internet about accessing SD card data via arduino

Sony Alpha 77M2 Remote control over USB

I have three Sony Alpha 77M2 cameras, and I'm trying to take photos with all three simultaneously, and retrieve these photos. I can do the simultaneous shutter release using commercial remote triggers synced off a single transmitter, and I can control a single camera over USB using the Sony Remote Camera Control software - however this can't control more than one camera, and it won't let me run more than one instance on a single machine.
My question, therefore, is whether there is an API available for the USB remote control interface for these cameras? They don't support the WiFi API, so I can't use that (and WiFi isn't much use for the environment this system will be used in, due to the likelyhood of interference)
It turned out that the camera supports enough of the PTP protocol for libgphoto to recognise it and retrieve the images in tethered mode - but not to control the shutter.

Camera Remote API beta SDK: How to synchronize multiple DSC QX 100 cameras

Can we control multiple DSC-QX100 cameras using the Camera Remote API SDK from an iPad OS7?
The objective is to cause multiple cameras to "snap" picture at the exact same time. Perhaps each camera has an address (serial number)...can the software communicate with all cameras at the same time using multiple addresses? Need is limited to still photos and so-called fast, rapid photography. Video not necessary.
If so, how?
Unfortunately you can only control one QX100 lens at a time. This is because the lens connects over WiFi and you are limited to only a single WiFi connection at once on an iPad. It may be possible using a desktop PC with multiple wireless cards installed but that would be the only way.
As the Sony rep said, there's no way to do this with "officially supported" techniques.
The reason for this is that the camera acts as a WiFi Access Point (AP) - so while multiple devices can connect to it, most mobile devices can only connect to it and not anything else (since iOS and Android don't support connection to multiple APs simultaneously). This is also why you can't use other network interfaces when connected to the camera. (I don't know about iOS, but Android always prioritizes WiFi over cell network data, for example.)
Android devices have a feature called "WiFi Direct" that provides more flexibility in terms of peer-to-peer interconnection, but iOS does not support WFD. The QX100 DOES respond to WFD invites, and you can accept a pairing request with (if I remember correctly) a long-press of the shutter button. However, the official app only supports normal WiFi AP connections.
I have not yet attempted to see if using Sony's remote API in combination with the (unsupported but apparently present) WiFi Direct capability works.
More info on Wifi Direct and Android can be found at http://developer.android.com/guide/topics/connectivity/wifip2p.html
Marlin SONY, I disagree, wifi is Ethernet and by definition can handle multiple devices on the same network. If you run a phone or iPad as a hotspot and connect multiple devices, it works.
Multicam Switcher Basic is an example of a free app that supports cutting together multiple camera angles live. Unfortunately the app is still being developed so features like third party camera support isn't included, but it does show what is possible and awaits development.
I think this should be possible. Apps like CollabraCamâ„¢ (Multicam Social Video Production) or RecoLive MultiCam prove that is possible to use mulitple cams simultaneous.
I need someone too to develop an App to be able to use "two" sony dsc-qx for 3D shoots. Please, if You know how or who can do this contact me email#3-d.re

How can I send/receive data to/from my samsung s3 to a (medical) device via an arduino board (wifi + usb)?

I am new to using arduino board. I will like to connect my samsung s3 to a medical device via a an ardunio board.
The first idea is to send/recieve data to/from the phone to the medica device via usb on an arduino board and the medical device recieve/send data from/to my phone via usb on the arduino board.
The second idea is send/recieve data to/from the phone to the medica device via WIFI on an arduino board via usb and the medical device recieve/send data from/to my phone via usb on the ardunio board.
Thanks for your proposed solutions.
All problems, including this one are best approached in increments. In this particular case, I assume you already have an arduino with a WiFi shield and a Samsung s3.
You don't mention the medical device or how it is programmed. But first, concentrate on how to get the Samsung to talk to your PC via wireless. In doing this you will learn a lot about how to write code for the Samsung and how to write code for a PC/Wireless connection. There are probably already sample applications that do this.
Next, identify how the arduino board will connected to the medical device and make the same connection from the arduino to your PC. Get this connection to work. I know there are many examples of how to do this.
Next, get the Samsung to talk just to the arduino board which maybe turns on an LED. Since you already learned how to code the Samsung to do wireless in the first step, then this step might be easy.
Next, connect the arduino to the PC and have the Arduino pass data back and forth between the PC and the Samsung.
After you have this "stack" of: Samsung <==> Arduino <==> PC working then consider what it would take to replace the PC with a medical device so that you have:
Samsung <==> Arduino <==> Medical Device
You can design your own series of incremental steps based on your more specific knowledge of the devices that you have. But the idea is the same, each step is something easy to do and easy to debug. But taking all the steps results in a complex system!
No one is able to do what you want on the first try (unless they have already developed the same or similar system). But everyone is capable of learning new material, if they are persistent.
Please keep me informed as you work on this, it is an interesting project!!

USB based video capture card with API

I am looking for a usb based video capture card (to be used with cctv analog cameras) which comes with an api. An api of sorts would help as I am planning to do some analytics on the video stream.
Any ideas on such a device?
What platform? Pretty much any capture card would work with DirectShow on Windows. On Linux, the usual API is V4L - the hardware compatibility list isn't as extensive on Linux, but most things do work with it.
The only capture boards I know of internal to a PC are PCI capture cards. A USB capture card would limit the data you could capture. For instance if you try to stream video to a USB drive you'll get error messages because USB is too slow. You're better off purchasing an encoder to do what you want. Retail for an analog encoder is as low as 300 dollars and it allows you to connect 4 analog cameras.