Index: /branches/api-cleanup/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp =================================================================== --- /branches/api-cleanup/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp (revision 811) +++ /branches/api-cleanup/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp (revision 812) @@ -646,6 +646,5 @@ unsigned int position = p->getPosition(); unsigned int location = p->getLocation(); - char byte; - + quadlet_t *target_event; quadlet_t tmpval; @@ -670,17 +669,18 @@ if ( *buffer & 0xFF000000 ) // we can send a byte { - byte = *buffer & 0xFF; - tmpval=htonl(IEC61883_AM824_SET_LABEL((byte)<<16, IEC61883_AM824_LABEL_MIDI_1X)); - -// debugOutput ( DEBUG_LEVEL_ULTRA_VERBOSE, "MIDI port %s, pos=%d, loc=%d, nevents=%d, dim=%d\n", -// p->getName().c_str(), position, location, nevents, m_dimension ); -// debugOutput ( DEBUG_LEVEL_ULTRA_VERBOSE, "base=%p, target=%p, value=%08X\n", -// data, target_event, tmpval ); + tmpval = ((*buffer)<<16) & 0x00FF0000; + tmpval=IEC61883_AM824_SET_LABEL(tmpval, IEC61883_AM824_LABEL_MIDI_1X); + *target_event = htonl(tmpval); + + // debugOutput ( DEBUG_LEVEL_VERBOSE, "MIDI port %s, pos=%u, loc=%u, nevents=%u, dim=%d\n", + // p->getName().c_str(), position, location, nevents, m_dimension ); + // debugOutput ( DEBUG_LEVEL_VERBOSE, "base=%p, target=%p, value=%08X\n", + // data, target_event, tmpval ); } else { // can't send a byte, either because there is no byte, // or because this would exceed the maximum rate - tmpval=htonl(IEC61883_AM824_SET_LABEL(0, IEC61883_AM824_LABEL_MIDI_NO_DATA)); + // FIXME: this can be ifdef optimized since it's a constant + *target_event = htonl(IEC61883_AM824_SET_LABEL(0, IEC61883_AM824_LABEL_MIDI_NO_DATA)); } - *target_event=tmpval; buffer+=8; } Index: /branches/api-cleanup/tests/streaming/teststreaming3.cpp =================================================================== --- /branches/api-cleanup/tests/streaming/teststreaming3.cpp (revision 811) +++ /branches/api-cleanup/tests/streaming/teststreaming3.cpp (revision 812) @@ -355,5 +355,5 @@ ffado_streaming_set_playback_buffer_type(dev, i, ffado_buffer_type_midi); ffado_streaming_set_playback_stream_buffer(dev, i, (char *)(audiobuffers_out[i])); - ffado_streaming_playback_stream_onoff(dev, i, 0); + ffado_streaming_playback_stream_onoff(dev, i, 1); default: break; @@ -448,8 +448,16 @@ } } - } - + for (i=0; i < nb_out_channels; i++) { + if (ffado_streaming_get_playback_stream_type(dev,i) == ffado_stream_type_midi) { + uint32_t *midievent = (uint32_t *)audiobuffers_out[i]; + *midievent = 0x010000FF; + break; + } + } + + } + ffado_streaming_transfer_playback_buffers(dev); - + nb_periods++; frame_counter += arguments.period;