NI Linux Real-Time Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Using USB audio device on cRIO-9030 and cRIO-9035

Dear Communinty,

I'm trying to use a Manhattan 2700 Series USB Speaker System (Model Number: 161114) on my cRIO-9030 and cRIO-9035. As far as I know LabVIEW RT does not support audio VIs, but I've found in the opkg feeds the ALSA project tha the libasound2 library which, if I'm correct, the libraries what I need to use USB speakers on any Linux system. I've downaloaded and installed those libraries on my cRIO but couldn't get any audio out from my speakers. I've also cloned the required source files from the ALSA Project's github, but unfortunately I couldn't compile them on the cRIO itself. I'm fairly novice in Linux so I may have done something wrong. Could someone help me with the correct workflow on applying USB speaker driver software?

Thank you in advance,

Sincerely,

Levente Raj

Engineer

Budapest University of Technology and Economics

Department of Mechatronics, Optics and Engineering Informatics

0 Kudos
Message 1 of 8
(4,997 Views)

As I recall, none of the audio side of things required to use ALSA are enabled in the kernel. These include (but may not be limited to):

->Device Drivers

  `-> Sound card support

    `-> Advanced Linux Sound Architecture (ALSA)

     `-> USB sound devices

         `-> (Select the correct USB device that matches your speakers, use the lsusb tool to figure out the chipset of the speaker)

Note that lsusb needs to be installed through opkg ("opkg update && opkg install usbutils), once you get the VID and PID of the USB device, you can either google for the corresponding USB device or search the actual kernel code for the corresponding device to use).

This is a fairly nontrivial task, so you may want to try to find someone at your university with a bit of knowledge in this area.

0 Kudos
Message 2 of 8
(4,345 Views)

Dear BradM,

Thank you for the answer.

By writing that "none of the audio side of things required to use ALSA are enabled in the kernel" and "search the actual kernel code for the corresponding device to use" you mean I have to enable audio support in NI Linux RT kernel, i.e. I have to recompile the kernel with audio support enabled?

I'm searching the documentation and how-to pages of the ALSA project and there is documentation about how to compile the Project with a so called Universal USB audio device driver and how to integrate it with a Linux kernel. Would that be enough?

Is there any other way (besides ALSA) that wouldn't require me to recompile the kernel?

Thanks.

Levente.Raj

0 Kudos
Message 3 of 8
(4,345 Views)

Levente.Raj wrote:

Dear BradM,

Thank you for the answer.

By writing that "none of the audio side of things required to use ALSA are enabled in the kernel" and "search the actual kernel code for the corresponding device to use" you mean I have to enable audio support in NI Linux RT kernel, i.e. I have to recompile the kernel with audio support enabled?

I'm searching the documentation and how-to pages of the ALSA project and there is documentation about how to compile the Project with a so called Universal USB audio device driver and how to integrate it with a Linux kernel. Would that be enough?

Is there any other way (besides ALSA) that wouldn't require me to recompile the kernel?

Thanks.

Levente.Raj

The general "snd-usb-audio" module (I'm guessing that's what you're referring to) still requires a kernel module. Basically, since the controllers don't normally have a sound device*, the kernel is not configured by default to support ALSA/OSS at all, let alone any USB sound devices. You will need to rebuild the kernel.

*While the myRIO device has audio I/O, this basically goes directly to a DAC/ADC without a traditional sound device behind it, meant for sampling/output from the FPGA and/or communcation with the CPU through DMA transfers. Not suitable for use with ALSA or normal Linux sound as-is.

Message 4 of 8
(4,345 Views)

Dear BradM

Thank you, this helps me a lot. Although enabling audio support in the kernel seems quite a task I may have to postpone this task and look for a Linux professional ti aid me.

Thanks again.

L.R

0 Kudos
Message 5 of 8
(4,345 Views)

Dear BredM,

currently I am working with Levente Raj on the project he had to freeze in 2016.

Following your videos and other books about kernel compiling I managed to recompile it with the audio support and the debuging enabled. I also managed to copy that to our cRIO 9030 and reboot with the new kernel.
I have a big problem though with the NI drivers. I followed the instructions here to update the drivers and everything went smoothly, but the last command (versioning_call) just wont finish its work. It does not throw any errors, it does not stop, but it do not continue as well (see the picture attached).
Could you advise me, what could I do wrong? I am really stucked with it.

Thanks in advanced!
G.K. 

0 Kudos
Message 6 of 8
(3,893 Views)

I recall seeing an issue like this once, in development. I don't recall what the issues was, but I am pretty sure that I used strace to get to the bottom of where it hangs up (and/or check the actual system load/processes running when the system is "hung")

0 Kudos
Message 7 of 8
(3,882 Views)

Dear BradM

Thank you for your help! As a last resort we looked into the shell script to find out, what can be wrong. We find out, that there was nothing wrong with the driver refreshing, but the kernel was not compiled correctly. It was surprising first, because we followed the instructions from here. It seems, there is a mistake in the instructions: the ARCH environmental variable should have the value "x86" and not "x86_64". With this little modification the kernel compiles perfectly and the drivers are also easy to update.
It did not  solve the problem though, because we still had to install alsa-utils and it's dependencies by hand, but finally we were able to play sounds with our cRIO-9030 and MANHATTAN 2700 USB Speaker system.
Thank you very much for your help!
Levente Raj and Gábor Kiss,

Budapest University of Technology and Economics

Department of Mechatronics, Optics and Engineering Informatics

0 Kudos
Message 8 of 8
(3,843 Views)