Does the Linux UVC gadget driver support uncompressed formats besides YUYV? - linux-device-driver

I want to output NV12 or NV21, but only MJPEG and YUY2 (aka YUYV) show up as available on the client. The available formats are determined by the UVC gadget driver. I checked /sys/kernel/config/usb_gadget/g1/functions/uvc.0/streaming/uncompressed/u/guidFormat
and it's always YUY2. In the source code, it's even hard coded to YUY2!
Curiously, I tried listing formats on several web cams and none of them support NV12. Always either YUYV or MJPEG. Is NV12/21 supported without recompiling the driver? If so, how?

Related

What is the difference between File System and File Management in an operating system?

I’ve found about file management explanations and file system explanations and “file system is part of file management” explanations. But I am wondering if they are the same or two different things? Because I cannot seem to find an article about them.
A modern Operating System, to be portable, must be file system independent. i.e.: It should not matter what type of storage format a given media device contains. At the same time, a media device must contain a specific type of storage format to contain files and folders, and at the same time be Operating System independent.
For example, an OS should be able to handle any file locally, allowing the actual transfer of these files from physical media to the OS (and visa-versa) to be managed by the file system manager. Therefore, an OS can be completely independent of how the file was stored on the media.
With this in mind, there are at least two layers, usually more, of management between the file being viewed and the file on the physical media. Here is a (simple) list of layers that might be used from top down.
OS App viewing the file
OS File Manager
OS File System Manager (allowing multiple file systems)
Specific File System Driver
Media Device Driver
When a call to read a file is made, the app (1) calls the OS File manager (2), which in turn--due to the opening of the file--calls the correct OS File System Manager (3), which then calls the Specific File System Driver (4), which then calls the Media Device Driver (5) for the actual access.
Please note that any or all could have a working cache manager which means calls are processed and returned without calling lower layers. e.g.: each read more than requested in anticipation of another read.
By having multiple layers like this, you can have any (physical) file system and/or media device you wish and the OS would be none the wiser. All you need is a media driver for the specific physical device and a file system manager for the physical format of the contents of the media. As long as these layers all support the common service calls, any format of media and content on that media will be allowed by the OS.

Control Host playback from JUCE audio VST plugin

I am trying to find a way to control the playback position / tempo of a VST Host from a VST plugin build with JUCE.
I am not sure if this is possible.
I found a setPlayHead function on the AudioProcessor, and i think this might be what i am looking for.
https://www.juce.com/doc/classAudioProcessor#a9015f8476c07b173e3c9919b3036339d
But on the doc of the setPlayHead i am reading this:
Tells the processor to use this playhead object.
So can anybody tell me if this is supposed to mean that the new AudioPlayHead that is set on the AudioProcessor will be used for the Hosts playback (z.b. Cubase), or does it mean that only the AudioProcessor of my VST plugin will use this AudioPlayHead, and the AudioPlayHead of the Host remains unaffected)
Thanks for any help / input on this.
A sequencer cannot be controlled by a VST plugin in this way. The VST API doesn't allow for anything like this. The method you've found is actually part of the Juce API which allows a sequencer to pass a playhead structure to a plugin.
To be fair, there is no technical reason that a plugin couldn't do this. The host would have to supply an unofficial custom opcode and an associated canDo for the feature. However, it would not be part of the VST standard, and would only work for that specific host.
As far as I know, no major VST host (including Ableton Live, Cubase, etc) has a mechanism to allow this. Thinking from the host's standpoint, it would be a bit crazy to provide such a mechanism. Just imagine multiple plugins trying to stop/play the host's playback at the same time!
So yeah, sorry, but this is not really possible in the way that you are thinking. However, it would be possible for a VST plugin to control the host's tempo (but not playback state) via Ableton Link. Since Link works over a local network socket, and doesn't have any concept of master/slave, a VST plugin could theoretically send tempo changes to the host in this manner.
Right now (where "now" == September 2016), Ableton Live is the only sequencer which supports Link, but Ableton has said that they are working with other companies to help them add support for Link, so I wouldn't be surprised if more sequencers start to add Link support in the near future.

(Bluemix) Conversion of audio file formats

I've created an Android Application and I've connected different watson services, available on Bluemix, to it: Natural Language Classifier, Visual Recognition and Speech to Text.
1) The first and the second work well; I've a little problem with the third one about the format of the audio. The app should register a 30sec audio, save it on memory and send to the service to obtain the corresponding text.
I've used an instance of the class MediaRecorder to register the file. It works, but the available Output formats are AAC_ADTS, AMR_WB, AMR_NB, MPEG_4, THREE_GPP, RAW_MR and WEBM.
The service, differently, accepts in input these formats: FLAC, WAV, PCM.
What is the best way to convert the audio file from the first set of outputs to the second one? Is there a simple method to do that? For example, from THREE_GPP or MPEG_4 to WAV or PCM.
I've googled searching infos and ideas, but I've found only few and long-time methods, not well understood.
I'm looking for a fast method, because I would make the latency of conversion and elaboration by the service as short as possible.
Is there an available library that does this? Or a simple code snippet?
2) One last thing:
SpeechResults transcript = service.recognize(audio, HttpMediaType.AUDIO_WAV);
System.out.println(transcript);
"transcript" is a json response. Is there a method to directly extract only the text, or should I parse the json?
Any suggestion will be appreciated!
Thanks!
To convert the audio records in different formats/encodings you could:
- find an audio encoder lib to include into your app which supports the required libs but it could very heavy to run on a mobile device (if you find the right lib)
- develop an external web application used to send your record, make it encoded and returned as a file or a stream
- develop a simple web application working like a live proxy that gets the record file, makes a live conversion of the file and send to Watson
Both the 2nd option and the 3rd one expects to use an encoding tool like ffmpeg.
The 3rd one is lighter to develop but a little bit more complex but could allow you to save 2 http request from you android device

Kinect SDK 2.0 has significantly less functionality than 1.8?

I miss several functionality that I belive was present in the previous SDK-s.
For example:
//Getting reference to sensor(s)
//Old (1.8)
sensor = KinectSensor.KinectSensors[0];
//New (2.0)
sensor = KinectSensor.GetDefault();
//
//the latter one does not support multiple sensors?
Also miss the option to use multiple sensors to track skeletons:
https://msdn.microsoft.com/en-us/library/dn188677.aspx
Is this missing too?
With the new sensors, there are increased hardware requirements, making multiple sensors more difficult, as Carmine Sirignano reported.
Only one Kinect for Windows v2 sensor is supported. It is both a runtime and hardware issue of the system due to available USB3 bandwidth could only support one sensor. You would need a system with multiple USB3 host controllers in addition to those host controls on separate PCI Express 2.0 buses at a minimum.
And Wyck continues at the same link:
The Kinect uses a lot (more than half) of the available bus bandwidth to operate normally. So even though you could physically connect two or more sensors, there is no feasible way to have them both sustain enough of a data rate for them to operate normally using the existing hardware.
As a result of the hardware limitations, it appears that the runtime will only work with a single device, so the API was changed to reflect that.

Streaming short sound files

I have a script that generates wave files, based on user input.
I want to be able to stream those wave files online(not necessarily as wave files, they can be converted on the fly to mp3 or whatever). Preferably through a embedded flash streamer, but a html5 version would be good too.
The files are generally small, around 5 seconds long, and I'd like then to be stream multiple files in one session.
Does anyone know how I should go about implementing this?
With such short audio clips I would not bother with a 'real' streaming technology, but just serve them up via HTTP as static files as quickly as the network connection will allow. A quick look at my iTunes library indicates that a 5s 128kpbs 44kHz stereo file is between 120-250KB. Almost small. If you are talking about 32kbps mono, then maybe the sizes will be a mere 15-30KB.
Encoding on-the-fly may result in undesirable issues, like scaling (CPU load from all those encoding jobs, some of which will be duplicate), latency (setting up the encoding, the actual encoding), and you won't know the end file size which can cause problems. So, setting up a caching system may make more sense.
I use wpaudioplayer to stream MP3s from my website (Example). It was originally made as a wordpress plugin but can be used as a standalone javascript.
I believe that it can play wave files as well as MP3s. If you do end up converting them before serving them I would suggest that you would