Hacking MTP or MSP to spoof file-system for USB Audio out - Android Software/Hacking General [Developers Only]

I'm in the process of learning the Android HW & SW architecture. I'm trying to think of some interesting projects that I can mess around with to help me learn. (I'm experienced in electronics, software and firmware dev.)
Anyway, one thing I've been thinking about is the need for real-time audio over USB using the current defacto standards; MTP and Mass-Storage. The real target audience here is people who have a "USB enabled" car stereo.
My idea:
Implement some layer of abstraction between the protocol on the Android device and the file system that it exposes to the USB host. This would really be a "Fake file-system" that acts as a WAV buffer for the Android audio out. This would provide some amount of universality, because almost all of those devices support WAV. (Plus, it would otherwise potentially require trans-coding...)
I know that capturing the audio outputs presents a challenge. Perhaps the Bluetooth Audio PCM stream could be captured and converted to wave by creating a "virtual Bluetooth headset" to pair to. (Not optimal...but an option)
To me the biggest challenge seems to be the USB interface. I've designed USB hardware before and realize that a LOT of the low-level protocol stuff is implemented in hardware. In that case, it might be almost impossible to attach that USB subsystem to some "virtual FAT partition". (which would be required for USB Mass Storage)
In the case of MPT, it seems like you might be able to "trick" the host into playing a 4GB WAV file (4G is the max-size in MTP) that is being fed by android in the background. There might be a hiccup every x Minutes once you reach EOF, but it would still be usable as a proof-of-concept.
I know this is a pretty expansive topic that involves low-level specifics for several protocols. I'm just trying to figure out if there are any real "show-stoppers" that would make something like this impossible.(I'm under no impression that it could just be an App. I'm pretty much under the assumption that this would require a custom ROM at the least.)

Related

Android and USB audio

In have a question about Android and how it handles USB audio. I know that USB has a unified audio layer that is standardized and requires little in order to be seen and operated by the os. Its that reason why most usb audio class devices are simply plug and play, however some devices require add'l drivers for extra fucntions, i.e. dsp functions. What I'm trying to understand is how Android handles usb audio, does it conform to usb audio class stipulations as well, so audio devices are generally plug and play, or is there something extra that would be required?
I'm asking because I hope to get a G-Tablet this Xmas and use it in my car. I could just use the analogue outs but I want something a bit more robust, and was hoping to get an external usb audio device with multiple outputs. Maybe write a driver if needed depending on the complexity, of course. any help would be appreciated.
USB audio works on my Allwinner A10 tablet witn "Unofficial CyanogenMod 9 for many AllWinner A10 tablets" firmware from Christian Troy

Webtop to Netbook (NOT Lapdock)

OBJECTIVE:
Webtop from Atrix 2, via standard HDMI, to standard laptop HDMI input.
PROBLEM:
Most HDMI ports on laptops are output only.
SUGGESTED SOLUTION:
HDMI to USB or HDMI to IP converters. not sure this even exists
Update to this post:
The original product link was in error (pointed out by "IceFragmatic"). As suggested by IceFragmatic, most USB video INPUT for laptops/netbooks, are intended as capture devices, although I am not sure what he means by "due to DCHP", regarding HDMI being a very rare capture source.
Has anyone attempted this?
The item you link to is USB to HDMI...again outout only.
You would need to use a capture device (which for HDMI is very rare due to DCHP)
Why not just buy a cheap screen with DVI and/or HDMI input?
I know that for the last few years, that there have been a small handful of expensive giant laptop PC's that provide for HDMI INPUT (yes, input), but there are as yet no netbooks or UMPC's that have a means to provide this .... would you agree with that statement?
(this is interesting from a hardware perspective, not necessarily from a business strategy perspective)
You're better off just using a VNC server program on the phone and a VNC client on the netbook while connected to a solid wifi. That will allow you to control the linux environment running on your phone from your laptop and doesn't require expensive video capture hardware. One does not simply use one's netbook as a monitor.
Sorry, should have referred to HDCP (not DCHP).
HDCP is a copy protection protocol used to stop digital copying of comercial DVDs and some TV streams.
The movie studios and owners of the HDMI licences do not want HDMI recorders without some form of protection to stop copying of DVDs. If this copy protection did not exist you could make perfect copies of DVDs and BluRay. Therefore HDCP has be introduced. This makes HDMI input/recorders useless for anything but home-made movies (and therefore not a big seller).
Your homework is to read the following....
http://news.cnet.com/8301-17938_105-9870317-1.html
John

[Q] Can Jack Audio ever work in Tubuntu? Plus some audio apps that do..

Hey, I wanted to say that I am really loving x3maniacs build of Ubuntu for tf101, Tubuntu, it's revitalized a piece of hardware I didn't even know needed revitalizing.
I only had one or two questions involving audio. Is there any way to get Jack Audio working on an ARM processor, this one in particular? I've read enough to know that they don't play nice together, but I've read of some success getting it to work with the ARM based Pandaboard through an external audio interface compatible with Ubuntu/Linux. I'd much rather prefer the software way, but anything would be awesome.
And I guess that's part of my second question: Is there any way to get USB midi interfaces or Audio Interfaces recognized? Maybe recognized is the wrong word, because I scanned the ports with my Korg microkey plugged in, and it saw a device labeled KORG, but I think I need to be able to use a midi softsynth like timidity or fluidsynth to have it translate to an application.
I'm already really impressed with this build, and linux in general, I know it's very midi capable, it recognized my psx controllers hooked up with a super dual box pro, and as two seperate midi game controllers no less with fully working thumb axis controllers (which is more than I can say for android).
I should also mention that I'm really interested in this because LMMS (Linux MultiMedia Studio), Audacity, and the Hydrogen sampler all seem to be up and running really well on Tubuntu, I mean I'm more than happy with that. I can even use an adapter to split the microphone input and audio output in the headphone jack so I can plug my guitar, bass, and microphones in and record directly into Audacity. More than I ever could've imagined doing with this hardware.
And anyone who's into audio production or beat making, you should really check out LMMS on Tubuntu, full of instruments, plugin effects, and an Sf2 (soundfont) player, all with really manageble latency considering.
so even though I'm happy where it's at, I'm just wondering if that one small, yet crucial and difficult to work around, piece can be figured out. Jack would open the system up to programs like Ardour, Rosegarden, Musecore (which actually works but crashes when you try to go into preferences and can't play sound, think it's automatically configured to jack or alsa_seq), and Traverso, which all start up, but can't really be used without Jack; or the world of guitar amp modeling, as there's a way to get a guitar signal in.
Sorry for the long post, but I am really excited by the sheer number of things that are already working in this build (not even mentioning GIMP or Libreoffice).
Really, thanks to everyone for their hard work on this. Hope to hear from someone on the issue.
Oh, and I should warn anyone who might try, excessive installing and uninstalling of audio drivers/midi drivers seems to lead to instability in the system, I've reflashed and started from scratch many times in the last few days.
Also, also, I usually found my self in search of snd-seq modprobe file/directory, that seemed to be the thing that couldn't be found and connected to jack most often.
Alright, thanks again.

InputStick: Android to USB wireless adapter

Well I'm not really sure if this is the best place for this thread, since it is related to many things (hardware, Android accessory, API and applications).
OK, so here's a project that I've been working on for quiet some time: InputStick, which is Android to USB wireless adapter (I guess that's the best way to describe it).
What is it?
It's a small USB dongle that allows Android applications to emulate USB devices, like keyboard, mouse, game controllers etc (mostly HID devices, but not only). This allows apps to type, move mouse pointer, control multimedia playback, control games and many other things.
How is it different form software-only solutions?
plug and play: no configuration/software/custom drivers
works with any USB enabled system (PC, Android, consoles, Raspberry Pi etc)
no network connection is necessary (just Bluetooth in your Android device)
The only bad thing is that you need additional piece of hardware, but that's the price of compatibility and very quick set-up time.
How to use it?
plug InputStick into USB port
run an app, connect with InputStick (I usually include "auto-connect" option)
wait a few seconds (initiating Bluetooth connection, uploading configuration data, USB enumeration)
it's ready, now the app can do anything that can be done using USB device it is emulating
How does it work?
InputStick is a "man in the middle" between Android device and USB host:
Android Device <-(Bluetooth)-> InputStick <-(USB)-> USB Host (PC, laptop, game console, etc).
Applications:
I came up with several apps, for different scenarios. Some examples:
Password Manager that can type (as a USB keyboard) web page address, user name and passwords
Gamepad (works with PC and some PS3 games)
Barcode Scanner that can type scanned codes
Application that allows to execute pre-defined sequences of keyboard and mouse actions (macros)
Remote controller (keyboard and mouse)
Presentation remote
Also, I work on an API that allows to easily add support for InputStick in applications. API takes care of managing Bluetooth connection and whole USB thing. There are following USB devices already implemented: keyboard, mouse, gamepad, consumer control (volume, playback). Using for example USB keyboard in your application can be almost as easy as:
keyboard.connect();
(...) //handle some callbacks
keyboard.type("hello");
I'm interested in your opinions, suggestions and questions. If you want to know more you can visit my blog, where I post updates about development: blog.inputstick.com or inputstick.com (still under construction). Thanks for reading, if you've got this far
Works perfect. I use it with Keepass2Android in the office to easily transmit the masterpassword to Keepass for Windows. Now I hope there will be more apps that support it.

Dev for Hire?

Hi, I hope I am not violating forum rules by posting this.
I am interested in hiring a developer to create a rom for a project related to a specific series of digital audio players that are all based on relatively the same hardware and software platform. The model numbers are Pioneer XDP-100R, XDP-300R, Onkyo DP-X1 and DP-X1a. These are all running an AOSP 5.1.1 and carry very similar hardware. They are made in the same plant, by the same parent company.
The main use case for a new ROM is that these devices all include specialty audio hardware that is currently only utilized when using the bundled music player. 3rd party music players, and streaming services like Spotify and Tidal, route audio through the integrated DAC on the Snapdragon chip. It would be preferable to use the higher quality ESS Sabre DAC(s) that is utilized by the onboard music player. I have no clue at how involved this would be, but LG has done it with the V10/V20.
Would also be interested in possibly incorporating other features, most likely based on disabling services that are not required for playing music. The idea is lean and light.
If you have any insight on what would be involved in a system level change to route audio through the Sabre chip please feel free to post here. If you are interested in working on the project, please PM me.
Thanks
YES!!!!
YES!!!!
I am absolutly interested in this !!!
Im willing to contribute $ as well
A Full featured audio oriented custom rom for my xdp-300r b personally that sounds like a dream come true
Currently i use (Athame) to download Tidal songs/playlists/Albums from my personal account
theres options in settings for MASTER quality audio files,,
Simply copy paste web address of the page you want to rip music from (sharebutton:url)
into athame and it will compile and click download
easy and simple and fast....
I just hosted it incase you or anyone wants access let me know ill send a download link
PCLOUD LINK BY REQUEST ONLY
MAKE SURE TO CONFIGURE SETTING FOR USER ACCOUNT
its simple just cut paste audio tracks onto SD card
use the integrated music player and enjoy your hifi dac in all its glory
I NEVER USE XDAP THE TRANSFER WILL FAIL!!!
also heres a different idea i recently had------->
although just to let you know, porting music apps through kodi is a much more user friendly approach......
on kodi just do some research and find the audio plugins you need and install them through repo's
HERES MY FAV BUILD REPO
http:angel:://kbully.:angel:esy.:angel:es
im thinking that its possible to design an APK for android that can monitor apps and create a profile for how they decode and encode data for audio and video data,,,,
a simple plugin and widget for android that intercepts and reroutes all app audio transmission through the integrated audio hardware thus your apps like Tidal,, even netflix and youtube would not have to be modified, the audio transmission paths would simply be rerouted as if it were playing through the integrated plugin's
so instead of modifying hardware plugins and to avoid modifications to copyrighted app's
simply create a middle man diskjocky to intercept and redistribute data transmissions by lane switching and protocol interception redirection
this idea is forked from an idea i had for a bluetooth app for transmitting audio to many different speakers at once sort of like (Airfoil) either by modulating transmission across many transmission lanes at once by splitting them into thousands of bits and cloning data transmission like dealing identical cards to all players very fast like refresh rates faster than the ear can distinguish so that every speaker system gets the same audio transmission at the same time and in sync,,,,
possibly helper plugins that you install on all your devices with bluetooth hardware,,, so that when not in use they could maintain a shared connection to the host player for sharing the BT hardware so that audio could be synced and distributed to different recievers locally at a decent sync level offloading cpu needs to devices that are not being used by owners,,,,
that is also forked from an idea i had about an open source application that people would use for extreme data crunching needs by utilizing unused hardware from other users globally, like a Social Global Cloud Computing Project the data is so small individually that it is secure in the nature of data size alone thus never needing additional security updates all data would flow through micro VPN's
there are times processing power is needed and others simply have a computer or mobile device running and not in use, or not completing processing tasks of significant hardware needs,,,, imagine if anyone on any device could instantly process complex operations by sharing unused power????
at the rate network speeds are increasing cloud computing is inevitable and that will be the end to custom roms and os development,,, how do you flash a mobile device that is only a peripheral device with streaming capabilities,,, the OS firmware would be operated virtually on servers and physical user hardware would become the past............
anyways i totally had szhit to do and got stuck on here for over 2 hours typing this up loll lmao
to infinity and beyond fellow human
~Killacam~
"don't wash their mouths with soap assuming it will clean their mistakes,
expose their mouths to Dirt so that they may taste and experience their faults"
I've rooted XDP-300R and just ported TWRP over to it tonight. Seems to be working! I've already had a working build.prop mod to skip android encoding and push directly to DAC. But this hopefully allows more work without fear of bricks
https://cdn.head-fi.org/a/10245543_thumb.jpg

Categories

Resources