dataflowg / g-audio

A LabVIEW audio library.
The Unlicense
20 stars 6 forks source link

G-audio deploy #19

Open Jamesyang-l opened 1 year ago

Jamesyang-l commented 1 year ago

The problem is that the labview environment is capable of voice interaction, but the Raspberry PI deployment related to voice acquisition does not work

dataflowg commented 1 year ago

Hi @Jamesyang-l, thanks for raising the issue. I suspect this is an issue with the default LabVIEW chroot environment on the Pi. Would you mind answering a few questions?

I've setup a Pi here with a capture device visible in the host environment, but it isn't working under LabVIEW's chroot environment. I'll update this issue if I manage to get it working.

Jamesyang-l commented 1 year ago

I have deployed all the environment, sound acquisition and playback are normal in labview IDE, but the compiled file is deployed, but the rt file is running, and the USB sound card is suspended. I just tried it, added a delay of 60S, and entered the interface of Raspberry PI. When you enter the audio collection and playback program, the icon of the sound card will disappear. The sound card cannot be found in the system and can not be restored after restarting.

dataflowg commented 1 year ago

Hi @Jamesyang-l

Here's an example which demonstrates audio capture on the Raspberry Pi (VI download link). The main thing to note is a specific capture device must be used. Relying on using the 'default' device doesn't work.

G-Audio Capture Example (LINX)

I've verified this runs from the IDE when connected to a Raspberry Pi with a USB mic input. Capture device index 1 and 2 worked (index 0 is just silence).

If you still run into issues, could you share your project code?

Edit: Re-reading your posts, is there a problem capturing audio, or a problem running a built + deployed application (or both)?

Jamesyang-l commented 1 year ago

Does it run properly on pi after compiling

dataflowg commented 1 year ago

Hi @Jamesyang-l

I've tested compiling and running a few different LabVIEW builds on Raspberry Pi which use G-Audio, and everything works and runs properly except in one specific scenario. I've attached a LabVIEW project with 3 different builds you can run on the RPi: G-Audio Raspberry Pi.zip

image

The Playback and Capture builds compile and run without issue after rebooting the RPi. There is an issue with the Loopback Capture build when calling Clear Audio Backend, which results in a lvrt crash and temporary loss of the chroot environment (which requires a RPi reboot). The code runs fine otherwise, and can capture and play back the mic audio - it's only when trying to release the backend does it crash.

This only seems to occur if the build is run at startup OR run from the IDE when the RPi is in console only mode. If the RPi has booted into the desktop, the Loopback Capture.vi can be run from the LabVIEW IDE and doesn't crash on the RPi.

I haven't investigated if this is an RPi issue, or a Linux / ALSA issue.

If you're still seeing strange issues with the attached project, you might try build the _g_audio32.so library on your RPi (instructions here).

What model of Raspberry Pi are you using? What version of Raspberry Pi OS is it running with?