Specifications
failing. The pause button was then pressed again to undo pause and the player stated
producing music from the point it left off.
The first test proved to be more successful then those that followed. The problems was
that the buffer would sometimes empty after play was resumed. This would cause a gap
in the music and a blip could be heard most times when the play was resumed.
The initial reason suspected for this was the transfer was stopped at an undetermined
buffer size on the player. Sometimes the buffer could be close to empty when pause is
activated. When play is resumed the player starts playing immediately from that state.
This means that as soon as the software triggers the interrupt to feed the decoder the
buffer can quickly be reduced before there is any immediate increase in data from the
network. To prevent this, when play is activated again the decoder interrupt is no longer
software triggers straight away. Instead, the program is set back to the state of refilling
the buffer. It will then receive the MP3 data from the network into the buffer and when
the buffer gets full again the interrupt to feed the decoder is triggered in software. This
has the effect of stopping the audio immediately but only restarting the audio when the
buffer becomes full again. The testing of this was much better; the buffer didn’t empty
and there were negligible delays as a result of the buffer topping up after the play button
was pressed. The ‘blip’ sound still persisted but it was not due to the buffer because it
never emptied. At this stage it was becoming difficult to see what was causing the blip.
It seemed that there was data corruption somewhere but there was difficulty analysing
where. The test data was generally music and it was hard to hear if any significant data
was being lost.
5.3.7.2 Stop Button.
A change in the design approach was required. Implementation switched to the stop
function, because this would place the song back to the start, making it easier to tell
what was happening. The stop button was implemented the same as the PAUSE button
but it sent the STOP command to the server and reset the buffer pointers (transmit and
receive) back to the beginning, clearing the buffer of the current data that was no longer
needed. On the server side, when it received the stop command it disabled the sending
cycle as before, but this time it also called the openMP3 function with the same song
47










