kcat / openal-soft

OpenAL Soft is a software implementation of the OpenAL 3D audio API.
Other
2.15k stars 522 forks source link

OpenAL on Raspbian gives garbled output #359

Open righthalfplane opened 4 years ago

righthalfplane commented 4 years ago

When I run my SDR on the latest version of Raspbian, I get a garbled auto output from OpenAL that is just barely understandable. When I run a simple example, that should give a simple sine wave - I get a sound of about the right frequency, but modulated with a low roar. I am doing output through html to the speakers on the monitor. Any ideas as to what the problem is ?

kcat commented 4 years ago

Is it using PulseAudio or ALSA? How is the device configured (stereo, 5.1, etc)? Can you provide a trace log (set the ALSOFT_LOGLEVEL env var to3` when you run the app, and it'll log to stderr)?

righthalfplane commented 4 years ago

I finally found a work around for the problem. Using "alsoft.conf" I tried all of the backends - only "oss" worked with a problem. PulseAudio and ALSA had the garbled auto. PortAudio seem to work- after giving many lines of error messages. All the other options failed.

righthalfplane commented 4 years ago

Opps - "oss" worked without a problem.

kcat commented 4 years ago

I'll need to see a trace log. Preferably when using PulseAudio, ALSA, and OSS, to see what it's doing for each and compare with the working OSS output.

righthalfplane commented 4 years ago

When First ran the program, I got the garbled output - this was the output ` raspberrypi:~/Desktop/SdrGlut> ./sdrglut.x AL lib: (II) alc_initconfig: Initializing library v1.19.1-unknown UNKNOWN AL lib: (II) alc_initconfig: Supported backends: jack, pulse, alsa, sndio, oss, port, null, wave AL lib: (II) ReadALConfig: Loading config /etc/openal/alsoft.conf... AL lib: (II) LoadConfigFromFile: found 'decoder/hq-mode' = 'false' AL lib: (II) LoadConfigFromFile: found 'decoder/distance-comp' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc-ref-delay' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/quad' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround51' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround61' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround71' = '' AL lib: (II) ReadALConfig: Loading config /etc/xdg/alsoft.conf... AL lib: (II) ReadALConfig: Loading config /home/pi/.alsoftrc... AL lib: (II) ReadALConfig: Loading config /home/pi/.config/alsoft.conf... AL lib: (II) GetProcBinary: Got path: /home/pi/Desktop/SdrGlut AL lib: (II) ReadALConfig: Loading config /home/pi/Desktop/SdrGlut/alsoft.conf... AL lib: (II) GetConfigValue: Key disable-cpu-exts not found AL lib: (II) FillCPUCaps: Got features string:half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

AL lib: (II) FillCPUCaps: Extensions: +NEON AL lib: (II) GetConfigValue: Key rt-prio not found AL lib: (II) GetConfigValue: Key resampler not found AL lib: (II) GetConfigValue: Key trap-al-error not found AL lib: (II) GetConfigValue: Key trap-alc-error not found AL lib: (II) GetConfigValue: Key reverb/boost not found AL lib: (II) GetConfigValue: Key drivers not found AL lib: (WW) GetSymbol: Failed to load jack_error_callback: /usr/lib/arm-linux-gnueabihf/libjack.so.0: undefined symbol: jack_error_callback AL lib: (II) GetConfigValue: Key jack/spawn-server not found AL lib: (WW) jack_msg_handler: Cannot connect to server socket err = No such file or directory AL lib: (WW) jack_msg_handler: Cannot connect to server request channel AL lib: (WW) jack_msg_handler: jack server is not running or cannot be started AL lib: (WW) jack_msg_handler: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock AL lib: (WW) jack_msg_handler: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock AL lib: (WW) ALCjackBackendFactory_init: jack_client_open() failed, 0x11 AL lib: (WW) alc_initconfig: Failed to initialize backend "jack" AL lib: (II) GetConfigValue: Key pulse/spawn-server not found AL lib: (II) GetProcBinary: Got filename: sdrglut.x AL lib: (II) alc_initconfig: Initialized backend "pulse" AL lib: (II) alc_initconfig: Added "pulse" for playback AL lib: (II) alc_initconfig: Added "pulse" for capture AL lib: (II) GetConfigValue: Key excludefx not found AL lib: (II) GetConfigValue: Key default-reverb not found AL lib: (II) GetConfigValue: Key channels not found AL lib: (II) GetConfigValue: Key sample-type not found AL lib: (II) GetConfigValue: Key frequency not found AL lib: (II) GetConfigValue: Key periods not found AL lib: (II) GetConfigValue: Key period_size not found AL lib: (II) GetConfigValue: Key sources not found AL lib: (II) GetConfigValue: Key slots not found AL lib: (II) GetConfigValue: Key sends not found AL lib: (II) GetProcBinary: Got filename: sdrglut.x AL lib: (II) GetConfigValue: Key pulse/allow-moves not found AL lib: (II) ALCpulsePlayback_open: Connecting to "(default)" AL lib: (II) GetConfigValue: Key ambi-format not found AL lib: (II) alcOpenDevice: Created device 0x14b4410, "Built-in Audio Analog Mono" AL lib: (II) GetConfigValue: Key hrtf not found AL lib: (II) UpdateDeviceParams: Pre-reset: Stereo, Float, 44100hz, 1024 update size x3 AL lib: (II) ALCpulsePlayback_sinkInfoCallback: Active port: analog-output (Analog Output) AL lib: (II) GetConfigValue: Key pulse/fix-rate not found AL lib: (II) GetConfigValue: Key pulse/allow-moves not found AL lib: (II) ALCpulsePlayback_bufferAttrCallback: minreq=4096, tlength=10240, prebuf=0 AL lib: (II) UpdateDeviceParams: Post-reset: Mono, Float, 48000hz, 1024 update size x3 AL lib: (II) aluInitRenderer: Front stablizer disabled AL lib: (II) UpdateDeviceParams: Channel config, Dry: 1, FOA: 0, Real: 0 AL lib: (II) UpdateDeviceParams: Allocating 1 channels, 8192 bytes AL lib: (II) UpdateDeviceParams: Max sources: 256 (255 + 1), effect slots: 64, sends: 2 AL lib: (II) GetConfigValue: Key dither not found AL lib: (II) GetConfigValue: Key dither-depth not found AL lib: (II) UpdateDeviceParams: Dithering disabled AL lib: (II) GetConfigValue: Key output-limiter not found AL lib: (II) UpdateDeviceParams: Output limiter enabled AL lib: (II) UpdateDeviceParams: Fixed device latency: 1000000ns AL lib: (II) GetConfigValue: Key volume-adjust not found AL lib: (II) alcCreateContext: Created context 0x14b0110

Number of Devices: 1 Looking for Device: 0 Found device #0:driver=sdrplay, label=SDRplay Dev0 RSP1 B0001P0004, serial=B0001P0004, FrequencyRange max 2e+09 min 10000 hasDCOffset 0 [INFO] Using format CF32. Device sdrplay samplerate 2000000 rx->size 200000 Bandwidth 1536000 ^C raspberrypi:~/Desktop/SdrGlut>

`

Next I set it for ALSA, this time it was OK.

` aspberrypi:~/Desktop/SdrGlut> ./sdrglut.x AL lib: (II) alc_initconfig: Initializing library v1.19.1-unknown UNKNOWN AL lib: (II) alc_initconfig: Supported backends: jack, pulse, alsa, sndio, oss, port, null, wave AL lib: (II) ReadALConfig: Loading config /etc/openal/alsoft.conf... AL lib: (II) LoadConfigFromFile: found 'decoder/hq-mode' = 'false' AL lib: (II) LoadConfigFromFile: found 'decoder/distance-comp' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc-ref-delay' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/quad' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround51' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround61' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround71' = '' AL lib: (II) ReadALConfig: Loading config /etc/xdg/alsoft.conf... AL lib: (II) ReadALConfig: Loading config /home/pi/.alsoftrc... AL lib: (II) LoadConfigFromFile: found 'layout_STEREO' = 'fl=-30, fr=30' AL lib: (II) LoadConfigFromFile: found 'format' = 'AL_FORMAT_STEREO16' AL lib: (II) LoadConfigFromFile: found 'cf_level' = '0' AL lib: (II) LoadConfigFromFile: found 'sources' = '256' AL lib: (II) LoadConfigFromFile: found 'frequency' = '44100' AL lib: (II) LoadConfigFromFile: found 'period_size' = '1024' AL lib: (II) LoadConfigFromFile: found 'periods' = '4' AL lib: (II) LoadConfigFromFile: found 'stereodup' = 'false' AL lib: (II) LoadConfigFromFile: found 'excludefx' = '' AL lib: (II) LoadConfigFromFile: found 'slots' = '4' AL lib: (II) LoadConfigFromFile: found 'sends' = '2' AL lib: (II) LoadConfigFromFile: found 'drivers' = 'alsa' AL lib: (II) LoadConfigFromFile: found 'alsa/device' = 'default' AL lib: (II) LoadConfigFromFile: found 'alsa/capture' = 'default' AL lib: (II) LoadConfigFromFile: found 'alsa/mmap' = 'true' AL lib: (II) LoadConfigFromFile: found 'oss/device' = '/dev/dsp' AL lib: (II) LoadConfigFromFile: found 'oss/capture' = '/dev/dsp' AL lib: (II) LoadConfigFromFile: found 'port/device' = '-1' AL lib: (II) LoadConfigFromFile: found 'solaris/device' = '/dev/audio' AL lib: (II) LoadConfigFromFile: found 'wave/file' = '' AL lib: (II) ReadALConfig: Loading config /home/pi/.config/alsoft.conf... AL lib: (II) GetProcBinary: Got path: /home/pi/Desktop/SdrGlut AL lib: (II) ReadALConfig: Loading config /home/pi/Desktop/SdrGlut/alsoft.conf... AL lib: (II) GetConfigValue: Key disable-cpu-exts not found AL lib: (II) FillCPUCaps: Got features string:half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

AL lib: (II) FillCPUCaps: Extensions: +NEON AL lib: (II) GetConfigValue: Key rt-prio not found AL lib: (II) GetConfigValue: Key resampler not found AL lib: (II) GetConfigValue: Key trap-al-error not found AL lib: (II) GetConfigValue: Key trap-alc-error not found AL lib: (II) GetConfigValue: Key reverb/boost not found AL lib: (II) GetConfigValue: Found drivers = "alsa" AL lib: (II) alc_initconfig: Initialized backend "alsa" AL lib: (II) alc_initconfig: Added "alsa" for playback AL lib: (II) alc_initconfig: Added "alsa" for capture AL lib: (II) GetConfigValue: Found excludefx = "" AL lib: (II) GetConfigValue: Key default-reverb not found AL lib: (II) GetConfigValue: Key channels not found AL lib: (II) GetConfigValue: Key sample-type not found AL lib: (II) GetConfigValue: Found frequency = "44100" AL lib: (II) GetConfigValue: Found periods = "4" AL lib: (II) GetConfigValue: Found period_size = "1024" AL lib: (II) GetConfigValue: Found sources = "256" AL lib: (II) GetConfigValue: Found slots = "4" AL lib: (II) GetConfigValue: Found sends = "2" AL lib: (II) GetConfigValue: Found alsa/device = "default" AL lib: (II) ALCplaybackAlsa_open: Opening device "default" AL lib: (II) GetConfigValue: Key ambi-format not found AL lib: (II) alcOpenDevice: Created device 0xb70120, "ALSA Default" AL lib: (II) GetConfigValue: Key hrtf not found AL lib: (II) UpdateDeviceParams: Pre-reset: Stereo, Float, *44100hz, 1024 update size x4 AL lib: (II) GetConfigValue: Found alsa/mmap = "true" AL lib: (II) GetConfigValue: Key alsa/allow-resampler not found AL lib: (II) UpdateDeviceParams: Post-reset: Stereo, Float, 44100hz, 1024 update size x4 AL lib: (II) GetConfigValue: Key stereo-mode not found AL lib: (II) aluInitRenderer: HRTF disabled AL lib: (II) GetConfigValue: Found cf_level = "0" AL lib: (II) aluInitRenderer: BS2B disabled AL lib: (II) GetConfigValue: Key stereo-encoding not found AL lib: (II) aluInitRenderer: UHJ disabled AL lib: (II) UpdateDeviceParams: Channel config, Dry: 2, FOA: 0, Real: 0 AL lib: (II) UpdateDeviceParams: Allocating 2 channels, 16384 bytes AL lib: (II) UpdateDeviceParams: Max sources: 256 (255 + 1), effect slots: 4, sends: 2 AL lib: (II) GetConfigValue: Key dither not found AL lib: (II) GetConfigValue: Key dither-depth not found AL lib: (II) UpdateDeviceParams: Dithering disabled AL lib: (II) GetConfigValue: Key output-limiter not found AL lib: (II) UpdateDeviceParams: Output limiter enabled AL lib: (II) UpdateDeviceParams: Fixed device latency: 997732ns AL lib: (II) GetConfigValue: Key volume-adjust not found AL lib: (II) alcCreateContext: Created context 0xb94c60 AL lib: (EE) ALCplaybackAlsa_mixerNoMMapProc: Wait timeout... buffer size too low?

Number of Devices: 1 Looking for Device: 0 Found device #0:driver=sdrplay, label=SDRplay Dev0 RSP1 B0001P0004, serial=B0001P0004, FrequencyRange max 2e+09 min 10000 hasDCOffset 0 [INFO] Using format CF32. Device sdrplay samplerate 2000000 rx->size 200000 Bandwidth 1536000 AL lib: (II) FreeContext: 0xb94c60 AL lib: (II) FreeContext: Freed 0 context property objects AL lib: (II) FreeContext: Freed 0 AuxiliaryEffectSlot property objects AL lib: (II) FreeContext: Freed 1 voice property object AL lib: (II) FreeContext: Freed 1 listener property object AL lib: (II) FreeDevice: 0xb70120 raspberrypi:~/Desktop/SdrGlut> :x

`

The I set it for PulseAuto, this time it was OK.

`AL lib: (II) alc_initconfig: Initializing library v1.19.1-unknown UNKNOWN AL lib: (II) alc_initconfig: Supported backends: jack, pulse, alsa, sndio, oss, port, null, wave AL lib: (II) ReadALConfig: Loading config /etc/openal/alsoft.conf... AL lib: (II) LoadConfigFromFile: found 'decoder/hq-mode' = 'false' AL lib: (II) LoadConfigFromFile: found 'decoder/distance-comp' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc-ref-delay' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/quad' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround51' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround61' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround71' = '' AL lib: (II) ReadALConfig: Loading config /etc/xdg/alsoft.conf... AL lib: (II) ReadALConfig: Loading config /home/pi/.alsoftrc... AL lib: (II) LoadConfigFromFile: found 'layout_STEREO' = 'fl=-30, fr=30' AL lib: (II) LoadConfigFromFile: found 'format' = 'AL_FORMAT_STEREO16' AL lib: (II) LoadConfigFromFile: found 'cf_level' = '0' AL lib: (II) LoadConfigFromFile: found 'sources' = '256' AL lib: (II) LoadConfigFromFile: found 'frequency' = '44100' AL lib: (II) LoadConfigFromFile: found 'period_size' = '1024' AL lib: (II) LoadConfigFromFile: found 'periods' = '4' AL lib: (II) LoadConfigFromFile: found 'stereodup' = 'false' AL lib: (II) LoadConfigFromFile: found 'excludefx' = '' AL lib: (II) LoadConfigFromFile: found 'slots' = '4' AL lib: (II) LoadConfigFromFile: found 'sends' = '2' AL lib: (II) LoadConfigFromFile: found 'drivers' = 'pulse' AL lib: (II) LoadConfigFromFile: found 'alsa/device' = 'default' AL lib: (II) LoadConfigFromFile: found 'alsa/capture' = 'default' AL lib: (II) LoadConfigFromFile: found 'alsa/mmap' = 'true' AL lib: (II) LoadConfigFromFile: found 'oss/device' = '/dev/dsp' AL lib: (II) LoadConfigFromFile: found 'oss/capture' = '/dev/dsp' AL lib: (II) LoadConfigFromFile: found 'port/device' = '-1' AL lib: (II) LoadConfigFromFile: found 'solaris/device' = '/dev/audio' AL lib: (II) LoadConfigFromFile: found 'wave/file' = '' AL lib: (II) ReadALConfig: Loading config /home/pi/.config/alsoft.conf... AL lib: (II) GetProcBinary: Got path: /home/pi/Desktop/SdrGlut AL lib: (II) ReadALConfig: Loading config /home/pi/Desktop/SdrGlut/alsoft.conf... AL lib: (II) GetConfigValue: Key disable-cpu-exts not found AL lib: (II) FillCPUCaps: Got features string:half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

AL lib: (II) FillCPUCaps: Extensions: +NEON AL lib: (II) GetConfigValue: Key rt-prio not found AL lib: (II) GetConfigValue: Key resampler not found AL lib: (II) GetConfigValue: Key trap-al-error not found AL lib: (II) GetConfigValue: Key trap-alc-error not found AL lib: (II) GetConfigValue: Key reverb/boost not found AL lib: (II) GetConfigValue: Found drivers = "pulse" AL lib: (II) GetConfigValue: Key pulse/spawn-server not found AL lib: (II) GetProcBinary: Got filename: sdrglut.x AL lib: (II) alc_initconfig: Initialized backend "pulse" AL lib: (II) alc_initconfig: Added "pulse" for playback AL lib: (II) alc_initconfig: Added "pulse" for capture AL lib: (II) GetConfigValue: Found excludefx = "" AL lib: (II) GetConfigValue: Key default-reverb not found AL lib: (II) GetConfigValue: Key channels not found AL lib: (II) GetConfigValue: Key sample-type not found AL lib: (II) GetConfigValue: Found frequency = "44100" AL lib: (II) GetConfigValue: Found periods = "4" AL lib: (II) GetConfigValue: Found period_size = "1024" AL lib: (II) GetConfigValue: Found sources = "256" AL lib: (II) GetConfigValue: Found slots = "4" AL lib: (II) GetConfigValue: Found sends = "2" AL lib: (II) GetProcBinary: Got filename: sdrglut.x AL lib: (II) GetConfigValue: Key pulse/allow-moves not found AL lib: (II) ALCpulsePlayback_open: Connecting to "(default)" AL lib: (II) GetConfigValue: Key ambi-format not found AL lib: (II) alcOpenDevice: Created device 0x15804b0, "Built-in Audio Analog Mono" AL lib: (II) GetConfigValue: Key hrtf not found AL lib: (II) UpdateDeviceParams: Pre-reset: Stereo, Float, *44100hz, 1024 update size x4 AL lib: (II) ALCpulsePlayback_sinkInfoCallback: Active port: analog-output (Analog Output) AL lib: (II) GetConfigValue: Key pulse/fix-rate not found AL lib: (II) GetConfigValue: Key pulse/allow-moves not found AL lib: (II) ALCpulsePlayback_bufferAttrCallback: minreq=4096, tlength=12288, prebuf=0 AL lib: (II) UpdateDeviceParams: Post-reset: Mono, Float, 44100hz, 1024 update size x3 AL lib: (II) aluInitRenderer: Front stablizer disabled AL lib: (II) UpdateDeviceParams: Channel config, Dry: 1, FOA: 0, Real: 0 AL lib: (II) UpdateDeviceParams: Allocating 1 channels, 8192 bytes AL lib: (II) UpdateDeviceParams: Max sources: 256 (255 + 1), effect slots: 4, sends: 2 AL lib: (II) GetConfigValue: Key dither not found AL lib: (II) GetConfigValue: Key dither-depth not found AL lib: (II) UpdateDeviceParams: Dithering disabled AL lib: (II) GetConfigValue: Key output-limiter not found AL lib: (II) UpdateDeviceParams: Output limiter enabled AL lib: (II) UpdateDeviceParams: Fixed device latency: 997732ns AL lib: (II) GetConfigValue: Key volume-adjust not found AL lib: (II) alcCreateContext: Created context 0x157c1b0

Number of Devices: 1 Looking for Device: 0 Found device #0:driver=sdrplay, label=SDRplay Dev0 RSP1 B0001P0004, serial=B0001P0004, FrequencyRange max 2e+09 min 10000 hasDCOffset 0 [INFO] Using format CF32. Device sdrplay samplerate 8000000 rx->size 800000 Bandwidth 8000000 AL lib: (II) FreeContext: 0x157c1b0 AL lib: (II) FreeContext: Freed 0 context property objects AL lib: (II) FreeContext: Freed 0 AuxiliaryEffectSlot property objects AL lib: (II) FreeContext: Freed 1 voice property object AL lib: (II) FreeContext: Freed 1 listener property object AL lib: (II) FreeDevice: 0x15804b0 raspberrypi:~/Desktop/SdrGlut> :

`

Then I destroyed the configuration file and it was garbled again -

`AL lib: (II) alc_initconfig: Initializing library v1.19.1-unknown UNKNOWN AL lib: (II) alc_initconfig: Supported backends: jack, pulse, alsa, sndio, oss, port, null, wave AL lib: (II) ReadALConfig: Loading config /etc/openal/alsoft.conf... AL lib: (II) LoadConfigFromFile: found 'decoder/hq-mode' = 'false' AL lib: (II) LoadConfigFromFile: found 'decoder/distance-comp' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc-ref-delay' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/quad' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround51' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround61' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround71' = '' AL lib: (II) ReadALConfig: Loading config /etc/xdg/alsoft.conf... AL lib: (II) ReadALConfig: Loading config /home/pi/.alsoftrc... AL lib: (II) ReadALConfig: Loading config /home/pi/.config/alsoft.conf... AL lib: (II) GetProcBinary: Got path: /home/pi/Desktop/SdrGlut AL lib: (II) ReadALConfig: Loading config /home/pi/Desktop/SdrGlut/alsoft.conf... AL lib: (II) GetConfigValue: Key disable-cpu-exts not found AL lib: (II) FillCPUCaps: Got features string:half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

AL lib: (II) FillCPUCaps: Extensions: +NEON AL lib: (II) GetConfigValue: Key rt-prio not found AL lib: (II) GetConfigValue: Key resampler not found AL lib: (II) GetConfigValue: Key trap-al-error not found AL lib: (II) GetConfigValue: Key trap-alc-error not found AL lib: (II) GetConfigValue: Key reverb/boost not found AL lib: (II) GetConfigValue: Key drivers not found AL lib: (WW) GetSymbol: Failed to load jack_error_callback: /usr/lib/arm-linux-gnueabihf/libjack.so.0: undefined symbol: jack_error_callback AL lib: (II) GetConfigValue: Key jack/spawn-server not found AL lib: (WW) jack_msg_handler: Cannot connect to server socket err = No such file or directory AL lib: (WW) jack_msg_handler: Cannot connect to server request channel AL lib: (WW) jack_msg_handler: jack server is not running or cannot be started AL lib: (WW) jack_msg_handler: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock AL lib: (WW) jack_msg_handler: JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock AL lib: (WW) ALCjackBackendFactory_init: jack_client_open() failed, 0x11 AL lib: (WW) alc_initconfig: Failed to initialize backend "jack" AL lib: (II) GetConfigValue: Key pulse/spawn-server not found AL lib: (II) GetProcBinary: Got filename: sdrglut.x AL lib: (II) alc_initconfig: Initialized backend "pulse" AL lib: (II) alc_initconfig: Added "pulse" for playback AL lib: (II) alc_initconfig: Added "pulse" for capture AL lib: (II) GetConfigValue: Key excludefx not found AL lib: (II) GetConfigValue: Key default-reverb not found AL lib: (II) GetConfigValue: Key channels not found AL lib: (II) GetConfigValue: Key sample-type not found AL lib: (II) GetConfigValue: Key frequency not found AL lib: (II) GetConfigValue: Key periods not found AL lib: (II) GetConfigValue: Key period_size not found AL lib: (II) GetConfigValue: Key sources not found AL lib: (II) GetConfigValue: Key slots not found AL lib: (II) GetConfigValue: Key sends not found AL lib: (II) GetProcBinary: Got filename: sdrglut.x AL lib: (II) GetConfigValue: Key pulse/allow-moves not found AL lib: (II) ALCpulsePlayback_open: Connecting to "(default)" AL lib: (II) GetConfigValue: Key ambi-format not found AL lib: (II) alcOpenDevice: Created device 0xa4b410, "Built-in Audio Analog Mono" AL lib: (II) GetConfigValue: Key hrtf not found AL lib: (II) UpdateDeviceParams: Pre-reset: Stereo, Float, 44100hz, 1024 update size x3 AL lib: (II) ALCpulsePlayback_sinkInfoCallback: Active port: analog-output (Analog Output) AL lib: (II) GetConfigValue: Key pulse/fix-rate not found AL lib: (II) GetConfigValue: Key pulse/allow-moves not found AL lib: (II) ALCpulsePlayback_bufferAttrCallback: minreq=4096, tlength=10240, prebuf=0 AL lib: (II) UpdateDeviceParams: Post-reset: Mono, Float, 44100hz, 1024 update size x3 AL lib: (II) aluInitRenderer: Front stablizer disabled AL lib: (II) UpdateDeviceParams: Channel config, Dry: 1, FOA: 0, Real: 0 AL lib: (II) UpdateDeviceParams: Allocating 1 channels, 8192 bytes AL lib: (II) UpdateDeviceParams: Max sources: 256 (255 + 1), effect slots: 64, sends: 2 AL lib: (II) GetConfigValue: Key dither not found AL lib: (II) GetConfigValue: Key dither-depth not found AL lib: (II) UpdateDeviceParams: Dithering disabled AL lib: (II) GetConfigValue: Key output-limiter not found AL lib: (II) UpdateDeviceParams: Output limiter enabled AL lib: (II) UpdateDeviceParams: Fixed device latency: 997732ns AL lib: (II) GetConfigValue: Key volume-adjust not found AL lib: (II) alcCreateContext: Created context 0xa47110

Number of Devices: 1 Looking for Device: 0 Found device #0:driver=sdrplay, label=SDRplay Dev0 RSP1 B0001P0004, serial=B0001P0004, FrequencyRange max 2e+09 min 10000 hasDCOffset 0 [INFO] Using format CF32. Device sdrplay samplerate 8000000 rx->size 800000 Bandwidth 8000000 AL lib: (II) FreeContext: 0xa47110 AL lib: (II) FreeContext: Freed 0 context property objects AL lib: (II) FreeContext: Freed 0 AuxiliaryEffectSlot property objects AL lib: (II) FreeContext: Freed 1 voice property object AL lib: (II) FreeContext: Freed 1 listener property object AL lib: (II) FreeDevice: 0xa4b410 raspberrypi:~/Desktop/SdrGlut>

`

I then set it for OSS, now OSS fails -

` raspberrypi:~/Desktop/SdrGlut> ./sdrglut.x AL lib: (II) alc_initconfig: Initializing library v1.19.1-unknown UNKNOWN AL lib: (II) alc_initconfig: Supported backends: jack, pulse, alsa, sndio, oss, port, null, wave AL lib: (II) ReadALConfig: Loading config /etc/openal/alsoft.conf... AL lib: (II) LoadConfigFromFile: found 'decoder/hq-mode' = 'false' AL lib: (II) LoadConfigFromFile: found 'decoder/distance-comp' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc' = 'true' AL lib: (II) LoadConfigFromFile: found 'decoder/nfc-ref-delay' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/quad' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround51' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround61' = '' AL lib: (II) LoadConfigFromFile: found 'decoder/surround71' = '' AL lib: (II) ReadALConfig: Loading config /etc/xdg/alsoft.conf... AL lib: (II) ReadALConfig: Loading config /home/pi/.alsoftrc... AL lib: (II) LoadConfigFromFile: found 'layout_STEREO' = 'fl=-90, fr=90' AL lib: (II) LoadConfigFromFile: found 'format' = 'AL_FORMAT_STEREO16' AL lib: (II) LoadConfigFromFile: found 'cf_level' = '0' AL lib: (II) LoadConfigFromFile: found 'sources' = '256' AL lib: (II) LoadConfigFromFile: found 'frequency' = '44100' AL lib: (II) LoadConfigFromFile: found 'period_size' = '1024' AL lib: (II) LoadConfigFromFile: found 'periods' = '4' AL lib: (II) LoadConfigFromFile: found 'stereodup' = 'false' AL lib: (II) LoadConfigFromFile: found 'excludefx' = '' AL lib: (II) LoadConfigFromFile: found 'slots' = '4' AL lib: (II) LoadConfigFromFile: found 'sends' = '2' AL lib: (II) LoadConfigFromFile: found 'drivers' = 'oss' AL lib: (II) LoadConfigFromFile: found 'alsa/device' = 'default' AL lib: (II) LoadConfigFromFile: found 'alsa/capture' = 'default' AL lib: (II) LoadConfigFromFile: found 'alsa/mmap' = 'true' AL lib: (II) LoadConfigFromFile: found 'oss/device' = '/dev/dsp' AL lib: (II) LoadConfigFromFile: found 'oss/capture' = '/dev/dsp' AL lib: (II) LoadConfigFromFile: found 'port/device' = '-1' AL lib: (II) LoadConfigFromFile: found 'solaris/device' = '/dev/audio' AL lib: (II) LoadConfigFromFile: found 'wave/file' = '' AL lib: (II) ReadALConfig: Loading config /home/pi/.config/alsoft.conf... AL lib: (II) GetProcBinary: Got path: /home/pi/Desktop/SdrGlut AL lib: (II) ReadALConfig: Loading config /home/pi/Desktop/SdrGlut/alsoft.conf... AL lib: (II) GetConfigValue: Key disable-cpu-exts not found AL lib: (II) FillCPUCaps: Got features string:half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

AL lib: (II) FillCPUCaps: Extensions: +NEON AL lib: (II) GetConfigValue: Key rt-prio not found AL lib: (II) GetConfigValue: Key resampler not found AL lib: (II) GetConfigValue: Key trap-al-error not found AL lib: (II) GetConfigValue: Key trap-alc-error not found AL lib: (II) GetConfigValue: Key reverb/boost not found AL lib: (II) GetConfigValue: Found drivers = "oss" AL lib: (II) GetConfigValue: Found oss/device = "/dev/dsp" AL lib: (II) GetConfigValue: Found oss/capture = "/dev/dsp" AL lib: (II) alc_initconfig: Initialized backend "oss" AL lib: (II) alc_initconfig: Added "oss" for playback AL lib: (II) alc_initconfig: Added "oss" for capture AL lib: (II) GetConfigValue: Found excludefx = "" AL lib: (II) GetConfigValue: Key default-reverb not found AL lib: (II) GetConfigValue: Key channels not found AL lib: (II) GetConfigValue: Key sample-type not found AL lib: (II) GetConfigValue: Found frequency = "44100" AL lib: (II) GetConfigValue: Found periods = "4" AL lib: (II) GetConfigValue: Found period_size = "1024" AL lib: (II) GetConfigValue: Found sources = "256" AL lib: (II) GetConfigValue: Found slots = "4" AL lib: (II) GetConfigValue: Found sends = "2" AL lib: (EE) ALCplaybackOSS_open: Could not open /dev/dsp: No such file or directory AL lib: (II) FreeDevice: 0x674120 AL lib: (WW) alcSetError: Error generated on device (nil), code 0xa004 AL lib: (WW) alcSetError: Error generated on device (nil), code 0xa001 AL lib: (WW) alGetError: Querying error state on null context (implicitly 0xa004) alGenSources : (null) startAudio Failed raspberrypi:~/Desktop/SdrGlut>

`

This was on a new install - it give garbled output with no local config file. It does not do what it did last time.

kcat commented 4 years ago

A bit late on this, sorry about that. The only difference I can see is that the garbled output uses 3 buffer periods, whereas the ones that are okay use 4. That suggests to me it's having trouble keeping up with the device and is constantly underrunning.

If that's the case, you can try setting the rt-prio config option to 1 to enable real-time processing on the mixing thread (current master enables this by default). Ideally the kernel would boost the priority of the mixing thread automatically since it spends most of the time sleeping, but low power devices that throttle the cpu speed seems to interfere.

stgatilov commented 3 years ago

One of TDM users had similar problem. See original discussion on TDM forums.

He says everything works properly with period_size = 64 and with period_size = 8192 (except for a huge delay of course), but intermediate values from 1024 to 4096 cause stuttering noises. Setting rt-prio = 1 does not help.

Currently TDM uses version 1.19.1 of OpenAL.

kcat commented 3 years ago

I wonder if there's something going on with Linux's CPU scheduler or power management. A period size of 64 working but not 1024 doesn't make much sense, since the latter is giving the system more time to actually process the audio. At 48khz, a period size of 64 means the mixer thread needs to wake up every 1.3 milliseconds to mix audio. If their system can keep up with that, I fail to see why a period size of 1024, which has the mixer thread wake up every 21.3ms, would suddenly be a problem. The only thing I can think of is that with 1024~4096, the mixing thread being asleep that much causes the CPU to go into a reduced power mode that causes wakeups to be significantly delayed, while lower values keeps the CPU more active and responsive. Though that's generally more an issue with mobile/laptop cpus than desktop.

Anecdotally, I recently upgraded my desktop system from an ancient dual-core CPU to a Ryzen 5 3600 and found JACK was completely hosed. While it was fine on my old system, the sound with JACK on my new system would be completely out or skip heavily, and it would constantly underrun despite not doing anything demanding. At the same time, PulseAudio plays fine but has a much higher level of latency than with my older system. Interestingly, ALSA seems to work fine when using direct hardware devices (can't really test dmix at the moment).

Being able to see their OpenAL log would be helpful, as would testing the latest version (1.21, if not current git). They should be able to get a log with something similar to what you suggested in the forums. Starting in a command shell from the directory with the executable, run:

export ALSOFT_LOGLEVEL=3
export ALSOFT_LOGFILE=openal_log.txt
./the_command

or alternatively, all on one line:

ALSOFT_LOGLEVEL=3 ALSOFT_LOGFILE=openal_log.txt ./the_command
stgatilov commented 3 years ago

Perhaps it is the issue of Doom 3 engine. It also has a separate sound thread. Originally it was doing the mixing, but now it just streams data into OpenAL buffers. Its Linux code is pretty weird:

THREAD_RETURN_TYPE Sys_AsyncThread(void*) {
    int now;
    int next;
    int want_sleep;

    // multi tick compensate for poor schedulers (Linux 2.4)
    int ticked, to_ticked;
    now = Sys_Milliseconds();       //returns int32_t milliseconds, obtained via gettimeofday
    ticked = now >> 4;
    while (1) {
        // sleep
        now = Sys_Milliseconds();
        next = ( now & 0xFFFFFFF0 ) + 0x10;
        want_sleep = ( next-now-1 ) * 1000;
        if ( want_sleep > 0 ) {
            usleep( want_sleep ); // sleep 1ms less than true target
        }

        // compensate if we slept too long
        now = Sys_Milliseconds();
        to_ticked = now >> 4;

        while ( ticked < to_ticked ) {
            common->Async();    //sound mixing happens here
            ticked++;
        }

        // thread exit
        if (asyncThreadShutdown)
            break;
    }

The sound streaming code writes to three OpenAL buffers in cyclic fashion (typical triple-buffering), each buffer has size MIXBUFFER_SAMPLES = 4096 samples. I believe sound data is always pushed at 44100 Hz frequency.

MirceaKitsune commented 3 years ago

Hi. Here is the OpenAL log with ALSOFT_LOGLEVEL=3 ALSOFT_LOGFILE=openal_log.txt when running The Dark Mod (64bit engine). Generated with period_size = 1024 in alsoft.conf: I normally use 64 which prevents me from getting the issue... the higher this value the more likely it is to encounter the problem, 1024 is where it's bound to trigger it half the time.

openal_log.txt

As I explained on the TDM forum: The broken sound lasts for some 1 to 30 seconds, during which I hear all audio in interruptions and the game lags with decreased FPS. Once this amount of time passes everything's normal again, but sometimes you need to wait a bit. It feels like something overloads the audio system at startup and you need to wait until it catches up.

kcat commented 3 years ago

Do you have PulseAudio installed? Your libopenal doesn't seem to be built with PulseAudio support, so if you use it, it will be using the ALSA->PulseAudio bridge, which could account for some of the issues (if playback is regularly underrunning, it'll increase the latency over time to compensate). If not, how well does it work when using a device other than ALSA Default?

MirceaKitsune commented 3 years ago

I use the libraries installed by my distribution, which is openSUSE Tumbleweed x64. I tried using other listed devices but always get no sound if I do.