Author Topic: Crash with specific ALSA recording device  (Read 114 times)

saga

  • Posts: 2497
Crash with specific ALSA recording device
« on: 29 Mar '21 - 16:44 »
I've come across a strange issue with a specific ALSA device on Ubuntu. I couldn't reproduce it on my desktop machine but it's easily reproducible with a fresh Ubuntu 20.04 installation in VirtualBox. The device in question is called "Plug-in for channel upmix (4,6,8)". Trying to use this as a recording device instantly crashes the application when starting to record. Using a different recording device before trying this specific one one may cause it to fail to open instead.
Interestingly, the stock rectest example doesn't show this issue but it only took a few modifications to trigger the crash there as well (using BASS_RecordInit instead of BASS_RecordSetInput). I have attached my modified example program.
I guess the expected outcome would be that recording from this device simply fails to start.

Stack trace:
Code: [Select]
/lib/x86_64-linux-gnu/libasound.so.2(snd_pcm_area_copy+0x19a)[0x7f11101f589a]
/lib/x86_64-linux-gnu/libasound.so.2(snd_pcm_areas_copy+0x140)[0x7f11101f5c40]
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_upmix.so(+0x182a)[0x7f110f38182a]
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_upmix.so(+0x1c65)[0x7f110f381c65]
/usr/lib/x86_64-linux-gnu/alsa-lib/libasound_module_pcm_upmix.so(+0x134c)[0x7f110f38134c]
/lib/x86_64-linux-gnu/libasound.so.2(+0x9a45e)[0x7f111023d45e]
/lib/x86_64-linux-gnu/libasound.so.2(+0x659cf)[0x7f11102089cf]
/lib/x86_64-linux-gnu/libasound.so.2(+0x57078)[0x7f11101fa078]
/lib/x86_64-linux-gnu/libasound.so.2(+0x663c0)[0x7f11102093c0]
/home/johannes/Downloads/bass24-linux/rectest/../x64/libbass.so(+0x150dc)[0x7f1114e450dc]

Ian @ un4seen

  • Administrator
  • Posts: 23553
Re: Crash with specific ALSA recording device
« Reply #1 on: 30 Mar '21 - 16:22 »
It's crashing in the first ALSA snd_pcm_readi function call. No ALSA calls are failing before that, so there unfortunately doesn't seem to be any way to know that it's going to crash. ALSA's own arecord tool also crashes when trying to use that device (running "arecord -D upmix -f S16_LE -c 2 -r 44100").

saga

  • Posts: 2497
Re: Crash with specific ALSA recording device
« Reply #2 on: 30 Mar '21 - 17:03 »
Thanks for investigating. I guess we will simply ignore this device in our device selection list then, as it wouldn't be a useful recording source anyway.