From 4505373ea8e5c8b50faa22dd688dd21c47979fe8 Mon Sep 17 00:00:00 2001 From: moret Date: Mon, 28 Jul 2008 12:27:08 +0000 Subject: [PATCH] Add empty NetAdapter codeblocks project git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2747 0c269be4-1314-0410-8aa9-9f06e86f4224 --- Readme_NetJack2.txt | 15 ++++++---- common/JackNetDriver.cpp | 14 ++++++---- windows/Readme.txt | 4 +-- windows/Setup/jack.ci | 1 + windows/jack_netadapter.cbp | 56 +++++++++++++++++++++++++++++++++++++ 5 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 windows/jack_netadapter.cbp diff --git a/Readme_NetJack2.txt b/Readme_NetJack2.txt index 85347b45..7376d4fe 100644 --- a/Readme_NetJack2.txt +++ b/Readme_NetJack2.txt @@ -3,7 +3,7 @@ NetJack for Jackmp ------------------------------- This branche includes a version of netjack designed for jackmp. -This prerelease is far from being complete and doesn't include some of the features proposed by netjack (no transport yet). +This prerelease is far from being complete and doesn't include some of the features proposed by netjack (transport isn't completely working yet). Indeed, the original concept has been completely redesigned to better fit to the jackmp architecture, but also in order to provide additional capabilities, and ultimately a greater robustness. This document describes the major changes between those two systems, then a simple how-to for setting up a basic usage of 'netjackmp'. @@ -51,7 +51,6 @@ Current limitations The netjackmp's development has just started. This prerelease is operational, but involve some serious limitations : - You can't set the bitdepth of the transmitted audio samples. Floating point values are used for now. The possibility to use 16 or 24bits data will be included soon, like in netjack. It's important to notice that change the bitdepth id very expensive in processing ressources (because it is a sample to sample operation). - The 'inter-slave' communication is not optimized yet. If you connect one slave to another, the network streams go through the master. While sending network addresses to the slaves when they are inter-jack-connected, we could make the slave possibly independant of the master (except for the synchronization, sent over the network). This is the next step of the netjackmp development. -- Because of the current development, the parametering of the whole system is minimalistic. - Unlike netjack, this version doesn't include transport, this is naturally planned for the fully operational version. - The 'Audio Adapter' is not completely working, there are several improvements to do. @@ -71,14 +70,18 @@ Then, load the network manager using jack_load : 'jack_load netmanager' This will load the internal client, which will wait for an available slave (see the message window on qjackctl - or the console output). +If you want to listen to a specific multicast socket, you can add some options. To spicify a complete command line, you can use : +'jack_load netmanager -i"-a xxx.xxx.xxx.xxx -p udp_port"' +If you set another multicast address or port, you have to set the same on the slave's side. The default value should be working in many cases. On the slave, just launch a new jack server using : -'jackd -R -S -d net' +'jackd -R -d net' -The '-S' (synchronous) option is mandatory. Indeed, the jack server isn't able to deal with the current cycle produced audio data because when the 'send' is called, data are not necessarily already available. So in a given 'n' cycle, the server will send the data produced at the 'n-1' cycle. -In this case, there is no effect on latency because all the subcycles of the slave (the previous 4 subcycles for instance) are run in the given master's cycle. -You can specify some options, like '-n name' (will give a name to the slave, default is the network hostname), '-C input_ports' (the number of master-->slave channels), '-P output_ports' (the number of slave-->master channels), default is 2 ; or '-i midi_in_ports' and '-o midi_out_ports', default is 0. Don't use '-a address' and '-p port', these are here to specify others multicast address and port, but it's not implemented on the master yet. +As in a standard backend in Jackmp, you can use '-S' (synchronous mode). +The asynchronous mode (without '-S') allows to send the computed data during the next cycle. You loose a one cycle extra latency, but you improve the masters while allowing it to receive data just after having sent some. In synchronous mode, data are sent back at the end of the cycle, that means after the process. +You can specify some options, like '-n name' (will give a name to the slave, default is the network hostname), '-C input_ports' (the number of master-->slave channels), '-P output_ports' (the number of slave-->master channels), default is 2 ; or '-i midi_in_ports' and '-o midi_out_ports', default is 0. +If you set multicast address or port on the master, you can add '-a xxx.xxx.xxx.xxx' and '-p udp_port'. ------------------------------- diff --git a/common/JackNetDriver.cpp b/common/JackNetDriver.cpp index 700cb4a0..e98442ce 100644 --- a/common/JackNetDriver.cpp +++ b/common/JackNetDriver.cpp @@ -536,6 +536,10 @@ namespace Jack for ( audio_port_index = 0; audio_port_index < fCaptureChannels; audio_port_index++ ) fNetAudioCaptureBuffer->SetBuffer ( audio_port_index, GetInputBuffer ( audio_port_index ) ); +#ifdef JACK_MONITOR + fMeasureId = 0; +#endif + //receive sync (launch the cycle) do { @@ -556,7 +560,7 @@ namespace Jack do { rx_bytes = Recv ( fParams.fMtu, MSG_PEEK ); - //error here, problem with send, just skip the cycle (return -1) + //error here, problem with recv, just skip the cycle (return -1) if ( rx_bytes == SOCKET_ERROR ) return rx_bytes; if ( rx_bytes && ( rx_head->fDataStream == 's' ) && ( rx_head->fID == fParams.fID ) ) @@ -591,7 +595,7 @@ namespace Jack fRxHeader.fCycle = rx_head->fCycle; #ifdef JACK_MONITOR - fMeasure[0] = ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f; + fMeasure[fMeasureId++] = ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f; #endif return 0; } @@ -616,7 +620,7 @@ namespace Jack fNetAudioPlaybackBuffer->SetBuffer ( audio_port_index, GetOutputBuffer ( audio_port_index ) ); #ifdef JACK_MONITOR - fMeasure[1] = ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f; + fMeasure[fMeasureId++] = ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f; #endif //sync @@ -630,7 +634,7 @@ namespace Jack return tx_bytes; #ifdef JACK_MONITOR - fMeasure[2] = ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f; + fMeasure[fMeasureId++] = ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f; #endif //midi @@ -670,7 +674,7 @@ namespace Jack } #ifdef JACK_MONITOR - fMeasure[3] = ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f; + fMeasure[fMeasureId++] = ( ( float ) ( GetMicroSeconds() - JackDriver::fBeginDateUst ) / ( float ) fEngineControl->fPeriodUsecs ) * 100.f; fMonitor->Write ( fMeasure ); #endif diff --git a/windows/Readme.txt b/windows/Readme.txt index 68871ed9..d43e5182 100644 --- a/windows/Readme.txt +++ b/windows/Readme.txt @@ -11,7 +11,7 @@ The built binaries will be located in '/Release/bin' (or '/Debug/bin' if you bui - the two 'libjackmp.dll' and 'libjackservermp.dll', client and server jack libraries - the 'jackdmp.exe', main application : the jack server - the 'jack_xxx.exe' utilities and examples -- in the jackmp directory, you'll find the driver's DLL's ('jack_portaudio.dll' and 'jack_netdriver.dll') and some tools ( 'netmanager.dll' for example ) +- in the jackmp directory, you'll find the driver's DLL's ('jack_portaudio.dll' and 'jack_netdriver.dll') and some tools ( 'netmanager.dll', 'audioadapter.dll', 'netadapter.dll' for example ) In Code::Blocks all the projects are automatically built in a correct order (dll's then apps) by doing 'build->build workspace'. In VC6, you'll have to build the projects one by one. @@ -41,7 +41,7 @@ You can use two drivers : PortAudio and NetDriver. The PortAudio backend allow the use of many soundcards, using ASIO or WMME drivers (any ASIO driver can be seen by PortAudio). The NetDriver allow you to use NetJack2 on windows. Thus you can easily exchange midi and audio streams bitween computers (Linux, MacOSX or Windows). In both cases, you have to use the minimalist : - 'jackdmp -R -S -d ...' + 'jackdmp -R -d ...' command. With PortAudio, you can have a list of supported drivers with : 'jackdmp -R -S -d portaudio -l' diff --git a/windows/Setup/jack.ci b/windows/Setup/jack.ci index 17039fe5..e624c04f 100644 --- a/windows/Setup/jack.ci +++ b/windows/Setup/jack.ci @@ -73,6 +73,7 @@ <_>..\Release\bin\jackmp\jack_portaudio.dllinstjackmpovernewer0 <_>..\Release\bin\jackmp\netmanager.dllinstjackmpovernewer0 <_>..\Release\bin\jackmp\audioadapter.dllinstjackmpovernewer0 +<_>..\Release\bin\jackmp\netadapter.dllinstjackmpovernewer0 <_>..\..\common\jack\control.hinstincludes\jackovernewer0 <_>..\..\common\jack\intclient.hinstincludes\jackovernewer0 <_>..\..\common\jack\jack.hinstincludes\jackovernewer0 diff --git a/windows/jack_netadapter.cbp b/windows/jack_netadapter.cbp new file mode 100644 index 00000000..58d50e6f --- /dev/null +++ b/windows/jack_netadapter.cbp @@ -0,0 +1,56 @@ + + + + + +