This information is important for the completion of the EMBS 2013 assessment so please ensure you've read the entire page. Please note that this is a complex assessment involving many bespoke components. Inform Neil Audsley or Ian Gray if any problems are noticed and we will correct them as soon as possible. If you don't have access to headphones contact one of us and we will arrange some.

Ensure you are using the latest version of The EMBS Development Pack.

Frame format

The following frame format will be used by the EMBS server.

Item
Size (bytes)
Description
Destination MAC address
6
The server uses the broadcast address FF:FF:FF:FF:FF:FF
Source MAC address
6
The server's MAC address, 00:11:22:44:00:00
Ethernet Type
2
Set to 0x55AA for EMBS
Stream ID
2
See table below
Sample rate
1
See table below
Sample width
1
See table below
Reserved
1
<Reserved>
Reserved
1
<Reserved>
Index
4
The index (from 0 to the end of the channel) of the first sample in the frame.
Length
4
Length in bytes of the data section
Data
<variable>
The samples, one after the other, up to length bytes

All numbers are big-endian.

Sample rates are encoded as follows:
Sample rate
Encoding
8000Hz
1
11025Hz
2
22050Hz
3
44100Hz
4

The sample width byte denotes the following:
Sample width
Meaning
1
Samples are unsigned bytes, 0-255
2
Samples are signed shorts, -32768 to +32767

Currently streaming channels

The current channels are being streamed by the server. These will change as the assessment progresses to add more streams, but this table will be kept up to date. Each channel broadcasts looping audio data. The index field of each frame can be used to determine where in the loop the current audio data belongs.

Channel
Description
Sample rate
Sample width
1
Sine
8000Hz
8bit
2
Square
8000Hz
8bit
3
Sawtooth
8000Hz
8bit
4
Mario medley
8000Hz
8bit
5
Misc music
8000Hz
16bit
6
Vision On
11025Hz
8bit
7
New Born
22050Hz
16bit
8
I'm sorry
44100Hz
16bit
9
Mario64 (Lead)
22050Hz
16bit
10
Mario64 (Alt Lead)
22050Hz
16bit
11
Mario64 (Rhythm)
22050Hz
16bit
12
Hotel California
11025Hz
16bit
13
Let It Be
22050Hz
8bit
14
She's Electric
44100Hz
8bit

Outputting audio

First ensure that you have an audio amplifier board and that it is connected to your EMBS board as shown:

audio.JPG

This board contains an amplifier and stereo audio jack into which you can plug headphones or speakers. You can send audio samples to the board from Handel-C using this function in vlab.hch:
void dac_write_to_output(unsigned 4 addr, unsigned 12 data);
The Microblaze cannot write to the audio board.

The digital to analogue converter (DAC) you are using is the Linear Technology LTC2624, a 12-bit DAC with 4 channels. Only channels 0 and 1 are connected to the headphone jack in the audio board. To output an audio sample, use the dac_write_to_output function. Set addr to either 0 for left, 1 for right, or 0xF to output to all channels simultaneously (good for debugging). data should be set to the output value required.

IMPORTANT TIPS

  • You need to have sent at least one message from your FPGA board before the Ethernet switch will connect you to the correct network. You might not be able to see any EMBS messages until you've correctly sent a frame. Use the MAC addresses that were assigned to you in the Advanced Microblaze practical. Also, don't just send the message right away as switch negotiation can take a few seconds and you'll have to transmit after that.

  • All channels broadcast simple PCM samples, meaning that the values should be simply output directly one-by-one to the audio hardware.
    • This should be done at the appropriate sample rate.
    • Signed samples, however, are between -32768 to +32767 and will need to be converted to unsigned (0 to 65535) first.
    • 16-bit samples are too wide for the 12-bit audio DAC. Drop off the bottom 4 least-significant bits.
    • You will need to buffer incoming audio data to ensure smooth playback. It is up to you where and how to do this, and you will have to experiment to see how large your buffers are required to be.
    • The FPGA has 20 BlockRAMs that are shared between the Microblaze and Handel-C. You can change the default balance. Refer to this page - Setting the amount of code space for the Microblaze.

  • Your Handel-C clock is 50MHz. You can use this to time how long to delay between samples.

  • The BlockRAMs on the FPGA are dual-ported. This means that they can support two read/write ports into the same data, rather than normal RAMs which only have one. This lets you, for example, use one port for writing data whilst another port simultaneously reads data. This is built using the mpram construct in Handel-C. Consult the Handel-C help files if you need this.