<<

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

SMART PC: NEW APPROACH IN HANDHELD DEVICES

Haris Chokkalingam, MSEE, Naveen Baskaran, MCIS, Santosh Tankala, MCIS, Cleveland state university, Cleveland state university, Cleveland state university, Cleveland, Ohio Cleveland, Ohio Cleveland, Ohio

Instructor: Dr. Chansu Yu Professor and Chairman Electrical and Computer Engineering Cleveland State University, Ohio

1

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Table of contents S No Topic Page Number 1.0 Abstract 4 2.0 Introduction 4 3.0 Smart PC and Why we need it? 4 3.1 Android overview 4 3.2 5 3.3 Experiencing UNIX IN smartphones 5 3.4 What is Doing Nowadays? 6 4.0 Implementation 6 4.1 6 4.1.1 OS specifications 6 4.1.2 Post installation OS update 7 4.1.3 External Browser installation 8 4.1.4 Installing Native application 9 4.1.5 Programming with C 9 4.1.6 Simple game in terminal 10 4.1.7 Playing with Python 11 4.2 Andromium OS 12 4.3 AndroLinux OS 12 4.4 Complete Linux Installer 13 5.0 How and why to access Android root? 14 6.0 Performance measurements 15 6.1 Performance commands 15 6.2 Smart network switch/wi-fi assist 16 7.0 MHL Cable 17 7.1 ADV 7480 17

2

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

7.2 MHL/HDMI detailed view 18 8.0 Baby Monitoring system 20 8.1 Sound 20 8.2 Workflow of Audio part 20 8.3 Measuring the sound in room 21 8.4 Program Execution detail 21 8.5 Debian Mail delivery system 21 8.7 List of problems 22 9.0 Future Work 22 10.0 References 23

3

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

1.0 ABSTRACT Computers and computing are fundamental in human environment. Millions of operations are carried out in every minute. But computers are big in size compare to the mobile devices. Our motto is to establish the computing operations in mobile devices on top of the mobile OS Android platform. Moreover, we are planning to establish the feasibility, compatibility, user friendliness with different Unix platforms against different Android versions and providing the educational applications with usage of outdated mobile hardware and operating systems. As per our implementation, we have enhanced sound recognition system for capturing the sound variance in living room and sends an alert via an email or messaging system using python. 2.0 INTRODUCTION Nowadays, technology is changing rapidly and the using of hardware is reduced in size compare to olden days. Personal computers turned into handheld devices and making everything possible in the real time. Handheld computers are user friendly to the human community, still there is a drawback in mobile operating systems to use like a computer. Our new challenge is making handheld devices using UNIX operating systems. This paper explains the experimental observations on using Samsung Galaxy S3 and Debian (No root) UNIX . Debian no root installs Debian 7.0 Wheezy on your Android device, an 'old stable' version of Debian will still receive security updates and we can precede install OS through APT (Advanced Package Tool). The paper explores of installation of Debian and its requirement like storage, hardware specification, RAM memory, and system performance, installation of the new updates, browsers and C programming using GCC complier. Additionally, it explains the drawbacks and encountered problems (which will be rectified and displayed with solutions in upcoming presentation). Another major feature, Sound recognition system is used to capture the sound variance in living room and sends an alert via an email or messaging system. For an example: A child is in bed room and parents are in the television room, if the child awakes and makes a noise (crying or not) our sound recognition system will notify the parents through the subscribed channel. As part of our project we are using email communication system and the development this application is in progress. 3.0 SMART PC AND WHY WE NEED IT? Smart PC is known as Mobile devices using Personal computer operating systems which could serve all the facilities like personal computers. This change will impact in of lower income community people, who are not able buy computers in society. It also changes technology impact in achieving all requirements in mobile devices and reduced usage of desktop and laptop computers in future. 3.1 ANDROID OVERVIEW Android is the based on which is an American company a Google corporation. It most commonly comes been installed and used on different models of smartphones and tablets which is from different manufacturers but offering some default users access to Google’s own services like google Search, Video Streaming, google Maps, Gmail and more. The phones android OS are highly customizable and modified based on the user need and requirements; it also have some UI based customization like changing wallpapers, live themes and different launchers which can completely make a new look of your devices interface. As like our calendar in systems phones also have different option like remainders etc.,

4

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Fig 1.0 Android architecture

Moreover, Android phones where used by more than 87.7 million people in the United States and 1.5 billion worldwide. In 2019, it’s expected to be 2.08 billion by worldwide. Different versions of Android rolled out in the market till today and version 7 (Nougat) is ongoing process of development 3.2 UNIX Unix is been used in traditional way such as multitasking, different computer user on operating systems that can also drive with different OS like AT&T UNIX which is developed in Bell Lab’s research center in 1970 by Ken Thompson, Dennis Ritchie, and others UNIX is developed using C programming language as base and it’s different from other operating systems like Windows and Mac (iOS). Also, the file system is entirely different and it stores everything as a file. If it’s not file, it’s called as process. Unix OS Storage partition is classified into two types; Data partition and swaps partition and its uses directories, links and special file for indexing the storage location. Most important UNIX and Linux systems are open source and supported by different developers from different regions. 3.3 EXPERIENCING UNIX IN SMARTPHONES Our project is to implement UNIX based operating systems like Andromium, Debian, red hat and Ubuntu in the handheld devices on top of Android operating systems. The implementation includes the process of exploring Hardware compatibility manufactured by different manufactures, with operating systems compatibility per installed Mobile operating systems in the hardware, performance of dual operating systems and developing a simple game and installing educational software and their access. Project Implementation method

 Different UNIX OS vs different manufacture  Analyzing Hardware requirements, storage and memory utilization  Performance of the Available each Android version  Developing a game  Installing available education applications  Identifying bottlenecks

5

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

The primary goal of selecting old mobile cellphones is to reduce and recycle the old mobile phones. As per survey USA has 70% heavy metals are in landfills by electronic wastes in a year. 3.4 WHAT UBUNTU IS DOING NOWADAYS? Ubuntu released new beta version of Linux OS based smartphones in European markets for 50 users to experience the user friendly, hardware compatibility. Upon successful run on markets Ubuntu will become challenging for Windows, Android and Apple manufactures. But Ubuntu OS project is not a dual boot in the same hardware device. We planned to experience dual boot in the same hardware devices using Android platforms. 4.0 IMPLEMENTATION Hardware Specification

Mobile Version Samsung Galaxy S3

Android Version 4.3

Input Device Wireless keyboard, Wireless mouse

Cables HDMI, MHL, VGA Table 1.0 Hardware specifications

4.1 DEBIAN Debian OS – Our initial implementation was done with Debian OS with no root option. Your Android phone is already powered by the goodness of Linux, but you can enhance it further and make better use of its multi-core processors and oodles of RAM by running a full-blown Linux distro alongside the existing mobile OS.

We can install Linux for several purposes, for example, use it to power a LAMP that can run web apps and serve web pages. If you're a network admin, you can install your favorite Linux tools and turn the smartphone into a portable network troubleshooting or pen-testing device.

The LinuxOnAndroid project produces an Android app and a couple of shell scripts, and hosts a bunch of Linux distros that you can boot using the app. In a , the scripts mount the Linux image within the Android filesystem and the SD card within the Linux filesystem.

They then call on chroot to change the root directory to that of the mounted Linux and open up a shell for you to interact with the mounted Linux system. The scripts also set up SSH for secured remote access, along with VNC to allow you to access this Linux system's graphical desktop.

4.1.1 OS Specification

 Debian version 2.  Mobile need to have minimum 900 MB of free space  Initial OS file installation size is 211 MB  Time to install = Less than 5 mins

6

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

 Initial installation unpacks 191 OS specified files (You can minimize the application when OS is installed) 4.1.2 Post installation OS update After installing Debian, it will automatically set the resolution based on the mobile display specification. Debian will have list of monitor resolution specification (e.g. 1024x720, 1128x920 and so on...). If the mobile doesn’t have any of the listed resolution, then it will automatically choose nearest value. In this case, we can’t expect the display to be that accurate in mobile as well as in HDMI output. Below is the list of aspect ratio which is available in Debian (almost 95% of mobile resolution falls under this category).

Fig 2.0 Different resolutions in Debian OS After all the setup is done the OS need to be updated. The update will fix all existing issues. We have two terminals in Debian OS, i) Root terminal – This is administrative terminal (Super privilege user) which is used to execute the command for any admin level changes. Any command which is executed in this interface will make change in root folder (which is the OS folder for Linux OS). Non-admin users won’t be able to execute any command with this terminal. To install they need admin password or admin can do for them.

Fig 3.0 Debian OS Homepage display in mobile device

7

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

ii) Terminal – Normal command prompt which is used by the active user to make changes in the specific user related applications and folders. To update below command, need to be executed in root terminal (a black screen like command prompt in windows). Before executing this command, the user need to point to root folder.

-get update

This command will check each file with the server and update accordingly. 4.1.3 External Browser Installation Debian by default has a web browser which has limited support and we are facing some issue with the current OS version we installed. So, we tried installing third party browsers Iceweasel which is a Mozilla extension for Debian OS and Chromium. i) Chromium – Open source browser derived from the source code of . Chromium is not supported with the OS version. Command to install chromium is

apt-get install chromium chromium- l10n

ii) Iceweasel – A Mozilla browser extension for Debian. Command to be executed to install Iceweasel. Total size of Iceweasel - 100MB

apt-get install iceweasel

Browser access As we know browsers can be used for multipurpose and we tried accessing our email account, playing online games, online buffering of videos, etc.

Fig 4.0 browser installation

8

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

4.1.4 Installing Native application

Installing application can be done by terminal or Debian application installer.

i) Terminal – We need the executable file that need to be installed with list of steps. This type of installation will have lot of privacy checks.

ii) Debian application installer – this application installer is same like play store in android or in iOS. Developer will upload their application in the Debian supported format and user can install the application from installer. For games Debian has a separate interface which lists all the available games to install. Command to get the application

apt-get install playonlinux

Fig 5.0 Application installer 4.1.5 Programming with C (educational use) To compile and run a C program we need to GCC (GNU Compiler Collection). GCC also supports C++ and FORTRAN. To install GCC we use apt-get update && apt-get upgrade apt-get install build-essential

To verify the installation run the commands whereis gcc gcc –v make -v

Post installation of GCC below is the sample execution of a C program and its output.

9

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Fig 6.0 Hello world C program and its execution 4.1.6 simple game in Linux terminal A game in which two players seek in alternate turns to complete a row, a column, or a diagonal with either three O's or three X's drawn in the spaces of a grid of nine square.

Fig 7.0 Execution steps

10

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Tic tac game: C source program

11

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Source code 1.0 Gaming program 4.1.7 Playing with python

Python is a extensively used high-level language, and also a general-purpose, interpreted, dynamic programming language. Its design attitude highlights code readability, and when compared to C++ or java or with much other programming language in the market python is one the fewer line programming language. The language provides constructs intended to enable writing clear programs on both a small and large scale.

We have installed Python programming language and its ide environment in the Debian Linux system using following command apt-get update python apt-get install idle

Fig 8.0 Display python in terminal and IDE 4.1 Andromium OS Andromium OS – This OS is not supported with the hardware we are using. The minimum Android version is v5.0 (Lollipop). 4.2 AndroLinux OS: AndroLinux provides you a system with a GNOME kind of desktop setup that is composed entirely of free and open-source application. It also provides a spontaneous interface. It is reckless, secure and with thousands of apps to choose from. It is based on the Fedora and Centos OS.

12

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Fig 9.0 Home page of AndroLinux

The features and main mechanisms are inherited from an OS called Linux Fedora:

 Open source operating system.  A shell is to use a special interpreter program which intern can be used to execute commands which was provided to operating system. It can be used to do various types of operations for e.g. To call or invoke the application program  Better security, no helplessness to infection and malware invasion. Office programming to make proficient records, spreadsheets and presentations.  Tools to alter your photographs or make proficient outlines and plans.  Utilities to stay up with the latest with your companions and partners rapidly and effectively.  Hundreds of diversions.  Tools to edit your photos or create professional illustrations and designs.  Utilities to stay up with the latest with your companions and partners rapidly and effectively.  Hundreds of diversions.

This app is an access to a Linux that is run remotely.

4.3 Complete Linux installer: Complete Linux Installer is another solution of installing the Linux platforms in the Android mobile by accessing the heart(Root) of the system. The current version of complete Linux installer will help us to install Fedora, Ubuntu, openSUSE, Debian, ArchLinux, in the mobile by mapping the image file of the operating systems to the application. This application requires a rooted phone, armv7 processor (it does not work on lower versions), RAM memory (More memory, more fast) and the kernel which supports loop devices. We worked on the installation of Ubuntu 13.0 in the root kernel unfortunately we faced some image corruptions and we figuring out the root cause of the failure. But we failed with installation of Ubuntu 13.0 with image corrupted error and Kali Linux does connected to the auto launch system. Moreover, we have rooted the android mobile though there is no improvement in installation process.

13

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Fig 10.0: Display of root access (Left), Linux version’s and Terminal with error(Right) 5.0 HOW & WHY TO ACCESS ANDRIOD ROOT Establishing your telephone or tablet gives you finish control over the framework, and that power can be abused in case you're not cautious. Android is outlined in a manner that it's difficult to break things with a restricted client profile. A super client, in any case, can junk things by introducing the wrong application or rolling out improvements to framework documents. The security model of Android is in like manner exchanged off to a particular degree, as root applications have fundamentally more access to your structure. Again, you ought to be careful what you present. Root strategies are here and there chaotic and risky. You may block your gadget basically attempting to root it, and you've most likely (actually) voided your guarantee doing as such. Contingent upon the organization, you may in any case have the capacity to get a gadget repaired in the event that you harm it endeavoring a root, yet that is not a certification. Is rooting illegal? No. Technically, it once was, but exceptions to the DCMA have made it legal for most phones Will rooting void my warranty? Yes. Unlocking your bootloader will void the warranty on your phone, even if your manufacturer provides a way for you to do it. If you need to climb a warranty of any failure/damaged hardware, you can sometimes un root your phone and take it in for service with no one the wiser. Application used to Root (Kingo Andriod Root): As a Samsung lead demonstrate, Samsung Galaxy S III (S3, GT-I9300) has been the top root gadget in Android Rooting gathering is taking a shot at this for quite a while and still they are working. Among many establishing strategies, KingoRoot - APK Root for Android is the most basic yet compelling one. It gives an all-inclusive a single tick root involvement for Android clients, which is likewise simple to utilize and spares clients a considerable measure of inconvenience to associate with PC by means of USB Cable. Accessing root steps: 1. Download and install Kingo Andriod Root into PC 2. Connect your mobile to the PC using USB cable. 3. Open Kingo Andriod Root 4. The Application will automatically detect your phone start processing your grabbing the root access. 5. The accessing revoking process percentage status in PC and as well as in mobile. 6. Upon completion, your root access is granted for user and mobile is installed with KingoLink, SuperSu, SuperUser and RootChecker applications. 7. Open Root Checker to verify the root access. (Fig 16)

14

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Fig 11.0 Root CheckerApp in Mobile

6.0 PERFORMANCE MEASUREMENT’s: 6.1 Performance commands We are working on getting the performance of different OS with multiple applications running the device. Instead of using a manual approach we tried few Linux commands to get the system response of different device with different configuration. Below is the important list of commands used to measure the performance and other network monitoring systems.

Add - on/ Command Use Necessary Application This the main command used to measure the Top Linux performance frequent by administrators NO

Used to display statistics of virtual memory, VmStat kernel threads, disks, system processes, I/O blocks, interrupts, CPU activity and much more NO

Network Packet Analyzer - Most generally utilized charge line organize parcel analyzer or Tcpdump bundles sniffer program that is utilized catch or channel TCP/IP bundles that got or exchanged YES(install on a particular interface over a system tcpdump)

Network Statistics - Netstat is a summon line apparatus for checking approaching and active Netstat system parcels measurements and interface insights NO

Real Time IP LAN Monitoring – IPTraf is an IPTraf open source console-based real time network (IP LAN) monitoring utility for Linux. YES (install iptraf)

Table 2.0 performance commands

15

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Other area which we are focusing now is to make this mobile as TCPDUMP – used as a command line network packet analyzer or sniffer that is mainly used to filter or capture TCP/IP packets that were transferred on a specific network interface. This also have a functionality of saving the captured packages in a file for later reference and analysis.

VmStat – Which is used to trach the virtual memory of the system, kernel threads, disks, system processes, I/O blocks, interrupts, CPU activity and few others. This can be executed and monitored in different ways,

1. Run for X second/ number of intervals and stop the execution. (e.g. vmstat 3 5) 2. Run for specified timestamp (e.g. vmstat –t 1 5) 3. List active and inactive service of the system (e.g. vmstat –a) 4. We can also monitor disk statics (e.g. vmstat –t)

Fig 12: System Performance

Fig 13: Vmstat 6.2 Smart network switch/Wi-Fi assists: Smart Network Switch (Auto network switch) is a feature from the 4.3 Android phones and Wifi assist in iPhone’s that allows your phone to automatically switch between WiFi and the mobile network, if/when it determines your WiFi connection is "unstable", or slow, it automatically switches to mobile data instead.

16

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

This permits the telephone to keep up an abnormal state of web network if your Wi-Fi association is too ease back to give a decent client encounter.

While this can give a superior web involvement, it can imply that you utilize a greater amount of your included information remittance. It is set to off as a matter of course, however in the event that you need to turn it on/off.

If you’re mobile data is disabled for some reason or no SIM is inserted in the device, then there is no need for the "smart network switch" - the framework can just utilize Wi-Fi for information associations and has esteemed this element unusable/superfluous. You might need to take a stab at reaching your portable supplier to ensure versatile information is accessible and working.

Fig 14: Wi-Fi Advance settings page in Android mobile 7 MHL (Mobile High-Definition Link) CABLE 7.1 ADV7480

A band of electronics companies including Sony and Nokia developed MHL — short of Mobile High- Definition Link — in 2010 to connect a growing list of smartphones, tablets, and other devices which can be compatible HD TVs available in the market. MHL’s main use comes by way of plugging a smartphone or tablet into a compatible HDTV or A/V receiver. MHL remains very alluring are the reality a link won't cost you dearly. The links typical cost shifts between $15 to $30.

Fig 15.0 MHL Functional Block diagram

Technology used by MHL’s cable:

17

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

USB Type C: The MHL Consortium developed and published MHL Alt Mode for the superMHL™ and MHL® 1, 2 and 3 specifications are used to enable the output delivery of audio, video, data, and also power. Devices adopting MHL Alt Mode over the USB Type-C™ connector will have the capacity to interface with more than 750 million MHL gadgets. This extensive and assorted environment incorporates cell phones, tablets, TVs, screens, vehicle infotainment frameworks, AVRs, Blu-beam players, set-best boxes (STBs) and that's only the tip of the iceberg. Since MHL link can be utilized as a part of either approaches to interface the information yield, there’s won’t be any wrong way to plug-and-play! MHL Alternate Mode for USB Type-C enables devices to support simultaneous MHL® audio/video plus USB 2.0 and/or USB 3.1 Gen 1 or Gen 2 data and power charging over the USB Type-C™ connector.

SuperMHL: To bolster 8K@120fps and propelled sound/video highlights, MHL built up the superMHL connector which is utilized convey simultaneous sound, video, information, and power all in a thin, reversible, purchaser amicable plan. Supercharge your home theater involvement with superMHL! The superMHL determination will be accessible from January 2015.

Fig 16.0 Features comparison between different MHL versions

7.2 MHL/HDMI CABLE - ADV7480 (Analog Device) A DETIALS VIEW: MHL ADV7480 is the combination of both MLH/HDMI receiver which is targeted to receive uncompressed digital audio and video signal from smartphones and other MHL supported electronic devices.

MHL (Mobile High-Definition Link) ADV7480:

MHL 2.1 can receive 75 MHZ of maximum pixel clock frequency. It allows the resolution of about 720p/1080i at 60 Hz in 24-bit mode. This cable has a feature called link control bus (CBUS) which is used to handle translation layer, link layer, display data channel (DDC) and electrical discovery. I2C or

18

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Serial peripheral interface (SPI) bus is used to handle MHL sideband channel (MSC) commands. INTRQ3 is a dedicated pin which is used to indicate CBUS related events have occurred.

HDMI (High-Definition Multimedia Interface) ADV7840:

HDMI receiver which is capable of supporting maximum of 162 MHz of maximum pixel clock frequency and it also allows HDTV formats up to 1080p. The display resolution of this is up to UXGA (1600 x 1200 at 60 Hz). This cable integrates a device of customer electronic control (CEC) which is supported for capability discovery and control features (CDC). The input port of HDMI has a dedicated pin which is of 5V detect and hot plug.

Transition minimized differential signaling (TMDS) which will ensure that the operation is not interpreted when long cables is used. This cable is also capable of accepting HDMI as wells as MHL electrical signals. CD_SENSE pin is used to differentiate the signal between MHL and HDMI. Component processor is specifically used to receive video signals and process it. We can have the features added with this are brightness, contrast adjustment and saturation adjustment. It also enables timing adjustment controls for HS/DE/VS timing.

ADV7480 has an input/output port which is of 8-bit and used for resolution up to 720/1080i for both input and output videos. This will be done in 8-bit interleaved 4:2:2 SDR and DDR modes. It also provides flexible audio output port. It has an advanced audio functionality such as mute controller which is used to prevent audible extraneous noise. Additionally, it has output time division multiplexing (TDM) which allows transmission of eight multiplexed serial audio channels on single audio output interface port. It is programmed in such model which is compatible of I2C with features of 2-wire, serial, bidirectional port. In general, it has two versions one is automotive and second is industrial.

Detailed Block diagram of ADV7480 (MHL/HDMI):

19

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Fig 17.0 Detailed MHL block diagram 8 BABY MONITORING SYSTEMS:

8.1 Sound:

Sound recognition system is used to capture the sound variance in living room and sends an alert via an email or messaging system. For an example: A child is in bed room and parents are in the television room, if the child awakes and makes some noise, our sound recognition system will notify the parents through the subscribed channel. As part of our project we are using email communication system

20

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Fig 18: Sound recognition system code

21

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

8.2 Workflow of Audio Part:

PyAudio gives Python ties to PortAudio, the cross-stage sound I/O library. With PyAudio, you can without much of a stretch utilize Python to play and record sound on an assortment of stages. PyAudio utilizes Event-driven approach (at whatever point an occasion is happened the flag is sent from the equipment to the collector which has asked for the occasion) to perceive the sound. Occasion driven is no concurrent model and this approach spares memory and power by decreasing the calculation cycles.

We will read chunk of raw data through microphone (For now through an audio file) and will check whether the sound exceeds the ambient noise (Research has shown generally a baby cry is above 130dB). For project, we have set it as 20dB. Analyze library will check for loudness and pitch and if the noise exceeds above 20dB it will trigger an email.

We created another process to trigger the email so that it won’t affect any other process, even if e-mail system crashed for an occurrence due to some reasons the main process will be alive and will wait event to trigger and it resumes the e-mail communication.

8.3 Measuring the sound in room: To achieve this, we should implement the following libraries from python: 1) Pyaudio 2) Analyze

PyAudio gives Python ties to PortAudio, the cross-stage sound I/O library. With PyAudio, you can without much of a stretch utilize Python to play and record sound on an assortment of stages. So, using this library we can open the audio stream and able to read the chunk (ex 1024 bytes) of audio data in while loop continuously to analyze the audio data. Using python analyze library we can perform analysis on it and measure the loudness of recorded chunk of audio data. If its greater than specified threshold. Then we try to detect the baby movement.

8.4 Program Execution Details:

 pyAudio is developed by MIT.  pyAudio() method is used to access the port Audio.  Once the Port audio is initialized, we need to open the stream using open() method.  The audio stream chunks of data can be read using read() method and it should be in blocking mode. ( For now we are using readframes() to read the audio file).  analyse.loudness() is used to analyze the decibels of the sound. If the loudness is greater than the threshold value we’ll start a timer and then an email is sent.  smpt protocol is used to send email from the machine.  The sender and receiver emails are initialized  Multipurpose Mail Extension (MIME) type is initialized to plain text or picture format.  sendmail() method is used to send the email once the event is triggered.  The timer is run for 15min and as the alert is already sent; even if the baby makes noise in this 15 min no duplicate emails will be sent.  Close the stream using close() method.  terminate() method is used to terminate portAudio.

22

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

8.5 Debian Mail delivery system

Fig 19: Sample e-mail communication 8.7 List of problems faced while implementing: 1. Missing Drivers: We can implement python and execute the program in the computer but not in the Debian OS because of missing drivers in mobile operating system. We tried installing available GNU drivers though we are not successful. 2. Jack Port daemon – Not running Jack is the low latency audio server daemon for GNU operating systems. It is used to connect many numbers of audio devices with operating system. The jacked is available in the Debian OS but it’s not running in mobile versions since the OS does not have super user privileges. 3. User privileges and authentication Debian OS with NO root has very limited features and permissions to the mobile operating systems. Due to insufficient access, we are unable to access the internal and external storage space, IO- Queue. 4. Video drivers Debian OS does not come up with video drivers to access the camera of the phone/device. We installed GNU software’s OpenCV for accessing the video devices but its working only with desktop based versions. 5. GMAIL access The e-mail communication is another big challenge in implementing this system. Accessing the Gmail server via the application is not successful. We have allowed the access privileges by changing the Gmail settings manually in the Gmail application. 6. Detecting loudness sound

23

CIS 632 Project: Smart PC Report -6 Dec 07, 2016

Measuring the sound (loudness) of child in the living room is become quite challenging. We figured out the GNU video library and implemented the analyze library (analyse.loudness()) to measure the loudness above 100db. 7. Pylab installation Pylab is the library in python which is used for this application. To access this library, we need to install numpy, scipy and matplotlib additional libraries. We are unsuccessful in installing those modules in Debian due to its limited access privileges. 9.0 FUTURE WORK We are planning to work on an application which is used to detect and alert the user with in a certain area of focusing using the camera/motion capabilities. This application can be used to many safety and security purpose. E.g. it can have used to monitor a child if you are busy with some other work. So, if an object/child moves out if the sensing area the application will alert the user. Also, we planned to explore more Desktop Unix features in mobile based versions with dual implementation of Linux and android.

10.0 REFERENCES 1. https://en.wikipedia.org/wiki/Android_(operating_system) 2. http://www.ubuntu.com/phone/devices 3. https://www.android.com/history/#/marshmallow 4. http://www.dummies.com/consumer-electronics/smartphones/droid/looking-at-the-android- operating-system/ 5. https://en.wikipedia.org/wiki/Android_(operating_system) 6. http://www.ubuntu.com/phone/devices 7. https://www.android.com/history/#/marshmallow 8. http://www.dummies.com/consumer-electronics/smartphones/droid/looking-at-the-android- operating-system/ 9. http://www.digitaltrends.com/home-theater/what-is-mhl-and-how-does-it-work/ 10. https://play.google.com/store/apps/details?id=org.dandroidmobile.androlinux&hl=en 11. http://www.mhltech.org/consumer.aspx#connect 12. Dual Mode HDMI/MHL Receiver 13. http://www.extremetech.com/mobile/211314-extremetech-explains-why-you-should-or-shouldnt- root-your-android-device 14. http://lifehacker.com/5789397/the-always-up-to-date-guide-to-rooting-any-android-phone 15. https://pypi.python.org/pypi/PyAudio 16. www.speedguide.net/faq/what-is-the-android-smart-network-switch-feature-430 17. https://www.verizonwireless.com/support/knowledge-base-145796/ 18. http://www.conanhughes.com/2014/01/how-to-disable-auto-network-switch-on.html 19. https://wiki.debian.org/ChrootOnAndriod 20. https://pypi.python.org/pypi/PyAudio 21. http://www.programcreek.com/python/example/52624/pyaudio.PyAudio 22. https://en.wikipedia.org/wiki/Motion_capture 23. https://en.wikipedia.org/wiki/Speech_recognition 24. https://www.quora.com/What-algorithms-are-good-candidates-for-sound-recognition 25. http://linuxonandroid.com/about/

24