Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

G-audio deploy #19

Open
Jamesyang-l opened this issue Nov 22, 2022 · 5 comments
Open

G-audio deploy #19

Jamesyang-l opened this issue Nov 22, 2022 · 5 comments

Comments

@Jamesyang-l
Copy link

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
Copy link
Owner

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?

  • Have you successfully deployed LabVIEW LINX + G-Audio to the Raspberry Pi and confirmed audio playback works?
  • What is the audio input device you're using? (e.g. audio hat, USB soundcard)
  • If you run arecord -l on the Pi, what capture devices are listed?
  • Does audio capture work using arecord -d 5 test_capture.wav on the Pi? This should capture a 5 second wav file. You can then play is using aplay test_capture.wav to listen to the capture.

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
Copy link
Author

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
Copy link
Owner

dataflowg commented Nov 24, 2022

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
Copy link
Author

Does it run properly on pi after compiling

@dataflowg
Copy link
Owner

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_audio_32.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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants