CasparCG / client

Client software primarily used with the CasparCG Server software for audio and video playout, to control graphics and recording, but it can also be used for other tasks within television broadcast.
https://casparcg.com
GNU General Public License v3.0
284 stars 99 forks source link

Client closes on every OSC Output #294

Closed jznofc closed 9 months ago

jznofc commented 3 years ago

If i try to send a OSC Output to Companion or any other software, the client closes. Just everytime.

Using CasparCG Client 2.2.0 Rev. 1bca33bf80

pbelbin commented 3 years ago

I have seen exactly the same issue, and it's quite annoying!

amwtech commented 3 years ago

I have also experienced this issue. I found that the crash occurs when OscSender::send is invoked in module client/src/Osc/OscSender.cpp I was able to show that commenting out most of the code leaving just the invoking of the constructor for an instance of osc::OutboundPacketStream caused the client crash. Code with / / comments shown below.

void OscSender::send(const QString& address, int port, const QString& path, const QVariant& message, bool useBundle)
{ 
 /*   UdpTransmitSocket transmitSocket(IpEndpointName(address.toStdString().c_str(), port)); */

    char buffer[256];
    osc::OutboundPacketStream stream(buffer, 256);
/*
    if (useBundle)
        stream << osc::BeginBundleImmediate;

    if (message.userType() == QMetaType::Bool)
        stream << osc::BeginMessage(path.toStdString().c_str()) << message.toBool() << osc::EndMessage;
    else if (message.userType() == QMetaType::Double)
        stream << osc::BeginMessage(path.toStdString().c_str()) << message.toDouble() << osc::EndMessage;
    else if (message.userType() == QMetaType::Float)
        stream << osc::BeginMessage(path.toStdString().c_str()) << message.toFloat() << osc::EndMessage;
    else if (message.userType() == QMetaType::Int)
        stream << osc::BeginMessage(path.toStdString().c_str()) << message.toInt() << osc::EndMessage;
    else if (message.userType() == QMetaType::QString)
        stream << osc::BeginMessage(path.toStdString().c_str()) << message.toString().toUtf8().constData() << osc::EndMessage;

    if (useBundle)
        stream << osc::EndBundle;

    transmitSocket.Send(stream.Data(), stream.Size()); */
}  

The constructor invoked by stream(buffer, 256) is part of a deployed library oscpack.dll (see https://github.com/CasparCG/client/blob/master/deploy/win32/oscpack.dll).

Whilst I know this is not the strictly correct fix, I discovered that replacing oscpack.dll in the client deploy folder with a version from the master code branch (https://github.com/CasparCG/client/blob/master/deploy/win32/oscpack.dll) stops the client crash and enables OSC output.

The replacement can be applied direct to the pre-built client available at https://github.com/CasparCG/server/releases/tag/v2.3.0-lts-stable by replacing the oscpack.dll instance in the root of the version 2.2.0 client with the version downloaded as part of client 2.0.9 or from the master branch.

amwtech commented 9 months ago

This was an issue on the Windows client. I tested OSC send using the December 2023 build, and the client does not crash when an OSC message is output by the client.

andy