Merge lp:~kamalmostafa/ubuntu/lucid/unixcw/fix-ioctl-and-mute into lp:ubuntu/lucid/unixcw

Proposed by Kamal Mostafa
Status: Merged
Merged at revision: not available
Proposed branch: lp:~kamalmostafa/ubuntu/lucid/unixcw/fix-ioctl-and-mute
Merge into: lp:ubuntu/lucid/unixcw
Diff against target: 137 lines (+47/-1)
5 files modified
debian/changelog (+9/-0)
debian/control (+2/-1)
src/cw/cw.c (+4/-0)
src/cwcp/cwcp.c (+7/-0)
src/cwlib/cwlib.c (+25/-0)
To merge this branch: bzr merge lp:~kamalmostafa/ubuntu/lucid/unixcw/fix-ioctl-and-mute
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+18230@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2009-12-25 09:10:13 +0000
3+++ debian/changelog 2010-01-28 20:55:21 +0000
4@@ -1,3 +1,12 @@
5+unixcw (2.3-13ubuntu1) lucid; urgency=low
6+
7+ * Fix invalid ioctl which breaks CW output on some devices (LP: #511676).
8+ - src/cwlib/cwlib.c: do not try to use mixer volume ioctl on audio device.
9+ * Restore audio device volume on exit (LP: #513576)
10+ - src/cw/cw.c, src/cwcp/cwcp.c: call cw_complete_reset() at exit.
11+
12+ -- Kamal Mostafa <kamal@whence.com> Wed, 27 Jan 2010 19:40:14 -0800
13+
14 unixcw (2.3-13) unstable; urgency=low
15
16 * QA upload.
17
18=== modified file 'debian/control'
19--- debian/control 2009-12-25 09:10:13 +0000
20+++ debian/control 2010-01-28 20:55:21 +0000
21@@ -1,7 +1,8 @@
22 Source: unixcw
23 Section: hamradio
24 Priority: optional
25-Maintainer: Debian QA Group <packages@qa.debian.org>
26+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
27+XSBC-Original-Maintainer: Debian QA Group <packages@qa.debian.org>
28 Standards-Version: 3.8.0
29 Build-Depends: debhelper (>=7), libqt3-mt-dev, libncurses5-dev, po-debconf, autotools-dev, mawk|gawk
30
31
32=== modified file 'src/cw/cw.c'
33--- src/cw/cw.c 2006-11-19 19:52:38 +0000
34+++ src/cw/cw.c 2010-01-28 20:55:21 +0000
35@@ -922,5 +922,9 @@
36
37 /* Await final tone completion before exiting. */
38 cw_wait_for_tone_queue ();
39+
40+ /* Reset to ensure that the mixer volume gets restored. */
41+ cw_complete_reset();
42+
43 return EXIT_SUCCESS;
44 }
45
46=== modified file 'src/cwcp/cwcp.c'
47--- src/cwcp/cwcp.c 2006-11-19 19:52:38 +0000
48+++ src/cwcp/cwcp.c 2010-01-28 20:55:21 +0000
49@@ -1625,6 +1625,9 @@
50 /* Attempt to wrestle the screen back from curses. */
51 interface_destroy ();
52
53+ /* Reset to ensure that the mixer volume gets restored. */
54+ cw_complete_reset();
55+
56 /* Show the signal caught, and exit. */
57 fprintf (stderr, _("\nCaught signal %d, exiting...\n"), signal_number);
58 exit (EXIT_SUCCESS);
59@@ -1685,5 +1688,9 @@
60 /* Clean up and return. */
61 interface_destroy ();
62 cw_wait_for_tone_queue ();
63+
64+ /* Reset to ensure that the mixer volume gets restored. */
65+ cw_complete_reset();
66+
67 return EXIT_SUCCESS;
68 }
69
70=== modified file 'src/cwlib/cwlib.c'
71--- src/cwlib/cwlib.c 2006-12-18 09:45:19 +0000
72+++ src/cwlib/cwlib.c 2010-01-28 20:55:21 +0000
73@@ -2138,6 +2138,18 @@
74 {
75 int read_volume, mixer, device_mask;
76
77+/*
78+ * [Kamal Mostafa <kamal@whence.com>]
79+ * This attempt to use a mixer ioctl on the audio device is invalid! I do not
80+ * think that this ioctl could ever have worked. Most audio devices will
81+ * just return an error, allowing this routine to proceed to try the volume
82+ * control methods on the (proper) mixer device. However, some audio devices
83+ * actually *do* have an ioctl (unrelated to volume control) corresponding to
84+ * this ioctl number -- if they return 0, then this routine is tricked into
85+ * thinking that it has set the volume when in fact it has not.
86+ * https://bugs.launchpad.net/ubuntu/+source/unixcw/+bug/511676
87+ */
88+#if 0
89 /* Try to use the main /dev/audio device for ioctls first. */
90 if (ioctl (cw_sound_descriptor,
91 MIXER_READ (SOUND_MIXER_PCM), &read_volume) == 0)
92@@ -2145,6 +2157,7 @@
93 *volume = read_volume;
94 return RC_SUCCESS;
95 }
96+#endif
97
98 /* Volume not found; try the mixer PCM channel volume instead. */
99 mixer = open (cw_mixer_device, O_RDONLY | O_NONBLOCK);
100@@ -2174,6 +2187,8 @@
101
102 *volume = read_volume;
103 close (mixer);
104+ if (cw_is_debugging_internal (CW_DEBUG_KEYING))
105+ fprintf(stderr, "cw: volume control is SOUND_MIXER_PCM\n");
106 return RC_SUCCESS;
107 }
108 else
109@@ -2191,6 +2206,8 @@
110
111 *volume = read_volume;
112 close (mixer);
113+ if (cw_is_debugging_internal (CW_DEBUG_KEYING))
114+ fprintf(stderr, "cw: volume control is SOUND_MIXER_VOLUME\n");
115 return RC_SUCCESS;
116 }
117 }
118@@ -2216,11 +2233,19 @@
119 {
120 int mixer, device_mask;
121
122+/*
123+ * [Kamal Mostafa <kamal@whence.com>]
124+ * This attempt to use a mixer ioctl on the audio device is invalid!
125+ * (see above).
126+ */
127+#if 0
128 /* Try to use the main /dev/audio device for ioctls first. */
129 if (ioctl (cw_sound_descriptor,
130 MIXER_WRITE (SOUND_MIXER_PCM), &volume) == 0)
131 return RC_SUCCESS;
132
133+#endif
134+
135 /* Try the mixer PCM channel volume instead. */
136 mixer = open (cw_mixer_device, O_RDWR | O_NONBLOCK);
137 if (mixer == -1)

Subscribers

People subscribed via source and target branches

to all changes: