Pogo Dock Data Pin - Samsung Galaxy Nexus

I'm in the process of building a pogo dock using the information in this thread, but starting from scratch rather than using the code or schematics found there. The basic docking process is straightforward enough, but one thing I don't understand is how the data pin is used for audio output. This thread seems to indicate that the audio is transmitted as SPDIF through the middle pin, which seems reasonable enough. I don't currently plan on supporting audio output on my dock, but I'd like to design the hardware in a manner that would allow me to use it if I feel like it in the future. I have most of the design worked out, with only one problem. My current code is built around a state machine with the current states (currently no audio support)
IDLE -> WAKEUP_PULSE -> RESPONSE_PULSE_1 -> RESPONSE_PULSE_2 -> RESPONSE_PULSE_3 -> IDLE
The idle state waits for a posedge pin-change interrupt on the data pin to indicate that the phone has sent a wakeup pulse
In the WAKEUP_PULSE state, it debounces the data pin signal and then waits for a negedge pin-change interrupt on the data pin within a specified threshold window of 80-120ms from the initial posedge (+/- 20ms tolerance for the 100ms pulse width). If the negedge is received within the window, start sending the response, if not, return to idle.
The RESPONSE_PULSE states are simple timer interrupts to send the specified pulse times (H/L/H), then return to IDLE.
This state machine works fine as long as there's no audio. Adding audio requires 2 things. First of all, re-transmitting audio data as it is received, and differentiating between audio data and a new wakeup pulse so that the dock will properly respond the next time you insert the phone into the dock.
The first part (re-transmitting the data signal) is fairly straightforward. The second part would involve modifying the state machine to
IDLE -> WAKEUP_PULSE -> RESPONSE_PULSE_1 -> RESPONSE_PULSE_2 -> RESPONSE_PULSE_3 -> AUDIO -> IDLE
but the difficulty is figuring out how to detect when I should transition from the AUDIO state to the IDLE state. In other words, how can I detect when the phone has been undocked? I have a couple of ideas, but I don't know how the signal behaves. First of all, what state is the data pin in when you have it docked to an audio-capable dock, but it isn't actively transmitting audio? Does it tri-state the pin, or does it drive it to high or low, or does it just continue to transmit a logic 0, which, for SPDIF would look like a square wave at the data clock frequency? If it drives low or transmits a Differential-Manchester logic 0, then it would be a simple manner of enabling the internal pull-up on that pin of the microcontroller and using a watchdog timer that resets at every posedge, and if the timer runs out, then we return to idle. However, this wouldn't work if the phone tri-states the pin, because it would detect the tri-state as being the same as undocking the phone.
I don't currently have access to a logic analyzer or oscilloscope, or else I'd test it out myself. If anybody has any knowledge of this behavior, I'd greatly appreciate it.

Related

Turn sound on while charging

Hi, I prefer to have the ringer turned off and have it on vib mode, but that is a problem while it is charging and I am not near it.
Is there a program that detects when the phone is charging/in the cradle and will turn the sound on?
It would be great to have!
PhoneWeaver from SBSH can do that:
http://www.sbsh.net/products/phoneweaver/index.php?page=summary
Quote from their web page:
PROFILE TRIGGERS Events that cause a profile to became active.
Time. Up to four different hours to start and what days of week shold work can be defined per profile.
Agenda. Appointments that trigger the profile can be filtered by Status (Busy, etc.), by having atendees invited to it, by Category and by Appointment sensitivity.
Manual. For manual selection. Optionally with a defined duration after wich it expires.
Power. Any combination of external power and/or activesync connection can be defined.
PoGa

Wifi profile timer?

I'm looking for an app that can enable & disable wifi at certain times of the day/days of the week etc.
Basically so that while I'm working, my wifi is switched off to preserve battery power, but when I'm out at lunch or home in the evening the wifi is on automatically.
I looked around the site at things like wifiprofiles app, and monsterwifi app etc but unless I missed something I don't think they allow shedules for when wifi automatically switches on & off do they?
Sorry if I'm being thick or missed another option!
you should check out phoneAlarm Pro -- I've been using this for years, it is a powerhouse of control for all sorts of things -- profiles (automatically switchable) include WiFi on/off as well as Data, Ringtones, Volume, Backlight, customizable alerts, etc. I could go on and on... this is my one and only "must have" app!
oh, and of course it's skinnable! you can find plenty of skins and support in the pocketmax.net forums...
Thanks for that. Installed the demo version.
In theory it's spot on, but in practise I can't get the automatic (scheduled) profile switching to work.
I set a time for it to swap from 'Out of hours' to 'Work' and noticed my phone still shows as having the ringer on even though I set the Work profile to be silent etc.
What I don't understand is the relationship between the profiles in this software and the profiles that the phone uses normally.
Ie when installed, I can't see anything that illustrates what profile this software thinks it is currently using, just the usual volume/ringer icon at the top of the screen.
If I change the system volume with the hardware volume button for instance, does this directly influence what profile gets used on Phonealarm? Or should Phonealarm disable the system related profiles/volume control etc?
Me = a bit confused!
yeah, it can get a bit daunting at times cuz it does so much...
can I assume you're on WM 6.5 and Manila/Sense? back in the day, phoneAlarm ran as a Today screen app (still can) -- but now with 6.5/manila it can run as a 'background host' -- so you don't really see it unless you call it up. you can have an Icon 'stick' to the taskbar, but I keep mine hidden and have a key shortcut to bring up "paHost". now, depending on the skin used, you can see what profile is active as well as alarms, status, time, weather, etc...
basically, the profiles 'overtake' the WM settings -- they're still there, just set by phoneAlarm. for example, you can still change the volume as usual, but on the next profile change it will be reset per the profile's settings.
the profile schedules and the custom email/sms alarm are probably the most difficult to understand (or to get working as you'd expect) -- I would recommend downloading the 'user guide' -- it explains things far better than I could here.
lastly -- get familiar with the forum! the FAQ and Support threads cover just about everything, and "Penguin" (the developer/moderator) is really very responsive to everyone's questions and/or needs.
maybe an example would be helpful...
here's how I do it -- when I arrive at work, I plug my HD into a cradle at my desk and it (usually) stays there all day. the ActiveSync connection triggers the "work" profile, which sets volumes/tones, turns on bluetooth headset, etc. etc.
now once I unplug it -- it switches to "car" profile, as I'm (usually) now on my way home. note the "on end" setting in screenshot #2.
when I get home, I manually switch to "home" profile. this would be where you could get into location-based rules -- from gps, cell tower, etc. -- to automatically know you're home, but I don't have them set up at the moment.
then, it will switch to "night" mode at 10:00pm, turning off bluetooth, data, lowering volume & screen brightness, etc. etc.
when I get to work the next day we start all over again. (also note weekdays, as in you could do something different on the weekends)
I hope this helps you -- I think once you get the hang of it this is a truly awesome app. I'll be happy to answer any specific questions you have if I can. Good Luck!
Thanks for the assistance mate.
I think I've got the hang of it now after your posts and looking at the manual (I should have learned by now!). There's a few bits I'm not 100% certain about but it's mainly doing what I want and looks promising.
The phone is guzzling battery power since I installed it but I think I have found why. I have found that the wifi logo is visible all the time but red instead of blue, and previously this was not the case. I notice in the settings it describes toggling 'wireless lan' on or off but not perhaps in the same way as going into comm manager and selecting Wifi on or off. Not sure how I can get round but I need to make it turn off properly as it's burning my battery like the clappers!!
I like it though apart from teething problems!

EvC++ and power management(running apps during standby)

Hi guys.
I am looking for a solution,that can enable me to use some time-dependent procedures in my software,while the device is in standby mode.
The typical example is the alarm clock.
I want to develop for me a chime application,that will play the sound each hour,even tough the device "sleeps".
Can I achieve it in Embedded Visual C++ and can anyone show me the way,how to?
Thanks.
I think you should check out CeRunAppAtTime and CeSetUserNotificationEx APIs. What about telling them to launch some sort of notification application (sending a message), trigger a named event ol play your sound?
When I wrote RockClock I used the SmartDeviceFramework (OpenNetCF).
It has RunAppAtTime to run the app and wake the device and also the LargeTimerInterval which tricks the phone into thinking there's an incomming call and wakes it up from almost any state.
The largetimerinterval timer also continues to run when the device is in standby whilst normal timers are suspended until the device wakes up from standby.
Used with SetSystemPowerState it all works well.
Well,thank you for your suggestion.
Can you please provide me some working example code?
There's this one that will power on the device completly (C#):
Code:
[DllImport("coredll.dll")]
protected extern static UInt32 SetSystemPowerState(String pwsSystemState, UInt32 StateFlags, UInt32 Options);
protected static readonly UInt32 POWER_STATE_ON = 0x00010000;
protected static readonly UInt32 POWER_FORCE = 0x00001000;
SetSystemPowerState(null, POWER_STATE_ON, POWER_FORCE);
How to get system power state names: http://peterfoot.net/HowToGetSystemPowerStateNameAndFlags.aspx
CeRunAppAtTime information @ Pinvoke: http://www.pinvoke.net/default.aspx/coredll.cerunappattime
SetDevicePower information @ Pinvoke: http://www.pinvoke.net/default.aspx/coredll/SetDevicePower.html
SetSystemPowerState info @ Pinvoke: http://www.pinvoke.net/default.aspx/coredll/SetSystemPowerState.html#
Info on waking the device using notifications: http://objectmix.com/dotnet/98395-waking-up-device-specific-time-vb-net.html# - using this you can play a sound at a specific time too
Manipulating the backlight (lcd): http://blog.opennetcf.com/ctacke/2009/06/17/PreventingTheBacklightFromTurningOffInCE60.aspx
If you need to convert C# to VB.NET or viceversa then this is a handy link:
http://blog.opennetcf.com/ctacke/2009/06/17/PreventingTheBacklightFromTurningOffInCE60.aspx
Hope you find these useful...let us know how you get on. I'm knew nothing of .NET before January and learnt a lot of things used in my alarm clock from
the pages listed above.
Hello.
I remembered about this question,but I found following:
Maybe I can use this function to power device on,but my software doesn't know,when that should be powered on.
I cannot use timer,because standby mode disables timer in my app,so I cannot monitor the time (each second).
Any solution for this please?

[REQ] GPS Keepalive Tool

Getting a GPS-Fix can take a long time especially with an internal GPS receiver. If you are moving, it will even take longer to get the GPS-Fix, so when using a navi like TomTom you should wait for the fix (between a few seconds and more than 20 minutes) befor you start your trip. And when you switch of your phone (standby) or even when you close the application, the GPS module will shut off immediately. When you restart your application or switch on the phone you will have to wait to get a new GPS-fix. This will be quit fast but still annoying. I like to take geotagged pictures (footprints) but befor taking the first picture I have to wait a few minutes and if I don't keep my phone switched on all the time I have to wait another 20 seconds for each next picture.
As far as I know, there are two reasons for the GPS module to get switched of:
1. When short pressing power button (suspend state) or not useing the phone for a few minutes (unattended state) the GPS module gets switched off. This can be fixed quit easily by using these reg-keys (I am not sure if "GPS0:", "GPD0:" and "COM4:" are realy all needed?!). But this only helps if the program which uses the GPS module keeps on running even if the phone is in suspend because of the second reason:
2. When closing the last program which uses GPS, the GPS module gets switched off as well. With some programs you don't even have to close them. When you switch of your phone most of the programs (like TomTom) enter suspend state not using GPS anymore and the GPS module is shut off even if you use the reg-keys from above just because there is no program using GPS in that situation.
A small program together with the reg-keys should do the trick. This program should always run even if the phone is in suspend mode and it should interact with the MS GPS intermediat driver all the time to keep GPS alive.
Features:
- run as a service
The program should always run (hidden from taskmanager) but must not be active (keeping GPS alive) all the time.
- taskbar integration (WM6.5.x compatible)
There should be a symbol in the taskbar indicating the status of the program. Something like red for inactive, yellow for active/connecting and green for active with gps-fix. Pressing the icon should bring up a menu for activate, deactivate and config.
- Program to switch between active and inactive
With such a program it would be possible to switch the program state with an applauncher or via mortscript or you can map this program to a hardware-button. Maybe parameters like "on", "off" and "toggle" can be used with a shortcut?!
Nice to have:
- status led
Configure one of the phones LEDs as an indicator for this service. LED off = service inactive, LED blinking = connecting, LED on = GPS fix.
- auto off
User can choose after how many hours the service will deactivte itself (GPS is still usable but not always on).
- scheduler
Who needs GPS when sleeping or during work?
- multilingual
I could do the german translation!
- gps-tracking
The frequency and the location of the logfile should be configurable and there should be more parameters for the programswitcher: "trackon", "trackoff", "tracktoggle". The taskbaricon should indicate the status of the tracker as well.
- prevent suspend when switching off the phone
Programs like tomtom would keep on running even if you press the powerbutton and you could use it for audio-navigation. With the display shut off the power consumption should be much less.
These are just a few ideas I had when thinking about this program. I already searched the forum and found this interesting thread. It's the one with the reg-keys. If someone is willing to write this program he may find some useful information in that thread
Does such a program already exist? Isn't it a good idea? Will someone write this program?
PS: Sorry for my bad english!
http://www.modaco.com/content/i9x0-omnia-http-omnia-modaco-com/303583/gps-keep-alive-v1-3/
Is this what you need?
Download: http://www.4shared.com/get/s_7izPqr/GPS_Controller_CAB_v1_3.html
Looks very promissing but I still have to do a bit more testing.

Boot image in landscape mode

I've seen the method on the Tab S forum of XDA developers for amending the boot image but nothing yet for the Tab S2 8.0 (SM-T7130. Is anyone working on this?
My objective is to use my Tab S2 as a 'head unit' in my car and have it boot up in landscape mode. I've already changed the bootsamsung.qmg and bootsamsungloop.qmg with my own files and they are working fine in landscape. However, I don't know how to amend the boot image. The instructions for the Tab S don't appear to work for this model. Well, they didn't for me.
I'd much appreciate a pointer in the right direction.
Hi,
I am trying to do the same thing as you, use it as a head unit. How is it working out for you so far? Any issues?
Thank you
Nothing yet - and I'm unable to devote any time to it at the moment. Good luck with your search for a solution.
Well, I am in the design phase right now, just ordered the tablet.
Getting the boot logo in landscape mode is the least of my concern, I am more concern about everything else, specially how the tablet integrate with the rest of the hardware
checksum123 said:
Well, I am in the design phase right now, just ordered the tablet.
Getting the boot logo in landscape mode is the least of my concern, I am more concern about everything else, specially how the tablet integrate with the rest of the hardware
Click to expand...
Click to collapse
I can help with other stuff (than the boot logo 'problem') as I've set my TabS2 to provide a sort of Driver Information System (DIS) for my campervan.
Some of the changes I've made are as follows:
1. Auxiliary output from vehicle radio to 3.5mm jack on TabS2 so it can use the vehicle's excellent speakers. Bought the connector on the internet but some modern vehicles come with a connector fitted.
2. Fused electrical connection from 12V Cigar Lighter feed through 12V-to-USB (5V) mini-connector (also bought on internet) to TabS2.
3. Wifi reversing camera (GoVue RVS-020813) connected to reversing light 12V power feed. (Wifi because I didn't want to hardwire through the vehicle).
4. Created a slide-in frame on dashboard using plastic name holders, with draught-excluder tape behind to hold TabS2 off vibrating stuff.
5. Rooted the TabS2.
6. System/bin/lpm file moved sideways and replaced with one that contains
#!/system/bin/sh
su
/system/bin/reboot
which forces the TabS2 to boot when power is applied (via mini-USB connector). ie. when the vehicle is switched on and power then goes to the 12V cigar-lighter circuit and also the spur connection via the 12V-to-USB connector to the TabS2.
7. Replaced the boot animation (not boot logo) with my own animation in landscape. For which I used Samsung Theme Designer (look on Youtube for how to do this).
8. Enforced landscape mode (for post-boot animation) using the 'Set Orientation' app for those applications I have that are otherwise restricted to portrait mode (the inbuilt portrait/landscape setting doesn't work for these).
9. Bought/installed 'Sygic for Truck' navigation app.
10. Installed 'Govue' app to use with reversing camera.
11. Using 'Cronoid' app got it to fire up Sygic on boot.
12. Using 'Automagic' (premium) created flow to check for reversing camera (ie. when actually reversing vehicle, reversing camera gets power and Govue wifi pops up. This daemon checks for it). When it is detected the Govue app fires up to display the picture. This flow also checks for when vehicle stops reversing (forward gear or neutral selected); it then kills the Govue app and displays Sygic navigation.
13. To ensure everything could be controlled via the screen (a bit difficult getting to the buttons on the edges when you're driving along), I downloaded one-touch 'ScreenOff' and 'Power Off Click' icon apps for sleep and power-off, respectively. The 'Handy Soft Keys' app allows a touch at the top of the screen which will display icons to avoid using the physical buttons. The volume is easily controlled with swipe down from the top and moving the displayed slider as needed. (Note that the power cannot be switched off while there is power via the mini-USB connector, which also means that when it is being charged it will always be booted up).
The Tab S2 is a very good bit of kit. The reason for the sliding method of attachment is because it is far too useful to devote entirely to 'Head unit' duties. I use it as my everyday slate (it also means it isn't on show to potential thieves when I park up).
Was all the above necessary. It's a moot point. I enjoyed doing it. At that time I was able to spend the hours researching the techniques on the internet.
Hope this gives you some ideas.
Nice!!!
Looks like you got everything figure out, thank you for all the tips, will sure come in handy when I start the install.
I went to Best Buy to get the S2, but saw the Tab A right next to it. I finally decided to get the Tab A 10.1 inches (2016 version) which has an octacore cpu and 2gb ram/16gb rom. Unlike you I plan to use this solely in my car, so I am planning a permanent install. My dash has a big opening, so the 10.1 inch will fit nicely, I am planning to fabricate a custom bezel to mold the tab case into a metra stock bezel, might be a tight fit, but I want it to look factory when done. I have a 2015 nissan murano.
As far as the sound, I was planning on using a usb dac, since now marshmallow support usb sound, but now that you mention it, I might just use the 3.5mm jack to feed my clarion eqs755 which is then connected to my kenwood amp. This will save me from buying a DAC.
How is the sound from the 3.5mm jack compared to the usb sound with a DAC?
What are you using for bluetooth?
The wireless backup camera is a good idea, will do the same. I thought that the camera will open the app once it detects power (by you shifting to reverse), no additional app is required?
I did not want to root mine, but looks like I need to, since that is the only way to be able to use the usb port for data and charge the tablet at the same time.
I also plan to use my steering wheel connectors to control the tablet (vol+/vol-, ok google, switching between app, etc...)
Will let you know as I progress...
Would be nice to see some pics of your install.
Here are the components I bought so far:
These will allow me to tab into my existing speakers, since I added a amp:
https://www.amazon.com/gp/product/B009B8EJYU/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
Clarion eq, connects to my amp and sub:
https://www.amazon.com/gp/product/B00S7G1TW2/ref=oh_aui_detailpage_o00_s01?ie=UTF8&psc=1
Galaxy Tab A case to fabricate into my dash:
https://www.amazon.com/gp/product/B01LX4TJY1/ref=oh_aui_detailpage_o01_s00?ie=UTF8&psc=1
12V to 5V power adapter to charge the tablet and usb hub
https://www.amazon.com/gp/product/B00OHHT7ZG/ref=oh_aui_detailpage_o03_s01?ie=UTF8&psc=1
OTG cable:
https://www.amazon.com/gp/product/B00NSBVNCM/ref=oh_aui_detailpage_o03_s01?ie=UTF8&psc=1
Right angle connector for the sound:
https://www.amazon.com/gp/product/B...e_11?ie=UTF8&psc=1&smid=A04372963GF4ZZEA1VT47
To connect tablet to eq:
https://www.amazon.com/gp/product/B00DI89NPE/ref=ox_sc_act_title_10?ie=UTF8&psc=1&smid=AQJ30SX0INWVM
I plan to use this for the bluetooth, will connect it to my eq using an rca splitter, for hands free call and bluetooth streaming from phone:
https://www.amazon.com/dp/B0168GBMC...TF8&colid=218K2YEKLKIR3&coliid=I3IWHA254QICIF
I installed Tablet Talk to get my calls and text messages forwarded to the tablet. When I get a call I can answer from the tablet, but the sound will use my Bluetooth.
I wanted to use samsung own SideSync app, since I also have a samsung note 4 phone, for hands free calls, but it only works when connected to the same WIFI network. Tablet Talk works with WIFI/Hotspot and bluetooth.
https://www.amazon.com/dp/B0168GBMC...TF8&colid=218K2YEKLKIR3&coliid=I3IWHA254QICIF
For my steering wheel control:
https://www.amazon.com/dp/B0168GBMC...TF8&colid=218K2YEKLKIR3&coliid=I3IWHA254QICIF
Fleximaster said:
I can help with other stuff (than the boot logo 'problem') as I've set my TabS2 to provide a sort of Driver Information System (DIS) for my campervan.
Some of the changes I've made are as follows:
1. Auxiliary output from vehicle radio to 3.5mm jack on TabS2 so it can use the vehicle's excellent speakers. Bought the connector on the internet but some modern vehicles come with a connector fitted.
2. Fused electrical connection from 12V Cigar Lighter feed through 12V-to-USB (5V) mini-connector (also bought on internet) to TabS2.
3. Wifi reversing camera (GoVue RVS-020813) connected to reversing light 12V power feed. (Wifi because I didn't want to hardwire through the vehicle).
4. Created a slide-in frame on dashboard using plastic name holders, with draught-excluder tape behind to hold TabS2 off vibrating stuff.
5. Rooted the TabS2.
6. System/bin/lpm file moved sideways and replaced with one that contains
#!/system/bin/sh
su
/system/bin/reboot
which forces the TabS2 to boot when power is applied (via mini-USB connector). ie. when the vehicle is switched on and power then goes to the 12V cigar-lighter circuit and also the spur connection via the 12V-to-USB connector to the TabS2.
7. Replaced the boot animation (not boot logo) with my own animation in landscape. For which I used Samsung Theme Designer (look on Youtube for how to do this).
8. Enforced landscape mode (for post-boot animation) using the 'Set Orientation' app for those applications I have that are otherwise restricted to portrait mode (the inbuilt portrait/landscape setting doesn't work for these).
9. Bought/installed 'Sygic for Truck' navigation app.
10. Installed 'Govue' app to use with reversing camera.
11. Using 'Cronoid' app got it to fire up Sygic on boot.
12. Using 'Automagic' (premium) created flow to check for reversing camera (ie. when actually reversing vehicle, reversing camera gets power and Govue wifi pops up. This daemon checks for it). When it is detected the Govue app fires up to display the picture. This flow also checks for when vehicle stops reversing (forward gear or neutral selected); it then kills the Govue app and displays Sygic navigation.
13. To ensure everything could be controlled via the screen (a bit difficult getting to the buttons on the edges when you're driving along), I downloaded one-touch 'ScreenOff' and 'Power Off Click' icon apps for sleep and power-off, respectively. The 'Handy Soft Keys' app allows a touch at the top of the screen which will display icons to avoid using the physical buttons. The volume is easily controlled with swipe down from the top and moving the displayed slider as needed. (Note that the power cannot be switched off while there is power via the mini-USB connector, which also means that when it is being charged it will always be booted up).
The Tab S2 is a very good bit of kit. The reason for the sliding method of attachment is because it is far too useful to devote entirely to 'Head unit' duties. I use it as my everyday slate (it also means it isn't on show to potential thieves when I park up).
Was all the above necessary. It's a moot point. I enjoyed doing it. At that time I was able to spend the hours researching the techniques on the internet.
Hope this gives you some ideas.
Click to expand...
Click to collapse
How did you get the Tab S2 to boot on power EXACTLY? I've been trying for DAYS and i can't seem to get it to work. It's rooted and everything, tried altering the lpm file and it just shows the grey battery icon each time.

Categories

Resources