Chapter 3 NetServices API
3.7 ADS (Asynchronous Data Transmission Service)
This service provides sending and receiving of data packets (Asynchronous Data Transfer). It is divided up into Tx and Rx sections.
Typedef struct Data_Tx_Type {
byte Status;
byte Priority;
byte Tgt_Adr_H;
byte Tgt_Adr_L;
byte Data[48];
byte Length;
byte TxHandle[MAX_DATA_TX_HANDLE];
} TDataTx, *pTDataTx;
struct Data_Tx_Type DataTxBuf[MAX_DATA_TX_MSG];
// MAX_DATA_TX_MSG := Max. number of packets to be buffered
Struct Data_Tx_Type *DataGetTxPtr(void);
This function will return the next free MsgEntry. If there is no free MsgEntry, NIL will be returned.
Void DataSend(struct Data_Tx_Type *ptbuf);
This function releases a MsgEntry for being sent. In that case, status of the entry will be “ready”.
byte DataTransmit(byte priority, word tgt_adr, byte *ptbuf, byte length);
This function directly copies data into a MsgEntry and release it for being sent.
byte DataCheckTxBuffer(void);
This function checks whether there is free space in the buffer. It returns the number of available MsgEntries.
#if (MAX_DATA_EXT_DATA > 0)
byte ExtData[MAX_DATA_EXT_DATA]; // extend data (e.g. timestamp) #endif
} TDataRx, *pTDataRx;
Struct Data_Rx_Type DataRxBuf[MAX_DATA_RX_MSG];
// MAX_DATA_RX_MSG := Max. number of packets to be buffered
byte DataGetMsgCnt(void);
This function returns the number of packets which are ready to be read.
struct Data_Rx_Type *DataGetRxPtr(void);
This function returns a pointer pointing to a MsgEntry containing a packet. After finishing the access, the MsgEntry must be released explicitly.
void DataFreeRxMsg(struct Data_Rx_Type *prbuf);
This function explicitly releases the single MsgEntry.
byte DataReceive(struct Data_Rx_Type *prbuf);
This function copies data from a MsgEntry in the Rx buffer, to a local memory area and releases the entry immediately.
byte DataRxOutMsg(struct Data_Rx_Type *prbuf);
This Callback Function informs the application that there is a packet which can be read. The function must return 0x00 if the packet will be polled later on, or if it was copied via DataReceive(). If the data was read, 0x01 must be returned.
Fig 3-12 ADS application
3.8 Transceiver Control Service
This service provides functions for adjusting certain properties of the MOST Transceiver like its logical address or group address. These functions are provided that are used in timing masters only.
void MostSetNodeAdr(word adr);
This function provides setting of the logical address of the MOST Transceiver.
void MostSetGroupAdr(byte group_adr);
This function provides setting of the group address of the MOST Transceiver.
byte MostGetNodePos(void);
This function provides reading of the current node position of the MOST Transceiver.
Chapter 4
Network Multimedia Applications
In this chapter, we will develop multimedia applications of a MOST network.
4.1 Multimedia Control
As shown in Fig4-1, there are Radio Tuner 4 MOST, DVD Player 4 MOST, MOST PCI Board, and Amplifiers 4 MOST on the MOST network. According to the MOST Protocol, DeviceID.FBlockID.InstID.FktID.OPType.Length(Data), we can implement our control programs with AMS NetServices API.
Fig 4-1 MOST network topology
Fig 4-2 Picture of MOST network
4.1.1 DVD Player 4 MOST Control Program
As shown in Fig 4-3, the DVD Player from OASIS SiliconSystems is a MOST device offering a real-time interface to distribute Video and Audio streams from a broad range of media including CDDA and DVD via a MOST network.
Fig 4-3 Picture DVD Player 4 MOST
The Table 4-1 and Table 4-2 below are parts of MOST DVD Player Manual.
Error ErrorCode, ErrorInfo Table 4-1 Function Format [10]
Basic datatype
Range of values Code Description
0x00 Play 0x01 Stop 0x02 Pause 0x03 Load 0x04 Unload
0x05 Search Forward 0x06 Search Backward 0x20 Slow Motion Forward 0x21 Slow Motion Backward Enum 0x00..0x23
0x23 PreStop (play resumes at old position) Table 4-2 Parameter of DeckStatus
Each control button in Fig4-4 can be implemented with NetServices AMS API. The Table 4-3 contains the mapping of control buttons and corresponding MOST
protocols.
Fig 4-4 DVD Player 4 MOST Control Program
action DeviceID FBlock InstID FktID OPType Length Data
Play 0x198 0x34 0x00 0x200 0x00 1 0x00
Stop 0x198 0x34 0x00 0x200 0x00 1 0x01
Pause 0x198 0x34 0x00 0x200 0x00 1 0x02
Load 0x198 0x34 0x00 0x200 0x00 1 0x03
Unload 0x198 0x34 0x00 0x200 0x00 1 0x04
Search
Allocate Table 4-3 Protocol Mapping of DVD Control Program [10]
4.1.2 Radio Tuner 4 MOST Control Program
The Radio Tuner 4 MOST from OASIS SiliconSystems is implemented using a single OS88350 Radio Controller 4 MOST to support all control functions and signal processing necessary to build a high quality AM and FM stereo car radio tuner. The Fig 4-5 shows the picture of Radio Tuner 4 MOST.
Fig 4-5 Picture of Radio Tuner 4 MOST
Each control button is shown in Fig4-6. The “AM” and “FM” buttons are used to switch the wavebands. The user can adjust the frequency by “Incr” and “Decre”
buttons. The “Allocate2” and “Deallocate2” buttons are used to allocate or de-allocate the real-time channels for radio voice. The “Search Up” and “Search Down” buttons can be used to auto-scan the frequency upward or downward. Each button can be mapped to the MOST Protocols as shown in Table 4-4.
Fig 4-6 Radio Tuner 4 MOST Control Program
action DeviceID FBlock InstID FktID OPType Length Data
AM 0x180 0x40 0x00 0x200 0x02 3 0x0100
02
FM 0x180 0x40 0x00 0x200 0x02 3 0x0100
01
Allocate2 0x180 0x40 0x00 0x101 0x02 1 0x01
Deallocate2 0x180 0x40 0x00 0x102 0x02 1 0x01
Incr 0x180 0x40 0x00 0x200 0x03 1 0x01
Decre 0x180 0x40 0x00 0x200 0x04 1 0x01
Search Up 0x180 0x40 0x00 0x204 0x00 1 0x04 Search
Down
0x180 0x40 0x00 0x204 0x00 1 0x0A
Table 4-4 Protocol Mapping of Radio Tuner 4 MOST Control Program[11]
4.1.3 Amplifier 4 MOST Control Program
The Amplifier 4 MOST is implemented using a single OS88558 amplifier controller to do all processing necessary to transport audio information between a MOST network and external speakers. The Fig 4-7 shows the picture of Amplifier 4 MOST.
Fig 4-7 Picture Amplifier 4 MOST
The control program is shown in Fig 4-8. It can be used to connect the real-time audio channels on a MOST network and adjust the volume of external speakers. The mapping MOST Protocols are shown in Table 4-5.
Fig 4-8Amplifier 4 MOST Control Program
action DeviceID FBlock InstID FktID OPType Length Data
Vol3 0x188 0x22 0x00 0x400 0x00 1 0x32
Connect 0-3
0x188 0x22 0x00 0x111 0x00 6 0x01
0x01
0x00 ~
Table 4-5 Protocol Mapping of Amplifier 4 MOST Control Program [12]
4.2 Listen to the Radio
The Fig 4-9 shows the procedures to listen to the radio on a MOST network. First, allocate synchronous channels and connecting the Radio Tuner 4 MOST as input, as shown in Fig 4-10. Second, connect to MOST 4 Amplifier as output. This step is shown in Fig 4-11. Then we can turn on volume and listen to radio by Radio 4 MOST Control Program as shown in Fig 4-12 and Fig 4-13.
Fig 4-9 Flow diagram of “Listen to the Radio”
Fig 4-10 Application 1-1
Fig 4-11 Application 1-2
Fig 4-12 Application 1-3
Fig 4-13 Application 1-4
Wave File on a MOST Network
de to a MOST network. As ,
Fig 4-14 Transport wave steam to a MOST network [13]
Fig 4-15 Application 2-1 4.3 Playing
This application transports wave stream from the PC si
shown in Fig 4-14, the wave file is transformed to the wave stream by Wave Parsar and feeds to a MOST network. The Fig 4-15~ Fig 4-18 shows the steps to play the wave stream on a MOST network.
Fig 4-16 Application 2-2
Fig 4-17 Application 2-3
Fig 4-18 Application 2-4
4.4 Capture Mpeg-2 Stream by MOST Capture
In this section, we will introduce how to get the Mpeg-2 program stream from the DVD Player 4 MOST to the PCI board on PC and playing the mpeg-2 video on the PC Windows. There are two procedures. First, allocate the A/V Composite channels for DVD Player 4 MOST, then connect the output channels to the MOST PCI board.
This part is achieved by MOST NetServices API. The procedure is shown in Fig 4-5.
Second, decode the Mpeg-2 stream and play it on PC Windows. This part can be achieved by the Microsoft NetShow API.
4.4.1 Mpeg-2 Transportation
To transport the Mpeg-2 stream from DVD Player 4 MOST to MOST PCI Board, the sixteen synchronous channels should be allocated by the DVD Player. After channels are allocated, the program should connect the output channels to MOST PCI board.
This can be done by SCS NetServices API. After these steps, the mpeg-2 stream is transported from the DVD Player to MOST PCI Board. The Fig 4-19 shows the flow diagram of Mpeg-2 transportation. Fig 4-20 ~ Fig 4-23 shows each step in the control program.
Fig 4-19 Transport Mpeg-2 stream from DVD Player 4 MOST to MOST PCI Board
Fig 4-20 Application 3-1
Fig 4-21 Application 3-2
Fig 4-22 Application 3-3
Fig 4-23 Application 3-4
4.4.2 Decode and Playing Mpeg-2 Stream on PC Windows
After receiving the Mpeg-2 stream from the MOST network, the program should demultiplex the Mpeg-2 stream, which will separate the video and audio stream. The program feeds the audio stream to Mpeg-2 Audio Decoder and the video stream to Mpeg-2 Video Decoder, then output audio data to the DirectSound filter to play the sound and output video data to the Video Render filter to show the video on PC Windows. The block diagram is shown in Fig 4-24.
Fig 4-24 Decode and Play Mpeg-2 Streaming
The property of MOST Capture should be properly configured. As shown in Fig 4-25.
The channel number should be set to the value as the same as allocated channel number. The channel width should be set to 16 Bytes since the number of allocated channels is sixteen. Also the property of Mepg-2 Demultiplexer should be properly configured as shown in Fig 4-26. “stream_id” and “Content” of the output pins should follow Mpeg-2 standard [14] [15]. Fig 4-27 shows the picture of captured Mpeg-2 video.
Fig 4-25 MOST Capture Property Setting
Fig 4-26 Mpeg-2 Demultiplexer Property Setting
Fig 4-27 Picture of Mpeg-2 video
Chapter 5 Conclusion
The application of MOST technology in multimedia automobile network has been explored in this thesis. There are many benefits for adopting MOST technology instead of traditional vehicle bus system. Due to the high bandwidth requirement of the multimedia and integration of different protocols in car electronics, MOST defines a standard from the lowest hardware layer to the highest application layer to help car vendors to develop their own MOST devices. For speed consideration, MOST supports two physical transmission interfaces which are Plastic Optical Fiber (POF) and Unshielded Twisted Pair (UTP). The speed can reach 24.8Mbps with POF and 50Mbps with UTP. MOST also has flexibility in network topologies. It supports direct point-to-point, token ring, star, rings incorporating splitters connections. There can have up to sixty-four devices on each MOST network. This greatly reduces the connection overhead. In each MOST network, there is a timing master which generates a synchronous bit stream to provide the synchronization of the other timing slaves. To avoid the transmission overhead, MOST supplies resource share service.
Every node on the MOST network can simultaneously share resource from the single source. For example, a CD player can send the audio stream to two or more amplifiers to play the sound at the same time. MOST also supports Plug and Play, this provides the convenience of expansion and maintenance. MOST system supports a variety of data types such as control data, packet data and synchronous stream data to accommodate different transmission demands. The control data contains the control message which often indicates some operation of controlled device. The packet data contains the non-real-time information. The synchronous stream data is available for the real-time information like the audio or video stream. The asynchronous data and
synchronous data share the same bandwidth. The arrangement of bandwidth is controlled by the timing master. In the application level, MOST defines Function Blocks (FBlock) and Function (FktID)…etc. Function is used to control the device or access the property of the device. A function block contains a set of functions. A MOST device may contain several function blocks. Every device contains a mandatory function block called NetBlock which contains the functions that affects the entire device. For communication between devices, MOST defines MOST protocol. By MOST protocol, every device can exchange messages and data via the network services provided by the network layer. MOST defines several network services for management of the entire MOST network and data transmission. The MOST Supervisor Service (MSV) is used to manage the states of MOST device. The Control Message Service (CMS), Application Message Service (AMS), and Remote Control Service (RCS) are used to handle the control messages. The Synchronous Channel Allocation Service (SCS) and Transparent Channel Allocation Service (TCS) can manage the routing path of stream data. The Asynchronous Data Transmission Service (ADS) supports the transmission of packet data. The Transceiver Control Service provides the access the low level MOST Transceiver.
The application of MOST technology in this thesis uses only one part of MOST NetServices API. For other similar applications, we can extend our program by adding the PDA or the Bluetooth device like Wireless Mobile Hand Free Car Kit and applies it in the automobile environment.
REFERENCES
[1] Website of MOST Cooperation:
http://www.mostcooperation.com/technology/index.php
[2] 郭長祐, “車用電子之多媒體傳控網路:MOST 技術,” April 04, 2004 Website:
http://tech.digitimes.com.tw/ShowNews.aspx?zCatId=135&zNotesDocId=682
AC814E4CE9A048257156005C846C
[3] MOST Cooperation, “MOST Specification Framework Rev. 1.1,” 1999.
[4] MOST Cooperation, “MOST Specification Rev 2.2,” Nov. 2002.
[5] MOST Cooperation, “MOST NetServices: Application Socket, User Manual and Specification Rev1.10,” Jan. 23, 2004.
[6] MOST Cooperation, “MOST Function Catalog, V2.0,” Oct. 2000.
[7] MOST Cooperation, “OS 8104 MOST Network Transceiver, Final Product Data Sheet,” Sep. 2006
[8] Oasis SiliconSystems, “MOST NetServices Licensing Policy,” May 17, 2005.
http://www.smsc-ais.com/files/mostnetservices/PFL-MOSTNetServicesLicensing _V01_00_XX-1.pdf
[9] Oasis SiliconSystems, “MOST NetServices Layer 1 User Manual/Specification Rev. 1.10.x,” Jan 23, 2004.
[10] Oasis SiliconSytems, “DVDPlayer 4 MOST User Manual, V1.2.0,” Oct 13, 2003.
[11] Oasis SiliconSystems, “RadioTuner 4 MOST User Manual, V1.0.0,” August 22, 2003.
[12] Oasis SiliconSystems, “Amplifier Controller 4 MOST Advanced Product Data Sheet,“ Jun. 2003.
[13] Microsoft, “DirectX 9.0 Documentation for C++,“ 2002.
[14] ISO-13818, “Information Technology - generating coding of moving pictures and associated audio information - Systems, Second edition,” Dec. 1, 2000.
[15] Dr. Gorry’s web site:
http://erg.abdn.ac.uk/research/future-net/digital-video/mpeg2-trans.html.