Browse Source

Fix backend port alias management (renaming in system:xxx)

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1524 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.65
sletz 17 years ago
parent
commit
29796db347
11 changed files with 56 additions and 6 deletions
  1. +5
    -1
      ChangeLog
  2. +22
    -1
      common/JackAudioDriver.cpp
  3. +2
    -0
      common/JackAudioDriver.h
  4. +3
    -0
      common/JackDriver.h
  5. +5
    -2
      common/JackFreewheelDriver.h
  6. +9
    -0
      common/JackPort.cpp
  7. +1
    -0
      common/JackPort.h
  8. +2
    -0
      common/JackServer.cpp
  9. +5
    -0
      common/JackThreadedDriver.h
  10. +1
    -1
      linux/alsa/JackAlsaDriver.cpp
  11. +1
    -1
      macosx/JackCoreAudioDriver.cpp

+ 5
- 1
ChangeLog View File

@@ -4,10 +4,14 @@

2007-08-21 Stephane Letz <letz@grame.fr>
* Automatic server launch. Removes unneeded 'volatile' for JackTransportEngine::fWriteCounter.
* Fix backend port alias management (renaming in system:xxx).

2007-08-20 Stephane Letz <letz@grame.fr>
* Automatic server launch. Removes unneeded 'volatile' for JackTransportEngine::fWriteCounter.

2007-08-19 Stephane Letz <letz@grame.fr>
* Add "systemic" latencies management in CoreAudio driver.
2007-08-16 Stephane Letz <letz@grame.fr>


+ 22
- 1
common/JackAudioDriver.cpp View File

@@ -78,7 +78,7 @@ int JackAudioDriver::Attach()
{
JackPort* port;
jack_port_id_t port_index;
char buf[JACK_PORT_NAME_SIZE];
char buf[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;
int i;

@@ -224,6 +224,27 @@ int JackAudioDriver::ProcessSync()
return 0;
}

void JackAudioDriver::RenamePorts()
{
JackPort* port;
char buf[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
int i;
for (i = 0; i < fCaptureChannels; i++) {
port = fGraphManager->GetPort(fCapturePortList[i]);
port->SetAlias(port->GetName());
snprintf(buf, sizeof(buf) - 1, "system:capture_%d", i + 1);
port->SetFullName(buf);
}

for (i = 0; i < fPlaybackChannels; i++) {
port = fGraphManager->GetPort(fPlaybackPortList[i]);
port->SetAlias(port->GetName());
snprintf(buf, sizeof(buf) - 1, "system:playback_%d", i + 1);
port->SetFullName(buf);
}
}

void JackAudioDriver::NotifyXRun(jack_time_t callback_usecs)
{
fEngine->NotifyXRun(callback_usecs);


+ 2
- 0
common/JackAudioDriver.h View File

@@ -55,6 +55,8 @@ class EXPORT JackAudioDriver : public JackDriver

int ProcessAsync();
int ProcessSync();
void RenamePorts();

public:



+ 3
- 0
common/JackDriver.h View File

@@ -65,9 +65,12 @@ class EXPORT JackDriverInterface

virtual int Attach() = 0;
virtual int Detach() = 0;
virtual void RenamePorts() = 0;

virtual int Read() = 0;
virtual int Write() = 0;
virtual int Start() = 0;
virtual int Stop() = 0;
virtual int SetBufferSize(jack_nframes_t buffer_size) = 0;


+ 5
- 2
common/JackFreewheelDriver.h View File

@@ -44,8 +44,11 @@ class JackFreewheelDriver : public JackDriver
{
return false;
}

int Process();
void RenamePorts()
{}
int Process();
};

} // end of namespace


+ 9
- 0
common/JackPort.cpp View File

@@ -52,6 +52,8 @@ void JackPort::Release()
fLocked = false;
fLatency = 0;
fTied = NO_PORT;
fAlias1[0] = '\0';
fAlias2[0] = '\0';
}

bool JackPort::IsUsed() const
@@ -184,6 +186,13 @@ int JackPort::SetName(const char* new_name)
return 0;
}

int JackPort::SetFullName(const char* new_name)
{
assert(strlen(new_name) < JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE);
strcpy(fName, new_name);
return 0;
}

bool JackPort::NameEquals(const char* target)
{
return (strcmp(fName, target) == 0


+ 1
- 0
common/JackPort.h View File

@@ -78,6 +78,7 @@ class JackPort
const char* GetName() const;
const char* GetShortName() const;
int SetName(const char* name);
int SetFullName(const char* new_name);
int GetAliases(char* const aliases[2]);
int SetAlias(const char* alias);


+ 2
- 0
common/JackServer.cpp View File

@@ -122,6 +122,8 @@ int JackServer::Open(jack_driver_desc_t* driver_desc, JSList* driver_params)
jack_error("Cannot attach audio driver");
return -1;
}
fAudioDriver->RenamePorts();

if (fLoopback > 0 && fLoopbackDriver->Attach() != 0) {
jack_error("Cannot attach loopback driver");


+ 5
- 0
common/JackThreadedDriver.h View File

@@ -82,6 +82,11 @@ class JackThreadedDriver : public JackDriverClientInterface, public JackRunnable
{
return fDriver->Detach();
}
virtual void RenamePorts()
{
fDriver->RenamePorts();
}

virtual int Read()
{


+ 1
- 1
linux/alsa/JackAlsaDriver.cpp View File

@@ -2074,7 +2074,7 @@ int JackAlsaDriver::Attach()
int port_index;
unsigned long port_flags;

char buf[JACK_PORT_NAME_SIZE];
char buf[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];

port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;



+ 1
- 1
macosx/JackCoreAudioDriver.cpp View File

@@ -800,7 +800,7 @@ int JackCoreAudioDriver::Attach()
UInt32 size;
Boolean isWritable;
char channel_name[64];
char buf[JACK_PORT_NAME_SIZE];
char buf[JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE];
unsigned long port_flags = JackPortIsOutput | JackPortIsPhysical | JackPortIsTerminal;

JackLog("JackCoreAudioDriver::Attach fBufferSize %ld fSampleRate %ld\n", fEngineControl->fBufferSize, fEngineControl->fSampleRate);


Loading…
Cancel
Save