Project

General

Profile

Actions

Bug #4663

closed

osmo-e1d: SOCK_SEQPACKET and RAW timeslots

Added by laforge almost 4 years ago. Updated almost 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
07/11/2020
Due date:
% Done:

100%

Spec Reference:

Description

I actually think that the current code cannot work correctly for RAW timeslots.

As we use SOCK_SEQPACKET for the socketpair irrespective of the timeslot mode, this means that every read() of a ts-fd inside osmo-e1d will want to read one "packet" of whatever size the client has written.

However, in osmo-e1d we read only as many bytes as we have frames to send. With the current USB code this is 4..12 bytes per read().

In my understanding of SOCK_SEQPACKET semantics, this means that the first 4..12 bytes are read and the remainder of the packet is discarded.

We should probably eithe
  • use SOCK_STREAM sockets for RAW and keep SEQPACKET only for HDLC
  • use larger read() sizes as we probably really don't want one syscall for every 4..12 bytes of every voice channel

I have other priorities right now, but I think it would be worthwhile to develop a test for this. With vpair this test could run without any hardware (vpair uses a nominal 10 frames-to-send granularity).

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)