Zoom Linux SDK 5.15.12 audio recording not working

Format Your New Topic as Follows:

Meeting SDK Type and Version
Zoom Meeting SDK Linux- version 5.15.12

Description
Hi Team, we are working on integrating our app with linux sdk and running into issues with accessing the zoom audio raw data

As per documentation, we have followed the below sequence of steps
1.Pre init- set the auth token,
2. implement an instance of the audio raw data callback ZoomSDKAudioRawDataDelegate
3. After recording privilege changed ->startRawRecording, getAudioRawDataHelperfor managing subscription and call subscribe event

Even though all the calls mentioned in the steps above result in ZoomSDKError_Success, the audio stream callbacks functions are never called. Log statements written within the functions onMixedAudioRawDataReceived and onOneWayAudioRawDataReceived never appear on the terminal.
Meanwhile the app works, we can interact with it, and perform all operations like join, leave, however the audio stream data is not there.

A few interesting logs we observed were
ALSA lib control.c:1379:(snd_ctl_open_noupdate) Invalid CTL
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM

We are running the following experiment on linux centos amazon ec2 vm instance with latest linux SDK 5.15.12 . Note:this instance does not have any physical hardware sound drivers.We have installed the pulse audio setup on machine.

Error?
ALSA lib control.c:1529:(snd_ctl_open_noupdate) Invalid CTL
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM

Troubleshooting Routes
Installed also-utils, pulseaudio, also-base

How To Reproduce
N/A

@sucharitha ,

Could you share how you are setting up your docker container, and the configurations done on pulseaudio?

@chunsiong.zoom
This started working after adding below in ~/.config/zoomus.conf

[General]
system.audio.type=default

Is there any way we can set which output device to use in SDK?

@pramodb ,

Curious, where did you managed to find the fix by using zoomus.conf file?

For switching of output device, you can try to set it using the IAudioSettingContext

	ZOOM_SDK_NAMESPACE::IAudioSettingContext* pAudioContext = m_pSettingService->GetAudioSettings();
	if (pAudioContext)
	{

	
		if (pAudioContext->GetSpeakerList()->GetCount() >= 1) {
			std::cout << "Number of speaker(s) : " << pAudioContext->GetSpeakerList()->GetCount() << std::endl;
			ISpeakerInfo* sInfo = pAudioContext->GetSpeakerList()->GetItem(0);
			const zchar_t* deviceName = sInfo->GetDeviceName();
			if (deviceName != nullptr && deviceName[0] != '\0') {
				std::cout << "Speaker(0) name : " << sInfo->GetDeviceName() << std::endl;
				std::cout << "Speaker(0) id : " << sInfo->GetDeviceId() << std::endl;

				pAudioContext->SelectSpeaker(sInfo->GetDeviceId(), sInfo->GetDeviceName());
				std::cout << "Is selected speaker? : " << pAudioContext->GetSpeakerList()->GetItem(0)->IsSelectedDevice() << std::endl;
			}
			else {
				std::cout << "Speaker(0) name is empty or null." << std::endl;
				std::cout << "Speaker(0) id is empty or null." << std::endl;
			}
}

@chunsiong.zoom

It is mentioned here:

https://aur.archlinux.org/packages/zoom

Before, I thought that it was the alsa problem. After hours and hours finding the solutions, the virtual audio is actually created and start to think that it must be zoom that didn’t recognize the device because it can auto join with audio before.

1 Like

@sucharitha

We are also using the linux meeting sdk 5.15.12 but are running into issues , the auth callback never returns back. Could you please share how did you configured the auth to work ?

We set up Zoom client on our CentOS Linux EC2 instance to examine its input and output recognition. Interestingly, this led to the Linux SDK audio streaming to work seamlessly.
We subsequently retraced our actions to identify the specific Zoom.conf settings responsible for this change. @chunsiong.zoom any insights on when we might anticipate the necessary SDK update or documentation revision for the same?

@dhruv1778, I have a faint recollection of facing a similar issue in the past. It seems that the problem might be tied to incorrect authorization scopes.

@sucharitha

We are intending to release an update in the Linux SDK which will create the zoomus.conf file

1 Like

Hi all,

I am getting the same issues when starting the app with Zoom Linux SDK v5.16.1.8573 integrated within a Docker container based on Ubuntu 22.04.
These are errors I am getting:

ALSA lib control.c:1528:(snd_ctl_open_noupdate) Invalid CTL 
2023-10-05T22:51:57.393166526Z ALSA lib pcm.c:2664:(snd_pcm_open_noupdate) Unknown PCM

I applied the fix referenced above (~/.config/zoomus.conf) but this did not work.

Then I tried to set up PulseAudio sinks explicitly by this entrypoint.sh script:

#!/bin/bash

# Check if running as root
if [ "$(id -u)" = "0" ]; then
    # Cleanup to be "stateless" on startup, otherwise pulseaudio daemon can't start
    rm -rf /var/run/pulse /var/lib/pulse /root/.config/pulse
fi
# Start pulseaudio as system wide daemon; for debugging it helps to start in non-daemon mode
pulseaudio -D --verbose --exit-idle-time=-1 --disallow-exit
# Sleep to ensure pulseaudio is fully initialized
pactl load-module module-virtual-source master=auto_null.monitor format=s16le source_name=VirtualMic
# Set VirtualMic as default input source;
echo "Setting default source: ";
pactl set-default-source VirtualMic;
pactl load-module module-null-sink sink_name=Dummy
# Sleep to ensure the sink is ready
pactl set-default-sink Dummy;
./zoom-bot

That didn’t help.

aplay -l outputs with:

aplay: device_list:274: no soundcards found...

I guess these errors are because there is no soundcard existing within the Docker container and PulseAudio doesn’t seem to pick up the Dummy sink.

@chunsiong.zoom have you encountered this issue before?

Thanks!

@alextsi ,

Those error messages does not affect the ability to get raw audio data. Do you have issues getting the callback to fire?

@alextsi , I’m sharing some of my code / script samples here

dockerfile for Ubuntu 22

# Use the official Ubuntu image as the base image
FROM ubuntu:22.04

# Install necessary dependencies
RUN apt-get update && \
    apt-get install -y build-essential cmake

RUN apt-get install -y pkgconf


RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests \
    libx11-xcb1 \
    libxcb-xfixes0 \
    libxcb-shape0 \
    libxcb-shm0 \
    libxcb-randr0 \
    libxcb-image0 \
    libxcb-keysyms1 \
    libxcb-xtest0 \
    libdbus-1-3 \
    libglib2.0-0 \
    libgbm1 \
    libxfixes3 \
    libgl1 \
    libdrm2 \
    libgssapi-krb5-2 \
    openssl \
    ca-certificates \
    pkg-config \
    libegl-mesa0 \
    libsdl2-dev \
    g++-multilib 

# Install CURL related libs
RUN apt-get install -y libcurl4-openssl-dev

# Install ALSA
RUN apt-get install -y libasound2 libasound2-plugins alsa alsa-utils alsa-oss

# Install Pulseaudio
RUN apt-get install -y  pulseaudio pulseaudio-utils



# Set the working directory
WORKDIR /app

# Copy your application files to the container
COPY demo/ /app/demo/

# Execute additional commands
RUN cd /app/demo && rm -rf bin && rm -rf build && cmake -B build && cd build && make

# Set the working directory to the source folder
WORKDIR /app/demo

# Make the run script executable
RUN chmod +x /app/demo/setup-pulseaudio.sh

# Set the working directory to the binary folder
WORKDIR /app/demo/bin


# Define a shell script to run multiple commands
RUN echo '#!/bin/bash' > /app/demo/run.sh \
    && echo '/app/demo/setup-pulseaudio.sh' >> /app/demo/run.sh \
    && echo './meetingSDKDemo' >> /app/demo/run.sh

# Make the run script executable
RUN chmod +x /app/demo/run.sh

# Specify the run script as the CMD
CMD ["/app/demo/run.sh"]
#CMD ["/bin/bash"]
#CMD ["./meetingSDKDemo"]

Setup script for pulse audio and config file (setup-pulseaudio.sh)

#!/bin/bash
# enable dbus
mkdir -p /var/run/dbus
dbus-uuidgen > /var/lib/dbus/machine-id
dbus-daemon --config-file=/usr/share/dbus-1/system.conf --print-address

# add root

adduser root pulse-access

adduser root audio

# Cleanup to be "stateless" on startup, otherwise pulseaudio daemon can't start

rm -rf /var/run/pulse /var/lib/pulse /root/.config/pulse
cp /etc/pulse/* ~/.config/pulse/
pulseaudio -D --exit-idle-time=-1

# Create a virtual speaker output
pactl load-module module-null-sink sink_name=SpeakerOutput
pactl set-default-sink SpeakerOutput
pactl set-default-source SpeakerOutput.monitor

#make config file
mkdir ~/.config
echo -e "[General]\nsystem.audio.type=default" > ~/.config/zoomus.conf

1 Like

Thank you so much, @chunsiong.zoom. I overlooked a few steps, such as initializing dbus and adding root to the pulse-access and audio groups in my run shell script. However, after updating the script, those errors were resolved.

You’re correct; I noticed another error when I tried to subscribe to audio events. I initially thought it was caused by the “Invalid CTL/Unknown PCM” issues. I’ll create a separate post to keep this topic focused.

2 Likes

@alextsi ,
I am glad that @chunsiong.zoom was able to provide assistance and I would like to express my gratitude for your contribution to the Zoom Developer community. I am looking forward to your future posts. Please don’t forget to tag us in your new post so that we can be notified.