amsat-dl / QO-100-Modem

The purpose of this project is to transfer data (pictures...) via a 2,7kHz SSB channel on the narrow band transponder as fast as possible
GNU General Public License v3.0
20 stars 6 forks source link

PortAudio error when trying to open audio device exclusively #1

Open RipperFox opened 3 years ago

RipperFox commented 3 years ago

OS: Windows 10 20H2 64bit Soundcards: OnBoard Realtek ALC1200 Codec (defaults to 24 Bit(!)/48kHz) / registered VAC 4.65 / IC 7300

When running your version 0.87 PA reports error -9997 on all my audio devices but the IC 7300, e.g.:

Start request for CAP stream:Line 3 (Virtual Audio Cable)
Starting CAP stream:Line 3 (Virtual Audio Cable) [7]
create resampler 7 real 48000 req 44100
0.918750  44100.000000  48000.000000
err:-9997 device:7 PAdev:20 samprate: 48000.000000
cannot open capture stream for device:<Line 3 (Virtual Audio Cable)> -9997
CAP: cannot open device: Line 3 (Virtual Audio Cable)

I got rid of error -9997 by removing the paWinWasapiExclusive flag from PaWasapiStreamInfo. Error -9997 reads "wrong samplerate", but I think it might something else.

Is "Exclusive mode" really necessary? This mode is designed for e.g. outputting native Dolby Digital, DTS, etc and goes around Windows' internal resampler/mixer..

I still got error -9998 (wrong number of channels?) on playback:

Start request for PB stream:Lautsprecher (Realtek(R) Audio)
Starting PB stream:Lautsprecher (Realtek(R) Audio) [3]
create resampler 3 real 48000 req 44100
1.088435  48000.000000  44100.000000
Playback : err:-9998 device:3 PAdev:16 samprate: 48000.000000 chans:2
Playback started sucessfully

..but playback actually works anyway!

Thanks for your great work!

PS: You could vastly reduce compile time of hsmodem: https://helgeklein.com/blog/2019/12/enabling-multi-processor-parallel-builds-in-visual-studio/ Enabling this reduces build time from ~18 to <3 seconds for me :)

RipperFox commented 3 years ago

Tested with version 0.87 from https://dj0abr.de/german/technik/sat/modem/images.htm

Still unable to open Audio devices in exclusive mode:

user home path:<C:\Users\User> init tune tones to samprate: 44100 Distributor running libkmaudio_close libkmaudio_init PortAudio version: 0x00130600 Windows Devices found: Portaudio ID: 0 Name: Line 1 (Virtual Audio Cable) Cap/PB: 1 Channels: i:0 o:2 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 1 Name: Speakers (NVIDIA Broadcast) Cap/PB: 1 Channels: i:0 o:2 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 2 Name: Line 2 (Virtual Audio Cable) Cap/PB: 1 Channels: i:0 o:2 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 3 Name: Lautsprecher (USB Audio CODEC ) Cap/PB: 1 Channels: i:0 o:2 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 4 Name: ROG PG279Q (NVIDIA High Definition Audio) Cap/PB: 1 Channels: i:0 o:2 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 5 Name: Lautsprecher (Realtek(R) Audio) Cap/PB: 1 Channels: i:0 o:2 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 6 Name: Line 3 (Virtual Audio Cable) Cap/PB: 1 Channels: i:0 o:2 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 7 Name: Line 1 (Virtual Audio Cable) Cap/PB: 0 Channels: i:2 o:0 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 8 Name: Line 3 (Virtual Audio Cable) Cap/PB: 0 Channels: i:2 o:0 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 9 Name: Mikrofon (NVIDIA Broadcast) Cap/PB: 0 Channels: i:2 o:0 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 10 Name: Stereomix (Realtek(R) Audio) Cap/PB: 0 Channels: i:2 o:0 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 11 Name: Mikrofon (Realtek(R) Audio) Cap/PB: 0 Channels: i:2 o:0 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 12 Name: Line 2 (Virtual Audio Cable) Cap/PB: 0 Channels: i:2 o:0 SR 44100: 0 SR 48000: 1 is active: yes Portaudio ID: 13 Name: Mikrofon (USB Audio CODEC ) Cap/PB: 0 Channels: i:1 o:0 SR 44100: 0 SR 48000: 1 is active: yes starting websocket server websocket server running Websocket Server: listen to port:40134 port 40131 sucessfully bound Waiting for incoming connections... port 40132 sucessfully bound port 40135 sucessfully bound QO100modem initialised and running set speedmode:9 restart modem requested startModem. Speedmode:9 Close RTTY Start request for CAP stream:Stereomix (Realtek(R) Audio) Starting CAP stream:Stereomix (Realtek(R) Audio) [10] err:0 device:10 PAdev:26 samprate: 48000.000000 Capture started sucessfully Start request for PB stream:Line 3 (Virtual Audio Cable) Starting PB stream:Line 3 (Virtual Audio Cable) [6] Playback : err:-9998 device:6 PAdev:22 samprate: 48000.000000 chans:2 cannot open playback stream for device:<Line 3 (Virtual Audio Cable)> -9997 PB: cannot open device: Line 3 (Virtual Audio Cable) Start request for CAP stream:Mikrofon (Realtek(R) Audio) Starting CAP stream:Mikrofon (Realtek(R) Audio) [11] err:0 device:11 PAdev:27 samprate: 48000.000000 Capture started sucessfully Start request for PB stream:Lautsprecher (Realtek(R) Audio) Starting PB stream:Lautsprecher (Realtek(R) Audio) [5] Playback : err:-9998 device:5 PAdev:21 samprate: 48000.000000 chans:2 cannot open playback stream for device:<Lautsprecher (Realtek(R) Audio)> -9997 Voice PB: cannot open device: Lautsprecher (Realtek(R) Audio)

DG9BFC commented 2 years ago

maybe the problem could be solved if hs modem would use 48000 sample rate?!? i have sett all my soundcards (and virtual cables) to 48000 ... and also get error -9997 why do i use 48000 ?? cause sdr console uses 48000