Linux HAM/Amateur Radio development
 help / color / mirror / Atom feed
From: David Ranch <linux-hams@trinnet.net>
To: Guido Trentalancia <iz6rdb@trentalancia.com>,
	t.sailer@alumni.ethz.ch, Linux Hams <linux-hams@vger.kernel.org>
Subject: Soundmodem hangs all USB keyboard or mouse input -- and soundmodem 0.16: fix the AFSK modulator for 300 baud operation
Date: Sat, 07 Apr 2012 16:14:51 -0700	[thread overview]
Message-ID: <4F80CA6B.4010204@trinnet.net> (raw)
In-Reply-To: <1333809855.2433.10.camel@vortex>


Hello Guido, Thomas, fellow Linux HAMs:

I've CCed the Linuxhams group as I'm curious if any of you have any 
thoughts on why Soundmodem would be shutting down all USB-based keyboard 
and mouse functionality until the process is killed!  In all my years of 
Linux, I've never need something like this.  Very strange and any/all 
comments would be very much appreciated!


Few points:

1) I've recently noticed a change on my system that when I run 
soundmodemconfig (patched or unpatched), and I go into the spectrum 
scope view, my USB keyboard and mouse stop responding!  Though the 
spectrum scope continues to update, I can't type nor mouse around until 
I kill soundmodem via an out of band SSH connection!   How weird!

This Gateway NV57 laptop system is Centos6 (linux 2.6.32) running 
PulseAudio and Soundmodem using a USB soundcard (US Interface Navigator) 
which is configured to use ALSA natively (not OSS).

     - If I configure soundmodemconfig to use the on-motherboard 
soundcard, the keyboard and mouse continue to function when the spectrum 
scope is running!  This makes me think this is a USB / kernel issue with 
soundmodem

     - I moved all my various USB devices to different port locations 
but there wasn't any improvement
     - I tried disconnecting and re-connecting the USB to kb+mouse 
adapter after the spectrum scope is running but that didn't help
     - The KB+mouse are actually PS/2 style devices connecting through a 
PS2 to USB adapter
     - I've unconfigured the PTT port in soundmodemconfig to reduce 
variables but that didn't have any change to the behavior
     - I'm not running a KVM or Xen enabled kernel
     - I've tried soundmodemconfig -S and that didn't allow the 
soundsystem to be found.  Options -R and -M don't seem to be legal in 
soundmodemconfig though the man page says they are.

     - When I start soundmodem and try to show the spectrum display, I 
see the following on STDOUT:

[root@hampacket2 dranch]# soundmodemconfig
on_configtree_selection_changed
config_select: cfg: hampacket  chan: -
selection: cfg: hampacket  chan: -
on_configtree_selection_changed
config_deselect: cfg: hampacket  chan: -
selection: cfg: hampacket  chan: Channel 0
Modulator: afsk Demodulator: afsk
Modulator: parameter bps value 300
Modulator: parameter f0 value 1600
Modulator: parameter f1 value 1800
Modulator: parameter diffenc value 1
Demodulator: parameter bps value 300
Demodulator: parameter f0 value 1600
Demodulator: parameter f1 value 1800
Demodulator: parameter diffdec value 1
Minimum sampling rate: 11025
Audio IO: type alsa
ALSA: Using sample rate 11025, sample format 2, significant bits 16, 
buffer size 5513, period size 165
ALSA: Using sample rate 11025, sample format 2, significant bits 16, 
buffer size 5513, period size 165
sm[3644]: audio: starting "plughw:1,0"
Real sampling rate: 11025
sm[3644]: Opening PTT device "/dev/USI_PTT"
--

     - As a test, I tried using "padsp" to try things under OSS 
emulation but the /dev/dsp device isn't getting created.  It looks like 
maybe soundmodem as asking for something that PulseAudio cannot support 
(according to an strace):
       --
write(2, "utils/padsp.c: SNDCTL_DSP_CAPS\n", 31utils/padsp.c: 
SNDCTL_DSP_CAPS) = 31
write(2, "sm[4098]: ", 10sm[4098]: )              = 10
write(2, "audio: forcing half duplex mode\n", 32audio: forcing half 
duplex mode) = 32
write(2, "utils/padsp.c: SNDCTL_DSP_SETFRA"..., 50utils/padsp.c: 
SNDCTL_DSP_SETFRAGMENT: 0xffff0008) = 50
futex(0x817160, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
write(2, "utils/padsp.c: SNDCTL_DSP_SETFMT"..., 37utils/padsp.c: 
SNDCTL_DSP_SETFMT: 16) = 37
futex(0x817160, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
write(2, "utils/padsp.c: SNDCTL_DSP_STEREO"..., 36utils/padsp.c: 
SNDCTL_DSP_STEREO: 0) = 36
write(2, "utils/padsp.c: SNDCTL_DSP_SPEED:"..., 39utils/padsp.c: 
SNDCTL_DSP_SPEED: 11025) = 39
futex(0x817160, FUTEX_LOCK_PI_PRIVATE, 1) = 0
write(2, "utils/padsp.c: ss: s16le 1ch 110"..., 37utils/padsp.c: ss: 
s16le 1ch 11025Hz) = 37
futex(0x817160, FUTEX_UNLOCK_PI_PRIVATE, 0) = 0
write(2, "utils/padsp.c: unknown ioctl 0x0"..., 40utils/padsp.c: unknown 
ioctl 0x0000500e) = 40
write(2, "sm[4098]: ", 10sm[4098]: )              = 10
write(2, "audio: Error, cannot set nonbloc"..., 42audio: Error, cannot 
set nonblocking mode) = 42 <-------------------------------------
write(2, "utils/padsp.c: freeing fd info ("..., 38utils/padsp.c: freeing 
fd info (fd=4)) = 38
write(2, "utils/padsp.c: Draining.\n", 25utils/padsp.c: Draining.
       --

I want to say soundmodem used to work on this specific machine with 
Pulse/Alsa on plughw1,0.  I even tried starting up an older kernel but 
that didn't help.  I don't see anything helpful in /var/log/messages, 
/var/log/Xorg.0.log, dmesg, etc.

2) I'm trying the newer soundmodem-0.16 patch iz6rdb submitted to Thomas 
for better 300BAUD performance but I thought you said you reverted one 
of these patches.  I assume means I only need ONE of the patches.  Which 
one should I NOT apply?

Sampling rate fix: 
http://iz6rdb.trentalancia.com/en/soundmodem-0.16-use-a-minimum-samplerate-for-afsk-v5.patch
Longer filters (I think it's this one you don't recommend now): 
http://iz6rdb.trentalancia.com/en/soundmodem-0.16-increase-rx-filters-parameters.patch


3) With the unpatched soundmodemconfig spectrum view, there isn't any 
waveforms in column #1 but I do see all spectrum filling in columns 
2-8.  With your patches applied, I see the upper frequencies of column 1 
filled (50%) all the way through column 4.  Columns 5-8 are completely 
empty.  It's as if all the spectrum has been compressed into the first 
four columns with your patch.  Is that expected?   It seems to be due to 
the soundmodem-0.16-use-a-minimum-samplerate-for-afsk-v5.patch patch

4) With your patched soundmodem code running with a config of 1600/1800 
mark/space, if I hit the PTT button say in the spectrum screen, I get 
one primary tone at 1700hz (according to the soundmodemconfig spectrum 
scope) and two very large harmonics on each side of it (1390hz, 1550, 
1850, 1990).  With the original soundmodem-0.16 code, I get one single 
tone at 1200hz and no harmonics

5) In soundmodemconfig under channel 0, do you know what the 
"differential encoding" option is for?

6) It seems I must apply the 
soundmodem-0.16-use-a-minimum-samplerate-for-afsk-v5.patch FIRST and if 
I don't, the other patch will fail to apply.  Might be worth mentioning 
the order dependency on your website

7) - Your patch files are assuming unique directories 
(soundmodem-0.16-orig).  You should probably make them be more generic 
and relative:

--- soundmodem-0.16-orig/afsk/modem.c   2012-02-29 20:31:24.356287000 +0100
+++ soundmodem-0.16/afsk/modem.c        2012-03-03 19:14:07.696345582 +0100

to say

--- afsk/modem.c   2012-02-29 20:31:24.356287000 +0100
+++ afsk/modem.c        2012-03-03 19:14:07.696345582 +0100


Sorry for the long email but lots of interesting stuff and I think 
including all the details always helps to come to a complete picture of 
the problem(s).


73s!

--David
KI6ZHD


  parent reply	other threads:[~2012-04-07 23:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03  0:54 soundmodem 0.16: fix the AFSK modulator for 300 baud operation (was: RE: 300bps Packet) Guido Trentalancia
2012-03-03  9:50 ` walter harms
2012-03-03 14:47   ` Guido Trentalancia
2012-03-04 14:33     ` walter harms
2012-03-04 20:16       ` Guido Trentalancia
     [not found]         ` <4F776E14.7090104@trinnet.net>
     [not found]           ` <1333379832.2112.15.camel@vortex>
     [not found]             ` <4F7B199F.3050104@trinnet.net>
     [not found]               ` <1333647291.2605.34.camel@vortex>
     [not found]                 ` <1333741818.4064.20.camel@vortex>
     [not found]                   ` <4F7F7A2C.2030500@trinnet.net>
     [not found]                     ` <1333809855.2433.10.camel@vortex>
2012-04-07 23:14                       ` David Ranch [this message]
2012-04-08 15:23                         ` Soundmodem hangs all USB keyboard or mouse input -- and soundmodem 0.16: fix the AFSK modulator for 300 baud operation Guido Trentalancia
2012-04-09 21:37                         ` Curt, WE7U
2012-03-03 18:48   ` soundmodem 0.16: fix the AFSK modulator for 300 baud operation (was: RE: 300bps Packet) Guido Trentalancia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F80CA6B.4010204@trinnet.net \
    --to=linux-hams@trinnet.net \
    --cc=iz6rdb@trentalancia.com \
    --cc=linux-hams@vger.kernel.org \
    --cc=t.sailer@alumni.ethz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox