bluez5: don't set unnecessary socket options

In media-sink, there's no need to set RCVBUF.

In media-source, we don't need to set NONBLOCK, as reads are done with
DONTWAIT. Don't set SNDBUF as it's not needed there. Don't set RCVBUF,
but use the (big) kernel default value: decode-buffer will handle any
overruns. Small values of RCVBUF might cause problems if kernel is
sending packets in a burst faster than we wake up.
This commit is contained in:
Pauli Virtanen 2023-03-05 17:45:31 +02:00 committed by Wim Taymans
parent 838fd6dce2
commit 04eb709619
2 changed files with 0 additions and 17 deletions

View file

@ -977,10 +977,6 @@ static int do_start(struct impl *this)
}
this->fd_buffer_size = val;
val = FILL_FRAMES * this->transport->read_mtu;
if (setsockopt(this->transport->fd, SOL_SOCKET, SO_RCVBUF, &val, sizeof(val)) < 0)
spa_log_warn(this->log, "%p: SO_RCVBUF %m", this);
val = 6;
if (setsockopt(this->transport->fd, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)) < 0)
spa_log_warn(this->log, "SO_PRIORITY failed: %m");

View file

@ -48,7 +48,6 @@ struct props {
char clock_name[64];
};
#define FILL_FRAMES 2
#define MAX_BUFFERS 32
struct buffer {
@ -677,18 +676,6 @@ static int transport_start(struct impl *this)
if (this->fd < 0)
return -errno;
val = fcntl(this->fd, F_GETFL);
if (fcntl(this->fd, F_SETFL, val | O_NONBLOCK) < 0)
spa_log_warn(this->log, "%p: fcntl %u %m", this, val | O_NONBLOCK);
val = FILL_FRAMES * this->transport->write_mtu;
if (setsockopt(this->fd, SOL_SOCKET, SO_SNDBUF, &val, sizeof(val)) < 0)
spa_log_warn(this->log, "%p: SO_SNDBUF %m", this);
val = FILL_FRAMES * this->transport->read_mtu;
if (setsockopt(this->fd, SOL_SOCKET, SO_RCVBUF, &val, sizeof(val)) < 0)
spa_log_warn(this->log, "%p: SO_RCVBUF %m", this);
val = 6;
if (setsockopt(this->fd, SOL_SOCKET, SO_PRIORITY, &val, sizeof(val)) < 0)
spa_log_warn(this->log, "SO_PRIORITY failed: %m");