unixcw leaves audio device volume muted on exit

Bug #513576 reported by Kamal Mostafa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
unixcw (Debian)
Fix Released
Unknown
unixcw (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: unixcw

The programs 'cw' or 'cwcp' accidentally leave the system audio device (mixer) volume muted when they exit.

TESTCASE:
1. Ensure that the system audio volume is not muted (e.g. with the gnome volume control applet).
2. In a terminal, run
      echo KA6MAL | cw
While listening to the Morse code audio output, notice the gnome volume control applet flashing its "muted" status along with the dits and dahs.
3. After the command returns to the shell prompt, notice that the gnome volume control applet has been left muted. The volume should have been restored.

Note: If the Morse code output is completely garbled (just long continuous tones) then you're experiencing bug LP: #511676 "unixcw sends incorrect characters".

ANALYSIS:
unixcw's 'cwlib' library works by manipulating the audio device (mixer) volume control -- switching the volume on and off to generate Morse code. This is the normal behavior of the 'cwlib' library.

The library does actually preserve the initial volume setting, but fails to restore it in some scenarios -- specifically, when it exits during it 10 second "keep the soundcard held" termination phase as occurs when piping input into 'cw' and when quitting 'cwcp' with F12. These programs just need to call cw_complete_reset() in all exit paths.

I think its possible that some systems' audio devices may *not* indicate a flashing volume control applet because 'cwlib' might find and uses a different volume mixer -- this bug is probably not reproducible on such systems.

Related branches

Changed in unixcw (Ubuntu):
assignee: nobody → Kamal Mostafa (kamalmostafa)
status: New → In Progress
Revision history for this message
Kamal Mostafa (kamalmostafa) wrote :

I added the requisite call to cw_complete_reset() in all exit paths, fixing the bug.

Fixed in the attached branch, and created PPA update packages for Karmic and Lucid, available here:

    https://launchpad.net/~kamalmostafa/+archive/unixcw-fixes

Changed in unixcw (Ubuntu):
assignee: Kamal Mostafa (kamalmostafa) → nobody
status: In Progress → Confirmed
Changed in unixcw (Debian):
status: Unknown → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unixcw - 2.3-13ubuntu1

---------------
unixcw (2.3-13ubuntu1) lucid; urgency=low

  * Fix invalid ioctl which breaks CW output on some devices (LP: #511676).
    - src/cwlib/cwlib.c: do not try to use mixer volume ioctl on audio device.
  * Restore audio device volume on exit (LP: #513576)
    - src/cw/cw.c, src/cwcp/cwcp.c: call cw_complete_reset() at exit.
 -- Kamal Mostafa <email address hidden> Wed, 27 Jan 2010 19:40:14 -0800

Changed in unixcw (Ubuntu):
status: Confirmed → Fix Released
Changed in unixcw (Debian):
status: New → Fix Committed
Changed in unixcw (Debian):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.