merge the fixes from the feature_sndcrdmixer branch

This commit is contained in:
Volker Fischer 2020-04-30 16:16:59 +02:00
parent bef58357ef
commit fc3a33dc42
5 changed files with 38 additions and 42 deletions

View file

@ -2,16 +2,26 @@
3.5.3git 3.5.3git
TODO improve input channel mapping and introduce input/output gains with overrange to amplification (separate dialog, replace Pan, etc.) * bug fix: for mono capture jack audio interface Jamulus complains it cannot make connections (Ticket #137)
TODO improve help menu, see https://github.com/corrados/jamulus/issues/90
TODO support internationalization TODO support internationalization
TODO standard style: meter bar gets smaller sometimes if board is full and fader text is short
TODO sometimes I cannot see the central server in the server list TODO sometimes I cannot see the central server in the server list
TODO server: warning if Central server selected but OS location is different (e.g. US) -> warning in GUI and command line
TODO implement panning for channels (Ticket #52, #145) TODO implement panning for channels (Ticket #52, #145)
TODO show mute state of others

View file

@ -34,7 +34,7 @@ void CSound::OpenJack()
// try to become a client of the JACK server // try to become a client of the JACK server
pJackClient = jack_client_open ( APP_NAME, JackNullOption, &JackStatus ); pJackClient = jack_client_open ( APP_NAME, JackNullOption, &JackStatus );
if ( pJackClient == NULL ) if ( pJackClient == nullptr )
{ {
throw CGenErr ( tr ( "The Jack server is not running. This software " throw CGenErr ( tr ( "The Jack server is not running. This software "
"requires a Jack server to run. Normally if the Jack server is " "requires a Jack server to run. Normally if the Jack server is "
@ -79,10 +79,10 @@ void CSound::OpenJack()
output_port_right = jack_port_register ( pJackClient, "output right", output_port_right = jack_port_register ( pJackClient, "output right",
JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 ); JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0 );
if ( ( input_port_left == NULL ) || if ( ( input_port_left == nullptr ) ||
( input_port_right == NULL ) || ( input_port_right == nullptr ) ||
( output_port_left == NULL ) || ( output_port_left == nullptr ) ||
( output_port_right == NULL ) ) ( output_port_right == nullptr ) )
{ {
throw CGenErr ( tr ( "The Jack port registering failed." ) ); throw CGenErr ( tr ( "The Jack port registering failed." ) );
} }
@ -93,14 +93,14 @@ void CSound::OpenJack()
input_port_midi = jack_port_register ( pJackClient, "input midi", input_port_midi = jack_port_register ( pJackClient, "input midi",
JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0 ); JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0 );
if ( input_port_midi == NULL ) if ( input_port_midi == nullptr )
{ {
throw CGenErr ( tr ( "The Jack port registering failed." ) ); throw CGenErr ( tr ( "The Jack port registering failed." ) );
} }
} }
else else
{ {
input_port_midi = NULL; input_port_midi = nullptr;
} }
// tell the JACK server that we are ready to roll // tell the JACK server that we are ready to roll
@ -119,23 +119,16 @@ void CSound::OpenJack()
// try to connect physical input ports // try to connect physical input ports
if ( ( ports = jack_get_ports ( pJackClient, if ( ( ports = jack_get_ports ( pJackClient,
NULL, nullptr,
NULL, nullptr,
JackPortIsPhysical | JackPortIsOutput ) ) != NULL ) JackPortIsPhysical | JackPortIsOutput ) ) != nullptr )
{ {
if ( jack_connect ( pJackClient, ports[0], jack_port_name ( input_port_left ) ) ) jack_connect ( pJackClient, ports[0], jack_port_name ( input_port_left ) );
{
throw CGenErr ( tr ( "Cannot connect the Jack input ports" ) );
}
// before connecting the second stereo channel, check if the input is not // before connecting the second stereo channel, check if the input is not mono
// mono
if ( ports[1] ) if ( ports[1] )
{ {
if ( jack_connect ( pJackClient, ports[1], jack_port_name ( input_port_right ) ) ) jack_connect ( pJackClient, ports[1], jack_port_name ( input_port_right ) );
{
throw CGenErr ( tr ( "Cannot connect the Jack input ports" ) );
}
} }
jack_free ( ports ); jack_free ( ports );
@ -143,23 +136,16 @@ void CSound::OpenJack()
// try to connect physical output ports // try to connect physical output ports
if ( ( ports = jack_get_ports ( pJackClient, if ( ( ports = jack_get_ports ( pJackClient,
NULL, nullptr,
NULL, nullptr,
JackPortIsPhysical | JackPortIsInput ) ) != NULL ) JackPortIsPhysical | JackPortIsInput ) ) != nullptr )
{ {
if ( jack_connect ( pJackClient, jack_port_name ( output_port_left ), ports[0] ) ) jack_connect ( pJackClient, jack_port_name ( output_port_left ), ports[0] );
{
throw CGenErr ( tr ( "Cannot connect the Jack output ports." ) );
}
// before connecting the second stereo channel, check if the output is not // before connecting the second stereo channel, check if the output is not mono
// mono
if ( ports[1] ) if ( ports[1] )
{ {
if ( jack_connect ( pJackClient, jack_port_name ( output_port_right ), ports[1] ) ) jack_connect ( pJackClient, jack_port_name ( output_port_right ), ports[1] );
{
throw CGenErr ( tr ( "Cannot connect the Jack output ports." ) );
}
} }
jack_free ( ports ); jack_free ( ports );
@ -230,7 +216,7 @@ int CSound::process ( jack_nframes_t nframes, void* arg )
CSound* pSound = static_cast<CSound*> ( arg ); CSound* pSound = static_cast<CSound*> ( arg );
int i; int i;
if ( pSound->IsRunning() ) if ( pSound->IsRunning() && ( nframes == static_cast<jack_nframes_t> ( pSound->iJACKBufferSizeMono ) ) )
{ {
// get input data pointer // get input data pointer
jack_default_audio_sample_t* in_left = jack_default_audio_sample_t* in_left =
@ -242,7 +228,7 @@ int CSound::process ( jack_nframes_t nframes, void* arg )
pSound->input_port_right, nframes ); pSound->input_port_right, nframes );
// copy input audio data // copy input audio data
if ( in_left != 0 && in_right != 0 ) if ( ( in_left != nullptr ) && ( in_right != nullptr ) )
{ {
for ( i = 0; i < pSound->iJACKBufferSizeMono; i++ ) for ( i = 0; i < pSound->iJACKBufferSizeMono; i++ )
{ {
@ -267,7 +253,7 @@ int CSound::process ( jack_nframes_t nframes, void* arg )
pSound->output_port_right, nframes ); pSound->output_port_right, nframes );
// copy output data // copy output data
if ( out_left != 0 && out_right != 0 ) if ( ( out_left != nullptr ) && ( out_right != nullptr ) )
{ {
for ( i = 0; i < pSound->iJACKBufferSizeMono; i++ ) for ( i = 0; i < pSound->iJACKBufferSizeMono; i++ )
{ {
@ -291,7 +277,7 @@ int CSound::process ( jack_nframes_t nframes, void* arg )
pSound->output_port_right, nframes ); pSound->output_port_right, nframes );
// clear output data // clear output data
if ( out_left != 0 && out_right != 0 ) if ( ( out_left != nullptr ) && ( out_right != nullptr ) )
{ {
memset ( out_left, memset ( out_left,
0, 0,
@ -304,7 +290,7 @@ int CSound::process ( jack_nframes_t nframes, void* arg )
} }
// akt on MIDI data if MIDI is enabled // akt on MIDI data if MIDI is enabled
if ( pSound->input_port_midi != NULL ) if ( pSound->input_port_midi != nullptr )
{ {
void* in_midi = jack_port_get_buffer ( pSound->input_port_midi, nframes ); void* in_midi = jack_port_get_buffer ( pSound->input_port_midi, nframes );

View file

@ -957,7 +957,7 @@ void CClient::ProcessAudioDataIntern ( CVector<int16_t>& vecsStereoSndCrd )
if ( iReverbLevel != 0 ) if ( iReverbLevel != 0 )
{ {
// calculate attenuation amplification factor // calculate attenuation amplification factor
const double dRevLev = static_cast<double> ( iReverbLevel ) / AUD_REVERB_MAX / 2; const double dRevLev = static_cast<double> ( iReverbLevel ) / AUD_REVERB_MAX / 4;
if ( eAudioChannelConf == CC_STEREO ) if ( eAudioChannelConf == CC_STEREO )
{ {

View file

@ -102,7 +102,7 @@ protected:
QTimer TimerStatus; QTimer TimerStatus;
QTimer TimerPing; QTimer TimerPing;
virtual void closeEvent ( QCloseEvent* Event ); virtual void closeEvent ( QCloseEvent* Event );
void UpdateDisplay(); void UpdateDisplay();
QMenu* pViewMenu; QMenu* pViewMenu;

View file

@ -657,7 +657,7 @@ public:
void Update ( const CVector<short>& vecsAudio ); void Update ( const CVector<short>& vecsAudio );
double MicLeveldBLeft() { return CalcLogResult ( dCurLevelL ); } double MicLeveldBLeft() { return CalcLogResult ( dCurLevelL ); }
double MicLeveldBRight() { return CalcLogResult ( dCurLevelR ); } double MicLeveldBRight() { return CalcLogResult ( dCurLevelR ); }
static double CalcLogResult ( const double& dLinearLevel ); static double CalcLogResult ( const double& dLinearLevel );
void Reset() void Reset()
{ {