Im looking for a definitive answer on getting audioRecord to use both the top mounted and bottom mounted microphones so I don't have 2 identical (mono) channels. I'd like to know what polling I could do before hand to ensure that a gadget will provide a good stream.
1) For some devices (e.g. Samsung S2 Plus GT-I9105P, HTC One M7, HTC One M8, G3 LG-D855, Nexus 5, ...) there is simply no way to activate real stereo recordings via the built-in microphone capsules. Although in some cases the camcorder app of the manufacturer produces real stereo you won't find any other app which is able to do that.
2) For some other devices, only few specific combinations of MediaRecorder.AudioSource and e.g. sample rate (or other basic settings) enable real stereo recording (e.g. Motorola Moto G needs MediaRecorder.AudioSource.CAMCORDER and 48kHz sample rate).
I recently finished integrating a docking system in my 2005 Subaru Baja for my Asus Nexus 7 (2013). Here's a write-up about my project with some pictures and a parts list for anyone looking to do something similar.
A standard car radio is fine, but what if you want more functionality out of the space in your dashboard? You can choose to install upgrade components, such as a GPS, better sound system, backup camera, even an on-board computer. But these options can cost hundreds, if not thousands, for equipment and labor. I have enjoyed using an Android tablet for some time now, and realized that all of the functionality I wanted in my car was built right into this system. So, why not integrate the tablet into the dashboard of my car instead of messing with expensive upgrades? Well, that's exactly what I've done.
I began this project quite a while ago, and spent plenty of time researching on Google and forums for similar projects, compiling ideas and parts, and learning more about the software and hardware requirements for this build.
It's hard to describe this build in words, so showing you will give you the best idea of what this Instructable is all about. Also, if you feel so inclined, subscribe to my YouTube channel. JakeOfAllTrades. I will post more videos of projects and creations in the future. Enjoy!
Okay, because this process is highly customized to the type of car and tablet you're using, as well as your personal goals and desired operation, I'll outline a rough guide for how you'll want to install a tablet into your car, and follow up with what I personally did and the challenges I faced.
To meet my goals, I decided I wanted to completely remove my car's radio in lieu of doing a tablet mounting system that connects to the head unit via Bluetooth or a headphone jack, which is what you typically see with these types of builds. I wanted my tablet to BE my head unit, thus minimizing noise and loss of sound quality, as well as reducing the amount of connections and plug ins that had to be made just to get music to play.
I wanted to use the tablet to play music, perform GPS duties, and run OBDII diagnostic information. To play music, I needed a way to get sound from the tablet to the speakers. I didn't want to use the aux port on the tablet. Here's why: I knew I would be using the micro-USB port for charging, so another connection on the opposite side of the dock sounded messy. If I could use the micro USB port for charging AND music output, along with other data output of course, that would keep things simpler and mean a cleaner installation.
Here's a quick lesson on audio signals: Traditionally, audio signals are analog, which is good because speakers require an analog signal to make sound. However, every source of data from a device is digital. This digital signal is converted in something called a DAC (digital to analog converter). When it comes to sound signals, usually a headphone jack is the DAC (the digital sound is converted to analog in the headphone port and an analog signal goes up to your headphones). Now, The Nexus 7's internal DAC is pretty weak and sound quality would suffer when played by large car speakers (I'm no audiophile, but I just wanted to do this right). However, the makers of this tablet allowed for the digital audio signal to be an output of the micro-USB port. This "USB Audio" allows the audio data to travel through digital devices, such as a USB hub, as well as being converted by something other than the headphone jack.
Once I had USB audio figured out, I needed an external DAC to allow for an analog signal to go to my amplifier. Since I was already going to be using a USB hub, a USB DAC was perfect. I went with a TurtleBeach Micro II, because it's small, cheap, and good quality. It plugs into the USB hub, which connects to the tablet, and puts out an analog signal via an Aux port. Now, to amplify the audio coming off of the DAC, I needed an amplifier. I went with the Alpine KTP-445U Power Pack. It's designed to go behind a dash or in a glove compartment. It's small and powerful, has great heat dissipation, and can be powered off of the radio's existing wiring, perfect for a seamless installation. It allows for an RCA input, which meant I needed an aux-to-RCA adapter to come off of the USB DAC. On the output side of the amp, there is a wiring harness that consists of all the wires needed to make music happen (speakers and power). I used a Subaru-specific stereo adapter to get the speaker wires and power (12V constant and 12V ignition) from the amp to match my car's stereo wiring harness. I just spliced the wiring harness off the amp to the stereo adapter wires, which essentially allowed me to plug it into the wiring loom that I unplugged from the original radio.
So, I'm getting sound out of my tablet's micro-USB port, sending it through a USB hub to a DAC, splitting it by channels, amplifying it, and sending it out to the speakers. Usually this is all done within a radio's wiring, but I had to piece it apart myself. The end result is amazing sound quality and a very clean installation of the tablet.
Next, I wanted to be able to play FM radio in my car as well as stored and internet music. This is where a DVB-T comes into play. It's a USB stick that receives FM radio and plugs into my 4-port USB hub. It comes with a small antenna that plugs into that back of the stick. But I wanted to use my car's antenna rather than have to mount a tiny antenna on my dashboard. So I used an antenna extension cable and spliced it with the male end of the DVB-T's antenna that plugs into the back. I found the antenna wire that I unplugged from the original radio I removed, and plugged in my makeshift adapter. It worked flawlessly!
I also purchased a USB flash drive to hold music and movies to plug into the hub. So, in my USB hub, there is a USB flash drive, a DVB-T stick for radio, and a USB DAC for converting the audio signal from my tablet.
To connect everything to the N7, I needed an OTG-Y cable. This allows for 1 input into the tablet (micro USB) and splits the charging side and the data side of the build. On the data side, the USB hub plugs into the female end of the OTG-Y cable. This hub holds the USB DAC for signal processing, DVB-T, and flash drive, all mentioned before. If I decide I want to install some sort of backup camera, I can use that 4th port for it. On the charging side, I have a simple USB charging cable that plugs into a USB-cigarette lighter charger. The one I used (and added to the parts list link) draws the right amount of current, and is enough to charge the tablet rather than just maintain or slow the drain on the battery. This is plugged into a cigarette outlet that I added, so as to not take up the console's cigarette outlet and have exposed wiring. I went with a two-port cigarette lighter, just in case I wanted to use the other port to charge my phone. To add the socket, I ran wiring behind the dash and steering column and into the fuse box under the steering wheel. I used an Add-A-Fuse to pull power from a switched 12V source. I used the radio's fuse, just because I knew it worked and the radio wasn't using it anymore.
I wanted all of these devices and wiring to fit neatly inside the dash where the radio used to be. So I made a plexiglass box to hold everything. I just measured the dimensions of the radio and cut the plexiglass and glued it together with silicone glue. There is a small slot in the front of the box that is just big enough for my hand, so I can access certain parts that I want to mess with, like the charging socket and the USB hub. I bought a new dash trim piece for this project, so that I could keep the radio and the stock trim piece together to return everything to stock should I sell this car. I cut up this new trim piece to fit the mounting solution.
I decided to go with a RAM mount made for 7" tablets (see parts list). I used epoxy putty to hold the mount in, and then I used the putty to fix the male end of the OTG-Y cable so that the tablet will slide into the mount and be plugged in. This mount is very secure and allows for the whole screen to be seen. It also allows me to easily install my tablet and find the plug, and then remove it whenever I'm leaving the car.
First off, you may not be able to use USB Audio, it's very software-specific. If you're using an Android device, it's software version 5.0 (Lollipop) and above comes with USB Audio native. If not, you may need to use a custom ROM or kernal that allows for it. This gets rather tricky and requires rooting the device and voiding your warranty. So, unless you have experience messing with your tablet's software like that, I would recommend you use another method to make audio work for you.
Next, the nice thing about this project is that you can vastly increase your car's functionality with applications designed for your car. For example, the Torque app allows you to install receive your car's diagnostics and engine information from a Bluetooth OBDII scanner that costs about $15. You just plug it into the OBDII port (usually under your dash on the driver's side) and connect it to the app. It's incredibly useful for engine light scans, fuel economy information, even GPS tracking. Which brings me to my next point.
3a8082e126