dj0abr / SSB_HighSpeed_Modem

8PSK/QPSK Modem to send Images/Data via a 2,7kHz SSB channel in high speed
GNU General Public License v3.0
19 stars 8 forks source link

hsmodem crashes in soundio_outstream_start(outstream) #1

Closed df7cb closed 3 years ago

df7cb commented 3 years ago

Hi, thanks for moving to libsoundio, using only free-software dependencies is very much appreciated.

Unfortunately, hsmodem crashes for me in libsoundio: (OS is Debian bullseye on Linux/amd64)

$ gdb ../hsmodemLinux/hsmodem 
GNU gdb (Debian 10.1-1+b1) 10.1
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../hsmodemLinux/hsmodem...
(gdb) r
Starting program: /home/myon/projects/afu/ssb-highspeed-modem/SSB_HighSpeed_Modem/hsmodemLinux/hsmodem 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[Detaching after vfork from child process 47088]
port 40131 sucessfully bound
[New Thread 0x7ffff568c700 (LWP 47091)]
port 40132 sucessfully bound
[New Thread 0x7ffff4e8b700 (LWP 47092)]
QO100modem initialised and running
new app IP: 192.168.0.171, restarting modems

 ==== IO INIT AUDIO devices ====
requested: <tx0> <Audio Adapter (Unitek Y-247A) Mono>
capture rate:44100
close Audio
[New Thread 0x7ffff468a700 (LWP 47093)]
[Thread 0x7ffff468a700 (LWP 47093) exited]
[New Thread 0x7fffebfff700 (LWP 47094)]
selected CAP device:
name:Audio Adapter (Unitek Y-247A) Mono
id  :alsa_input.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.mono-fallback
selected PB device:
name:tx0
id  :tx0

Thread 1 "hsmodem" received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt f
#0  0x0000000000000000 in ?? ()
No symbol table info available.
#1  0x00007ffff6e41efa in outstream_start_pa (si=0x555555b96d70, os=0x555555bd1dc0)
    at ./src/pulseaudio.c:743
        outstream = 0x555555bd1dc0
        sipa = 0x555555b96e60
        ospa = 0x555555bd1e80
        frame_count = <optimized out>
        op = <optimized out>
#2  0x0000555555568e9e in io_init_sound (pbname=0x55555558f060 <playbackDeviceName> "tx0", 
    capname=0x55555558efe0 <captureDeviceName> "Audio Adapter (Unitek Y-247A) Mono") at soundio.cpp:600
        err = 0
        pbdevid = 0x55555557836c <audiodev+11084> "tx0"
        capdevid = 0x555555575c0c <audiodev+1004> "alsa_input.usb-C-Media_Electronics_Inc._USB_Audio_Device-00.mono-fallback"
#3  0x0000555555557dd9 in startModem () at hsmodem.cpp:292
No locals.
#4  0x0000555555557bcf in main (argc=1, argv=0x7fffffffe678) at hsmodem.cpp:197
        old_tm = 0
        tm = -1378498262
        dret = 0
        opt = -1
        modemip = 0x0
(gdb) f 2
#2  0x0000555555568e9e in io_init_sound (pbname=0x55555558f060 <playbackDeviceName> "tx0", 
    capname=0x55555558efe0 <captureDeviceName> "Audio Adapter (Unitek Y-247A) Mono") at soundio.cpp:600
600     if ((err = soundio_outstream_start(outstream))) {
(gdb) l
595     if ((err = soundio_outstream_open(outstream))) {
596         printf("unable to open output stream: %s", soundio_strerror(err));
597         return 0;
598     }
599 
600     if ((err = soundio_outstream_start(outstream))) {
601         fprintf(stderr, "unable to start output device: %s", soundio_strerror(err));
602         return 0;
603     }
604     init_audio_result |= 1;
(gdb) p *outstream
$1 = {device = 0x7ffff000f320, format = SoundIoFormatS16LE, sample_rate = 44100, layout = {
    name = 0x7ffff6e490c7 "Stereo", channel_count = 2, channels = {SoundIoChannelIdFrontLeft, 
      SoundIoChannelIdFrontRight, SoundIoChannelIdInvalid <repeats 22 times>}}, software_latency = 2, 
  volume = 0, userdata = 0x0, 
  write_callback = 0x5555555686ad <write_callback(SoundIoOutStream*, int, int)>, 
  underflow_callback = 0x5555555688ae <underflow_callback(SoundIoOutStream*)>, 
  error_callback = 0x7ffff6e49411, 
  name = 0x400000000 <error: Cannot access memory at address 0x400000000>, non_terminal_hint = 2, 
  bytes_per_frame = 0, bytes_per_sample = 1438323824, layout_error = 21845}
(gdb) 

(I'm Myon on freenode in #es'hail-2 if you are on IRC.)

dj0abr commented 3 years ago

Hi, sorry for the late reply. I will install Debian in a VM to test it. I think it will be the best to build it from source. libsoundio is here on github: https://github.com/andrewrk/libsoundio Building it on the target system should remove all incompatibilities. I will give it a try. Kurt

dj0abr commented 3 years ago

Hi, just tested it in a VM. With the actual version of bullseye and V0.51 of hsmodem it is working out of the box. Maybe some of the changes in the last week solved that problem. vy 73 Kurt

df7cb commented 3 years ago

Sorry for the late feedback here, the problem was that I was still using libsoundio1; the problem is fixed when upgrading to libsoundio2. (Which I've packaged and is on the way to Debian unstable -- https://salsa.debian.org/debian-hamradio-team/libsoundio)