#1044924 moc: Setting volume above 100% kills mocp.

Package:
moc
Source:
moc
Description:
ncurses based console audio player
Submitter:
Nick
Date:
2025-03-14 09:39:03 UTC
Severity:
normal
Tags:
#1044924#5
Date:
2023-08-13 17:45:48 UTC
From:
To:
Whether this belongs with moc I don't know but it's where the problem
is most immediately apparent.  To reproduce the bug (whether moc's or
not):

1. Start mocp

   $ mocp

2. Set volume of the default sink (mine has id of 1) to 100%

   $ pactl set-sink-volume 1 100%

3. Nothing changes in mocp, except the volume. Now increase the volume,

   $ pactl set-sink-volume 1 +1%

mocp promptly exits (return code 2):

   FATAL_ERROR: Can't receive value from the server!

4. Try to restart mocp:

   $ mocp
   Running the server...
   Trying JACK...
   Trying ALSA...
   mocp: alsa.c:319: alsa_read_mixer_raw: Assertion `RANGE(0, vol, 100)' failed.

   FATAL_ERROR: Server exited!

The return code is 2 again.

Reducing the volume to 100% or less allows mocp to run again.  Whether
pactl should be able to set the volume over 100% I'll leave for
someone else to decide :)

Please let me know if I can provide more information.
Thanks

#1044924#10
Date:
2025-03-14 09:34:38 UTC
From:
To:
Greetings,

Nick, on 2023-08-13:

Upstream forum post #1600 looks to be the place where discussion
around this issue has been the most involved.  If I trust jcf's
comment, they don't look too keen on working around the problem,
as I understand allowing higher volume settings would make mocp
run into undefined behavior a some places.

I initially thought to tag the bug as "wontfix", as it seems
initial discussions went nowhere.  But, before proceeding, I
attempted to reproduce the bug, and it seems mocp kept running
properly.  From what I saw in ALSA mixer and PA mixer, while the
PA sink overblown the volume, the ALSA mixer remains capped at
100%.  This looks to be sufficient to prevent mocp to run into
the error condition.

My guess is that something in the sound pipeline could have
improved recently the compatibility with direct users of the
ALSA layer.  Does someone reproduce the bug in sid or trixie?

If not, then I guess the issue can be closed.

Have a nice day,  :)