Skip to content

Conversation

@hpax
Copy link

@hpax hpax commented Sep 11, 2025

I ran into a problem with libserialport on Fedora 43 beta, which
includes glibc 2.42 which updates termios to actually handle arbitrary
speeds.

The first patch contains the fix for that problem (must clean CIBAUD.)

The second patch contains a fix for reading the current speed: per
POSIX, if only one speed is supported, it is the output speed that
counts, not the input speed.

The third patch contains machinery to detect if termios.h Bxxx
constants are identity mapped, and if so, simply uses them as numbers
-- which is of course what they should have been from the start.

H. Peter Anvin added 3 commits September 10, 2025 17:58
In case the serial port was already set up with split speed, using one
of the standard speed constants (i.e. not BOTHER) it is necessary to
clear CIBAUD to revert back to single speed.

Signed-off-by: H. Peter Anvin <[email protected]>
POSIX is pretty clear that if only one speed is supported, it is the
output speed setting that counts. On some platforms, the input speed
can even end up being reported as 0 for single speed configuration.

Thus, look at the output speed setting, not the input speed setting.

Signed-off-by: H. Peter Anvin <[email protected]>
If termios speed_t is a direct mapping to bauds, it is presumably safe
to assume that it can be used as a generic interface.  This applies to
Linux with glibc 2.42+, GNU Hurd, and at least some BSDs.

Try to detect this case and if so, do the simple thing.

Signed-off-by: H. Peter Anvin <[email protected]>
@f5bud
Copy link

f5bud commented Oct 31, 2025

I regularly use gtkterm to send commands to a serial device. On the latest version of Fedora (43), there is no communication. I don't know if the command is being sent or if the response is not being received.

I recreated the gtkterm profile, but the problem persists.

This could be related to changes made to termios in glibc 2.42 that were integrated into Fedora 43.

  • Did everything work correctly in Fedora 42?
    Yes, it works in version 42 and older versions.
    I am using a CH340 USB-to-serial adapter.

@hpax
Copy link
Author

hpax commented Nov 1, 2025

I regularly use gtkterm to send commands to a serial device. On the latest version of Fedora (43), there is no communication. I don't know if the command is being sent or if the response is not being received.

This is not related to libserialport as gtkterm doesn't use it; you should file a bug report to the appropriate plate for gtkterm or to the Fedora bugzilla.

You can use stty to verify or adjust the serial port parameters; the stty in Fedora 43 is aware of arbitrary baud rates and split speed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants