2. System architecture
• PXA
– 7-segment: commnication time
– lcd screen: communication text
– Microphone: voice record
– Keypad: patterns and voice recording
2
3. System architecture
• Kernal functions
– Pthread: server, recever, keypad
– Timer: 7-segment counting
– Socket: communication
– Mutex: lock socket, users’ data
3
4. System architecture
4
4
User 1 User 2
send
send receive
Internet
LCD
LCDkeyboard
keyboard
audio output
audio output
receive
microphone
microphone
keypad
keypad
7 segment 7 segment
5. User BUser A
Socket problem
• Socket
– Peer-to-peer communication
– Client and server have the same port number
– Can not be used for multi-user communication
without central server
5
server
client
server
client
6. User BUser A
Socket problem
• Solution
– Sever -> receive and server, client -> send
– Sever uses static port number N but receiver and
sender use dynamic port number
6
server
sender
receiver
server
sender
receiver
User A turn off his server and his sender uses port number N to
send a request with his receiver port number to user B. User B
askes his group that user A can join or not.
If yes, user B sends ‘OK’ as ACK to user A; if not, user B sends ‘No’
as ACK to user A.
7. User BUser CUser DUser A
Socket problem
• Solution
– Sever -> receive and server, client -> send
– Sever uses static port number N but receiver and
sender use dynamic port number
7
server
sender
receiver
server
sender
receiver
User B sends group information to user A through user A’s
receiver port number.
User A sends his information to every member of the group; then,
user A joins the group.
8. User BUser A
Socket problem
• Solution
server
sender
receiver
server
sender
receiver
User D
server senderreceiver
User C
server senderreceiver
9. Codec problem
• Codec
– Codec_record
• Recod 4 seconds voice to an inner buffer
• Need to give 4*sample rate
– Codec_play
• Display the inner buffer
– Can read the inner buffer
– Can not write the inner buffer
9
10. Codec problem
• Codec
– Codec_record
• Recod 4 seconds voice to an inner buffer
• Need to give 4*sample rate
– Codec_play
• Display the inner buffer
– Can read the inner buffer
– Can not write the inner buffer
10