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

Audio replicator with noise reduction 16khz #203

Conversation

PieVo
Copy link
Contributor

@PieVo PieVo commented Jun 23, 2020

Replaces #185
Information: #194

This clones the audio fifo and make it available to 3 streams for one single rRTSPServer instance. The H264 grabbers dump their video into pipes which are read by the rRTSP server.

  • Implements noise reduction based on existing libraries in the camera
  • Implements a replicator, so audio can be used for all streams
  • Implements an audio only stream

High + Audio:
Play this stream using the URL "rtsp://192.168.3.180/ch0_0.h264"

Low + Audio:
Play this stream using the URL "rtsp://192.168.3.180/ch0_1.h264"

Audio only:
Play this stream using the URL "rtsp://192.168.3.180/ch0_2.h264"

PieVo added 30 commits February 26, 2020 11:39
@roleoroleo
Copy link
Owner

Thanks for your pr.
I will work on this the next week.

@roleoroleo
Copy link
Owner

I'm trying to build your branch but I have a compilation error about mkfifo:

MOD_DIR:        /home/user/yi/PieVo/yi-hack-MStar/src/mkfifo
MOD_NAME:       mkfifo
MOD_INIT:       init.mkfifo
MOD_COMPILE:    compile.mkfifo
MOD_INSTALL:    install.mkfifo
init.mkfifo not found.. exiting.

I think beacuse you didn't create the structucre init/compile/install in the mkfifo directory.
Is mkfifo required?
If it's required, could we add it to busybox and avoid to build it externally?

@PieVo
Copy link
Contributor Author

PieVo commented Jul 2, 2020

The mkfifo is indeed required, since I didnt want to touch the h264grabbers... The goal of the PR is to create 2 fifos where the low and high grabbers can dump their data in. The (single) RTSP server instance reads the data from there.

My mkfifo was just a makeshift mkfifo the get it working. Of course the busybox one is preferred. Do we have our own busybox?

@roleoroleo
Copy link
Owner

roleoroleo commented Jul 2, 2020

My mkfifo was just a makeshift mkfifo the get it working. Of course the busybox one is preferred. Do we have our own busybox?

Yes, you could simply change
# CONFIG_MKFIFO is not set
in
CONFIG_MKFIFO=y

inside src/busybox/.config

@roleoroleo
Copy link
Owner

roleoroleo commented Jul 12, 2020

I have a problem starting rtsp server.
When I start h264grabber and then rRTSPServer the system is blocked on the fifo.
I have to read some data to start the chain.
Do you have this problem?

--- EDIT ---

I think I will add mkfifo inside h264grabber

@roleoroleo roleoroleo merged commit f160e66 into roleoroleo:master Jul 12, 2020
@PieVo
Copy link
Contributor Author

PieVo commented Jul 12, 2020 via email

@roleoroleo
Copy link
Owner

The sequence is:

  • rmm
  • mkfifo
  • h264grabber
  • rRTSPServer

When I start h264_grabber_h.sh the system blocks and when I play vlc doesn't restart.
Don't worry, I solved adding mkfifo inside h264grabber code, it works (I don't know why but it works).
I merged your pr and I'm editing some files to adapt your changes.

@roleoroleo
Copy link
Owner

I merged my changes, if you want to try.
Major differences from your version:

  • Add mkfifo to busybox and removed from src (not necessary, see next step).
  • Move mkfifo inside h264grabber code.
  • Change RTSP_AUDIO option to a checkbox.
  • Change system.sh and wd_rtsp.sh to manage new binary.
  • Remove h264_grabber_high.sh and h264_grabber_low.sh.

@PieVo
Copy link
Contributor Author

PieVo commented Jul 13, 2020

Just checked the code here and there, lots of changes to the config! Too much for me to patch manually on top of a running 0.3.4 fw.

Making a full build now (on a slow machine)...

@roleoroleo
Copy link
Owner

Sorry but github isn't my best.

@PieVo
Copy link
Contributor Author

PieVo commented Jul 14, 2020

So, I'm wondering if my build is good (I don't have the original FW files, but used already released ones).. Since the camera is actually used, I don't want to brick it. Would it be possible to share your build, so I know it at least boots?

@roleoroleo
Copy link
Owner

Which model suffix?
I don't remember.

@PieVo
Copy link
Contributor Author

PieVo commented Jul 15, 2020 via email

@roleoroleo
Copy link
Owner

roleoroleo commented Jul 15, 2020

Here it is:
y203c_0.3.4.tar.gz
Updated to the last commit.

I suggest to reconfigure the cam from scratch.

@PieVo
Copy link
Contributor Author

PieVo commented Jul 15, 2020

Great! got it running...
Also audio only: rtsp://192.168.3.180/ch0_2.h264 is working fine...

Regarding the settings there might be a little quirk:

  • Just before upgrading firmware I reset the camera defaults...
  • Upgraded firmware
  • Enable audio & restart --> No audio
  • Reset to defaults again & restart -> Audio is enable (rRTSPserver_audio is running)
  • However the flag in the config is set to disabled :)

Edit:

  • Enabling both streams also works, but audio toggle button remains unset.

If you see time, and perhaps in a different PR, the setting for the noise reduction could also be configurable... With 0 it is completely off, which saves some cpu performance.

@roleoroleo
Copy link
Owner

roleoroleo commented Jul 15, 2020

I will check the flag, thank you.
Probably the change from select object to checkbox object.
Could you share your system.conf?

Check the value of RTSP_AUDIO parameter.

@PieVo
Copy link
Contributor Author

PieVo commented Jul 15, 2020

/home/yi-hack # cat ./etc/system.conf
HTTPD=yes
TELNETD=no
SSHD=yes
FTPD=yes
BUSYBOX_FTPD=no
DISABLE_CLOUD=no
REC_WITHOUT_CLOUD=no
MQTT=no
RTSP=yes
RTSP_STREAM=both
RTSP_AUDIO=yes
ONVIF=yes
ONVIF_WSDD=yes
ONVIF_PROFILE=high
ONVIF_WM_SNAPSHOT=yes
NTPD=yes
NTP_SERVER=pool.ntp.org
PROXYCHAINSNG=no
RTSP_PORT=554
ONVIF_PORT=80
HTTPD_PORT=8080
USERNAME=
PASSWORD=
FREE_SPACE=0
FTP_UPLOAD=no
FTP_HOST=
FTP_USERNAME=
FTP_PASSWORD=
SSH_PASSWORD=

@roleoroleo
Copy link
Owner

RTSP_AUDIO is ok.

Try to call configuration web service:
http://IP:8080/cgi-bin/get_configs.sh?conf=system

Do you clean the cache?

@PieVo
Copy link
Contributor Author

PieVo commented Jul 16, 2020

Its indeed the cache, other browsers show the toggle in the right position..

@roleoroleo
Copy link
Owner

Ok. Damn cache...

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

Successfully merging this pull request may close these issues.

2 participants