BeagleBoard AVB Stack - GSoC - Weekly Reports

Hello everyone,

This is the first weekly report for the beagle board GSoC project “Beagleboard AVB Stack”.

This week is the first of the three weeks assigned for the implementation of the gPTP module. Apart from the implementation of gPTP, this week was also intended for the set up of the project environment. The tasks completed this week are listed below,

On the project environment set up front:

=> The Linux kernel for beagle board was cloned to “https://github.com/induarun9086/beagleboard-linux
=> Successfully built the kernel version “4.4.66-ti-r99”.
=> Deployed the new linux via a SD-card.

On the gPTP implementation front:

=> A new lodable kernel module (gptpd) was introduced at the path /drivers/gptp/
=> Configuration and make files are adapted to make the new module build along the kernel.
=> Basic IEEE 802.3 frame transmission and reception from within the module implemented and tested.
=> pDelayReq gPTP command transmission implemented.

The gPTP module is currently built as a lodable kernel module (gptpd.ko) which is inserted and removed from the kernel using the commands insmod, rmmod etc…
To test the implementation made until now the following set up is used. The beagle bone black is connected to a PC running Ubuntu via a cross ethernet cable. The tcpdump command is used in the Ubuntu machine to monitor the ethernet commands sent from the beagle bone black.

Challenge(s) faced:

=> To set up static IP on the beagle bone. The normal method is to edit the file /etc/network/interfaces. But in the beagle bone debain environment this has to be
done via the connman tool which took some time to figure out as I was not aware of this tool.

The current task I’m working on is to get the hardware timestamps for the sent gPTP commands using the linux kernel time stamping options “SO_TIMESTAMPING”. As this week was sent mainly of research and set up, the actual software implementation was a little lagging. But this can be caught up in the coming weeks as the upcoming tasks are only pure software coding with no other dependencies. The upcoming tasks are listed below

=> Implementation of the Peer to peer delay measurement.
=> Best master selection algorithm implementation.
=> Set up synchronised PTP clock.

Hello Everyone,

This is the second weekly report for the beagle board GSoC project “Beagleboard AVB Stack”.

The planned task for this week is the continuation of the gPTP implementation. Keeping with the plan the gPTP implementation is in progress.

=> The Peer to peer delay measurement feature is completed. The points to note in the delay measurement feature are listed below.

→ It is tested with a bbb connected to a linux PC running ubuntu using a cross cable.
→ The bbb uses the hardware timestamping supported in the am335x
→ And the linux PC uses simulated software timestamps
→ To be tested with 2 bbbs connected via a cross cable running the same gPTP daemon.
→ An average delay of 50μs was observed and a delay variance of around 20μs was observed.
→ I hope these numbers will be improved when using 2 bbbs (both using hardware timestamping)

The current task I’m working on is to implement the best master selection algorithm to decide upon the current mode of operation (master/slave). The further tasks that follow are listed below

=> Implementation of sending, receiving and processing the time information for time synchronization.
=> Set up the synchronized gPTP clock and wrap up gPTP implementation by next week.

Hello Everyone,

This is the third weekly report for the GSoC project “Beagleboard AVB stack”. At the end of this third week the implementation for the gPTP deamon had reached a basic working status. The status and results for the individual features are listed below.

→ Setup of 2 BBBs connected via cross ethernet cable is done and testing is done with this setup.
→ Delay measurement results in range of 400 - 500 ns observed between the 2 BBBs.
→ Best master selection algorithm consistently selects one of the BBB as a grandmaster device.
→ After the clock synchronization, an error in the range of 20 - 150 us is observed.

More testing is required to confirm the consistency and stability of the delay measurement and clock synchronization. And may be some optimization is required to reduce the time synchronization error down to single digit micro seconds.

Issues/Improvements:

This is the fourth instalment of the weekly report for the GSoC beagle board AVB stack project. The plan was to start the design and implementation of the audio driver and more specifically to start the implementing the Stream reservation protocol of the AVB stack. The current status and the upcoming tasks are listed below,

Status:

  -> Improvements are done for the clock synchronization for gPTP.
  -> Now I can see improved synchronization errors in the range of hundreds of nanoseconds to some tens of micro seconds.
  -> Started to design the ALSA audio driver required to implement the AVB streaming (using the synchronized clock).

Next Tasks:

  -> Start coding for the ALSA audio driver for AVB and setup a barebones driver at first.
  -> Start implementing the Stream reservation protocol inside it to start streaming.
  -> Setup the hardware required (audio cards) to output the streamed audio via ethernet AVB to speakers.
Weekly report for the GSoC beagle board AVB stack project for week 5. The plan for the current week is to continue the implementation of stream reservation protocol after setting up the ALSA audio driver for AVB. With this plan in hand the current status and the next tasks are listed below,

Status:

   -> A bare bones ALSA virtual driver for AVB is created (based on the virtual loop back driver given in the kernel)
   -> When this kernel module is loaded via insmod a new AVB audio device shows up in the list of playback/recoding device list.
   -> Started implementation of the stream reservation protocol.
   -> The github repository for the AVB AlSA driver is: [https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c](https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c)

   
Next Tasks:

  -> Complete the implementation of the Stream reservation protocol by this week.
  -> Start the implementation for the IEEE Std 1722-2011 for streaming audio through the AVB driver.
Weekly report for the GSoC beagle board AVB stack project for week 6. The plan for the current week is to complete the implementation of stream reservation protocol. With this plan in hand the current status and the next tasks are listed below,

Status:

   -> Stream reservation protocol implementation is not yet completed although it is near (around 90%), testing pending.
   -> As the Stream reservation protocol had several sections (applicable for both bridges and endpoints) it took some time to extract the required specifications applicable only for endpoints.
   -> Also this week I have started interfacing an Audio card to bbb to stream the analogue audio out after receiving it through AVB (for testing purposes).
   -> The github repository for the AVB AlSA driver is: [https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c](https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c)

Next Tasks:

  -> Catch up and complete the implementation of the Stream reservation protocol as soon as possible.
  -> Start the implementation for the IEEE Std 1722-2011 for streaming audio through the AVB driver.
  -> Set up the analogue audio card driver.

Weekly report for the GSoC beagle board AVB stack project for week 7. The plan for the current week is to start the IEEE Std 1722-2011 (AVTP) implementation for streaming audio through the AVB driver. With this plan in hand the current status and the next tasks are listed below,

Status:

→ Stream reservation protocol implementation is completed, testing pending.
→ I will test the stream reservation protocol implementation alongside the AVTP streaming once a basic AVTP implementation is done.
→ AVTP streaming implementation started and I have also read through the ALSA APIs needed to be implemented for this.
→ For the CTAG face2|4 audio card I have built the compatible kernel and could load the audio driver.
→ The github repository for the AVB AlSA driver is: https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c

Next Tasks:

→ Finish a basic AVTP streaming by this week (basic in the sense without synchronization).
→ Set up the test environment with 2 bbbs for audio streaming and test both SRP and AVTP.
→ To merge my current kernel repo with the CTAG face2|4 audio driver supported kernel repo.

Weekly report for the GSoC beagle board AVB stack project for week 8. The plan for the current week is to continue the IEEE Std 1722-2011 (AVTP) implementation for streaming audio through the AVB driver. With this plan in hand the current status and the next tasks are listed below,

Status:

   -> AVTP streaming implementation for transmission via the ALSA driver is completed.
   -> I tested this by playing a wav file with aplay and received the Ethernet frames with tcpdump in my test laptop.
   -> AVTP streaming implementation for reception via the ALSA driver is started and I plan to finish by this weekend.
   -> The github repository for the AVB AlSA driver is:[ https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c](https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c)

Next Tasks:

  -> Finish a basic AVTP streaming by this week (basic in the sense without synchronization).
  -> Set up the test environment with 2 bbbs for audio streaming and test both SRP and AVTP.
  -> To merge my current kernel repo with the CTAG face2|4 audio driver supported kernel repo.

Weekly report for the GSoC beagle board AVB stack project for week 9. The plan for the current week is to complete the IEEE Std 1722-2011 (AVTP) implementation for streaming audio through the AVB driver. With this plan in hand the current status and the next tasks are listed below,

Status:
→ AVTP streaming implementation for transmission via the ALSA driver is completed, reception implementation is 90% completed.

→ I have tested the basic sequence of both the playback and recording of the AVB ALSA virtual driver via aplay and arecord accordingly.
→ Transmission and reception of the synchronized presentation time from the gPTP is pending.
→ The github repository for the AVB AlSA driver is: https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c

Next Tasks:
→ Wrap up implementation in the next few days and start testing, debugging and documentation.
→ Set up the test environment with 2 BBBs and a test PC to test the time synchronization.
→ To merge my current kernel repo with the CTAG face2|4 audio driver supported kernel repo.

Weekly report for the GSoC beagle board AVB stack project for week 10. I am now in the final three weeks planned for testing, debugging and documentation. The current status and next actions are listed below.

Status:
→ Implementation part is almost completed. (The minor missing parts will be improved as part of bug fixing).
→ SRP and streaming through the ALSA virutal driver for AVTP is also tested for basic operation.
→ Although basic streaming is working, there are still some issues with timing and I am currently working to improve these.

Next Tasks:
→ Setup a demo application and test setup to test the synchronization part of the streaming.
→ Bug fixing and improvements.
→ Detailed documentation.

Weekly report for the GSoC beagle board AVB stack project for week 11. Now in the final weeks planned for testing, debugging and documentation. The current status and next actions are listed below.

Status:
→ Testing ongoing. Tested AVB streaming (without synchronization) between 2 beagle bone blacks.
→ Found some bugs in the testing and fixed. General improvements also done after testing.
→ Started implementation of a test application to test the synchronized AVB streaming.
→ Test application: https://github.com/induarun9086/avbtest
→ Added some documentation in the github repositories.

Next Tasks:
→ Complete the test application and test synchronized AVB streaming.
→ Bug fixing and improvements.
→ Detailed documentation.

Weekly report for the GSoC beagle board AVB stack project for week 12. The final week for the GSoC program and the final status is summarized below.

→ Implementation completed, all the software has been pushed to their respective repositories.
→ gPTPd: https://github.com/induarun9086/gPTPd
→ AVB ALSA Virtual Driver: https://github.com/induarun9086/beagleboard-linux/blob/4.4/sound/drivers/avb.c
→ Test Application: https://github.com/induarun9086/avbtest
→ Tested the demo set up with “AVB Test application” + “AVB ALSA driver” + “gPTP Demon”.
→ Test results and other information are documented in the wiki link below:
http://elinux.org/BeagleBoard/GSoC/BeagleBoneAVB
→ Currently occupied with some extended testing and clean of source code (i.e. adding comments / removing logs added for debugging etc…)