Code Monkey home page Code Monkey logo

Comments (15)

guythnick avatar guythnick commented on May 30, 2024 1

I actually was using the same cheap microphone originally recommended. Today I received a AmazonBasics Portable USB Condenser Microphone, and that is working with Pulse as-is. So, I think it is an issue with those cheap microphones.

from fruitnanny.

alogoc avatar alogoc commented on May 30, 2024

May I ask which mic you are using? Having the exact same problem, I used same as the authors mic, which is USB and used an adapter to convert it to mini usb to plug it in as I am running this on pi zero. Ordered another mic now..I'll post the results once I get to try it.

from fruitnanny.

kotarokun avatar kotarokun commented on May 30, 2024

I facing the same problem. Is it an problem of Docker? or of microphone?

from fruitnanny.

J4nsen avatar J4nsen commented on May 30, 2024

The audio device (if I remember correctly hw1) is hardcoded in the docker containers. If a HDMI cable was plugged in, my cheap usb mic got the identifier hw2, and since HDMI does not provide audio-input, the container fails to start. So please make sure that hw1 actually is the microphone.

from fruitnanny.

nine86 avatar nine86 commented on May 30, 2024

So at first I thought my audio issues were related to the device being hw2 vs hw1 but as suggested by @J4nsen once the HDMI cable is removed that is no longer a problem. However I get the following errors when I run:
docker-compose logs | grep gstreamer-audio

I get:

gstreamer-audio_1  | Command not found: /audio_entry.sh
gstreamer-audio_1  | Command not found: /audio_entry.sh
gstreamer-audio_1  | Command not found: /audio_entry.sh
gstreamer-audio_1  | Command not found: /audio_entry.sh

When I run: docker-compose ps
I get:

            Name                          Command                 State      Ports
----------------------------------------------------------------------------------
fruitnanny_fruitnanny_1        /usr/bin/entry.sh node ser ...   Up                
fruitnanny_gstreamer-audio_1   /usr/bin/entry.sh /audio_e ...   Restarting        
fruitnanny_gstreamer-video_1   /usr/bin/entry.sh gst-laun ...   Up                
fruitnanny_janus_1             /usr/bin/entry.sh /bin/sh  ...   Up                
fruitnanny_nginx_1             /docker-entrypoint.sh ngin ...   Up                

Any help would be much appreciated

from fruitnanny.

J4nsen avatar J4nsen commented on May 30, 2024

Did you change anything in the Dockefile related to the audio container? Is the image still ivadim/fruitnanny-gstreamer?

from fruitnanny.

nine86 avatar nine86 commented on May 30, 2024

Did you change anything in the Dockefile related to the audio container? Is the image still ivadim/fruitnanny-gstreamer?

Do you mean the Dockerfile in opt/fruitnanny/docker/gstreamer? That was unedited. However I did make a change to /opt/fruitnanny docker-compose.yml. I changed ivadim/fruitnanny-gstreamer container to klemmie117/fruitnanny-gstreamer-fix as that was suggested to fix the video streaming issues.

from fruitnanny.

J4nsen avatar J4nsen commented on May 30, 2024

You only have to change the image to klemmie117/fruitnanny-gstreamer-fix for the video container. The audio container can be left as is.

from fruitnanny.

nine86 avatar nine86 commented on May 30, 2024

You only have to change the image to klemmie117/fruitnanny-gstreamer-fix for the video container. The audio container can be left as is.

Thanks I'm going to try that now and update here. I figured as much when you asked if I made a change to the container.

from fruitnanny.

nine86 avatar nine86 commented on May 30, 2024

@J4nsen Doesn't seem to work. The error log is as below:

gstreamer-audio_1  | I: [pulseaudio] main.c: Daemon startup successful.
gstreamer-audio_1  | Failure: Module initialization failed
gstreamer-audio_1  | Failure: Module initialization failed
gstreamer-audio_1  | Setting pipeline to PAUSED ...
gstreamer-audio_1  | Pipeline is live and does not need PREROLL ...
gstreamer-audio_1  | Setting pipeline to PLAYING ...
gstreamer-audio_1  | New clock: GstPulseSrcClock
gstreamer-audio_1  | ERROR: from element /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0: Failed to connect stream: No such entity
gstreamer-audio_1  | Additional debug info:
gstreamer-audio_1  | pulsesrc.c(1622): gst_pulsesrc_prepare (): /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0
gstreamer-audio_1  | Execution ended after 0:00:00.003790619
gstreamer-audio_1  | Setting pipeline to PAUSED ...
gstreamer-audio_1  | Setting pipeline to READY ...
gstreamer-audio_1  | Setting pipeline to NULL ...
gstreamer-audio_1  | Freeing pipeline ...
gstreamer-audio_1  | mkdir: cannot create directory ‘/var/run/dbus’: File exists
gstreamer-audio_1  | dbus-daemon[18]: Failed to start message bus: The pid file "/run/dbus/pid" exists, if the message bus is not running, remove this file
gstreamer-audio_1  | Process 22 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
gstreamer-audio_1  | E: [pulseaudio] main.c: Daemon startup failed.
gstreamer-audio_1  | Connection failure: Connection refused
gstreamer-audio_1  | pa_context_connect() failed: Connection refused
gstreamer-audio_1  | Connection failure: Connection refused
gstreamer-audio_1  | pa_context_connect() failed: Connection refused
gstreamer-audio_1  | Setting pipeline to PAUSED ...
gstreamer-audio_1  | ERROR: Pipeline doesn't want to pause.
gstreamer-audio_1  | ERROR: from element /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0: Failed to connect: Connection refused
gstreamer-audio_1  | Additional debug info:
gstreamer-audio_1  | pulsesrc.c(1015): gst_pulsesrc_open (): /GstPipeline:pipeline0/GstPulseSrc:pulsesrc0
gstreamer-audio_1  | Setting pipeline to NULL ...
gstreamer-audio_1  | Freeing pipeline ...

When I run: docker-compose ps everything was fine for the first 2 mins then after that I get the restarting status.
I get:

            Name                          Command                 State      Ports
----------------------------------------------------------------------------------
fruitnanny_fruitnanny_1        /usr/bin/entry.sh node ser ...   Up                
fruitnanny_gstreamer-audio_1   /usr/bin/entry.sh /audio_e ...   Restarting        
fruitnanny_gstreamer-video_1   /usr/bin/entry.sh gst-laun ...   Up                
fruitnanny_janus_1             /usr/bin/entry.sh /bin/sh  ...   Up                
fruitnanny_nginx_1             /docker-entrypoint.sh ngin ...   Up  

from fruitnanny.

J4nsen avatar J4nsen commented on May 30, 2024

Please make sure that hw:1 is actually your microphone. You can do this on the docker-host, e.g., by running alsamixer or aplay -l.

from fruitnanny.

nine86 avatar nine86 commented on May 30, 2024

I run arecord -l and I get the following:

**** List of CAPTURE Hardware Devices ****
card 1: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

from fruitnanny.

J4nsen avatar J4nsen commented on May 30, 2024

This looks ok. Sorry, I dont have my fruitnanny here anymore, so I can only give some advice.

Next step would be running the container on its own and execute the steps in audio_entry.sh and audio_stream.sh (https://github.com/ivadim/fruitnanny/tree/master/docker/gstreamer) manually.

from fruitnanny.

nine86 avatar nine86 commented on May 30, 2024

This looks ok. Sorry, I dont have my fruitnanny here anymore, so I can only give some advice.

Next step would be running the container on its own and execute the steps in audio_entry.sh and audio_stream.sh (https://github.com/ivadim/fruitnanny/tree/master/docker/gstreamer) manually.

Hey I really appreciate any advice at all. Thank you so very much!!! Trying to complete this project in time for when my baby is born. Haha. It's been a slog since I'm so unfamiliar with the software. Sorry to ask, but any chance you could elaborate on the steps to do the above?

from fruitnanny.

J4nsen avatar J4nsen commented on May 30, 2024

Make sure all other fruitnanny containers are stopped.

Execute $ docker images, use the ID to run a bash in the container with $ docker run -i -t idofcontainer /bin/bash.

In the container run:

$ chgrp audio -- /dev/snd/*
$ mkdir /var/run/dbus
$ dbus-daemon --system --fork
$ avahi-daemon -D

$ pulseaudio -D -v --log-target=stderr
$ pactl load-module module-alsa-source device=hw:1
$ pactl load-module module-echo-cancel source_name=microphone aec_method=webrtc 'aec_args="analog_gain_control=0 digital_gain_control=0"'
$ gst-launch-1.0 -v pulsesrc device=microphone ! audioconvert ! audioresample ! opusenc ! rtpopuspay ! queue max-size-bytes=0 max-size-buffers=0 ! udpsink host=127.0.0.1 port=5002

Check after every step if it worked. I suppose it should fail around pulseaudio/pactl. You could then run pulseaudio in the foreground with $ pulseaudio -vvv & and continue again with the rest of the commands.

from fruitnanny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.