Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1054390: xournalpp: outputs spurious ALSA lib warning messages in the terminal

129 views
Skip to first unread message

Vincent Lefevre

unread,
Oct 23, 2023, 4:40:05 AM10/23/23
to
Package: xournalpp
Version: 1.2.2-1
Severity: important

xournalpp outputs spurious ALSA lib warning messages in the terminal:

ALSA lib pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2675:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_route.c:878:(find_matching_chmap) Found no matching channel map
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c:1001:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'

As a graphic application, xournalpp should output almost nothing in
the terminal. Such messages are very annoying as they take valuable
space in the terminal.

-- System Information:
Debian Release: trixie/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 'stable-security'), (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
merged-usr: no
Architecture: amd64 (x86_64)

Kernel: Linux 6.5.0-2-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=POSIX, LC_CTYPE=C.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages xournalpp depends on:
ii libc6 2.37-12
ii libcairo2 1.18.0-1
ii libgcc-s1 13.2.0-5
ii libgdk-pixbuf-2.0-0 2.42.10+dfsg-1+b1
ii libglib2.0-0 2.78.0-2
ii libgtk-3-0 3.24.38-5
ii libgtksourceview-4-0 4.8.4-5
ii liblua5.4-0 5.4.6-1
ii libpango-1.0-0 1.51.0+ds-2
ii libpangocairo-1.0-0 1.51.0+ds-2
ii libpoppler-glib8 22.12.0-2+b1
ii libportaudio2 19.6.0-1.2
ii libportaudiocpp0 19.6.0-1.2
ii librsvg2-2 2.54.7+dfsg-2
ii libsndfile1 1.2.2-1
ii libstdc++6 13.2.0-5
ii libx11-6 2:1.8.7-1
ii libxi6 2:1.8-1+b1
ii libxml2 2.9.14+dfsg-1.3
ii libzip4 1.7.3-1+b1
ii zlib1g 1:1.2.13.dfsg-3

Versions of packages xournalpp recommends:
ii lua-lgi 0.9.2-3

Versions of packages xournalpp suggests:
ii texlive-base 2023.20231007-1
ii texlive-latex-extra 2023.20231007-2

-- no debconf information

--
Vincent Lefèvre <vin...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

Barak A. Pearlmutter

unread,
Oct 23, 2023, 5:50:04 AM10/23/23
to
It's great that people are using Xournal++, and care enough about it
to be bothered by this!

These are coming from libsndfile1. Many Linux GUI programs do output a
constant stream of harmless warnings, and Xournal++ is hardly the
worst offender. The "right" fix is presumably to tell libsndfile1 (the
calls are sf_xxx()) to try other sound systems first, like pipewire or
pulse, before going to devices. Or maybe there's a way to tell it to
be less verbose. Perhaps libsndfile1 has build options that would
avoid this by trying things in a different order, or tell it to be
less verbose. Anyway, patches welcome, at least to Xournal++.

If it really bugs you, as a workaround I'd suggest redirecting
standard error to a log file, maybe via a pipe that removes the
annoying ALSA stuff.

Cheers,

--Barak Pearlmutter

Vincent Lefevre

unread,
Oct 23, 2023, 6:50:05 AM10/23/23
to
On 2023-10-23 10:41:27 +0100, Barak A. Pearlmutter wrote:
> It's great that people are using Xournal++, and care enough about it
> to be bothered by this!

FYI, I've been using Xournal (xournal package) until now, which
doesn't have this issue. But I suppose that xournal will be removed
from Debian as it uses GTK 2 and seems unmaintained upstream
(probably replaced by Xournal++).

> These are coming from libsndfile1. Many Linux GUI programs do output
> a constant stream of harmless warnings, and Xournal++ is hardly the
> worst offender.

This occurred often in the past, but I don't see that often now
(at least for the non-GNOME applications).

> The "right" fix is presumably to tell libsndfile1 (the
> calls are sf_xxx()) to try other sound systems first, like pipewire or
> pulse, before going to devices. Or maybe there's a way to tell it to
> be less verbose. Perhaps libsndfile1 has build options that would
> avoid this by trying things in a different order, or tell it to be
> less verbose.

On the libsndfile1 side, I think that libraries shouldn't output
any warning/error message in general, except for fatal error
messages. The API should handle errors. Debugging messages may
be useful, but should never be output by default.

FYI, other applications like audacity also use the libsndfile
library, but have no such issues with it. Or does Xournal++ do
something that is really wrong?

> Anyway, patches welcome, at least to Xournal++.

I've seen that Xournal++ outputs other useless messages such as

(com.github.xournalpp.xournalpp:49547): xopp-WARNING **: 12:19:13.627: lastOpenPath is not set!

This is completely useless for the end user. Since Xournal++
seems to show errors in dialog boxes instead of the terminal
(not every GUI app does that), a solution could be to redirect
stderr to /dev/null on its side by default (some option could
be added to leave stderr as is, e.g. for debugging).

The only useful error message for the terminal could be the
"cannot open display" one. Fortunately, it occurs before any
spurious warning message:

zira:~> env -u DISPLAY /usr/bin/xournalpp

(com.github.xournalpp.xournalpp:49538): Gtk-WARNING **: 12:19:05.448: cannot open display:

So it might be possible to redirect stderr after that.

> If it really bugs you, as a workaround I'd suggest redirecting
> standard error to a log file, maybe via a pipe that removes the
> annoying ALSA stuff.

In the mean time, in case other users are potentially interested,
I've done the following:

#!/bin/sh
set -e
xrandr > /dev/null
/usr/bin/xournalpp "$@" 2> /dev/null

(the xrandr is useful to get the "cannot open display" error,
assuming that --display=DISPLAY xournalpp option is not used,
but I'm wondering whether any user uses this option).

Barak A. Pearlmutter

unread,
Oct 23, 2023, 8:40:07 AM10/23/23
to
Well that seems a bit drastic! You don't want to lose *all* the error messages.
I was thinking something which leaves stdout alone and just filters
out annoying stderr lines.
Like this:

#!/usr/bin/bash
set -e
xournalpp "$@" 2> >(egrep -v '^ALSA lib .*snd_')
0 new messages