nemozone

✉️ a zone for no one and everyone :) 🔞

Video Title

If you are experiencing an audio-video mismatch on Ubuntu 22.04 when using VLC media player, you can use the tools in VLC to adjust the audio synchronization. To do so, open VLC Player > Menu > Tools > Preferences > Advanced Preference. Click the Audio tab from the left list, make sure you have choose the All in the Show settings at the bottom-left corner. Check the settings of Audio desynchronization compensation and you can put a value in seconds to sync audio. Additionally, you can use the Equalizer feature in VLC to enhance and customize the sound of your digital music library. To do this, go to Window > Tools > Effects and Filters, click the check box next to the Enable option and select a preset, or adjust the frequency band sliders to adjust the sound manually.

If you want to further normalize the loudness of the file, you can use the ​loudnorm filter which implements the EBU R128 algorithm. To do this, run the command ffmpeg -i input.wav -filter:a loudnorm output.wav. Automating the normalization processes with ffmpeg without having to do two passes is possible with the ffmpeg-normalize Python program. This script defaults to EBU R128 normalization but peak and RMS normalization are also supported.

To change the sound volume, you can use FFmpeg's ​volume audio filter. If you want your volume to be half of the input volume, run the command ffmpeg -i input.wav -filter:a “volume=0.5” output.wav. To increase the volume by 10dB, run the command ffmpeg -i input.wav -filter:a “volume=10dB” output.wav. To reduce the volume, use a negative value.

Finally, to set or otherwise normalize the volume of a stream, peak and RMS normalization can be used. To normalize the volume to a given peak or RMS level, the file first has to be analyzed using the volumedetect filter. Read the output values from the command line log, then calculate the required offset, and use the volume filter as shown above.

You can use the ffmpeg tool to adjust the audio levels of a video. One way to do this is to use the volume filter, which allows you to increase or decrease the volume of the audio in a video. For example, to decrease the volume of the audio by 6 dB, you can use the following command:

ffmpeg -i input.mp4 -filter:a "volume=-6dB" output.mp4

You can also use other ffmpeg filter such as 'equalizer', 'compand' , 'pan' to adjust the audio level, balance and stereo. It's recommended to play with the filter option and see which one works best for your video.

ffmpeg -i input.mp4 -filter_complex "[0:a]equalizer=f=1000:t=h:width_type=h:w=1000[a0];[0:a]equalizer=f=1000:t=h:width_type=h:w=1000,compand=attacks=.01:decays=1:points=-90/-90|-40/-20|-20/-10|0/-3|20/3[a1];[a0][a1]pan=stereo|c0=c0|c1=c1" output.mp4

There are many other options and filters available in ffmpeg for adjusting audio levels and other aspects of the audio in a video. For example, you can use the 'amplify' filter to increase or decrease the volume of specific audio frequencies, or the 'compand' filter to adjust the dynamic range of the audio. Additionally, you can use the 'pan' filter to adjust the balance between left and right channels in stereo audio, or the 'equalizer' filter to adjust the levels of different frequency bands.

It's important to note that it's best to adjust audio levels on the separate audio track before merging it back with the video. That way you can have more control over the audio and make sure it's in the right level and quality.

Citations :

  1. https://help.ubuntu.com/stable/ubuntu-help/sound-volume.html.en
  2. https://filmora.wondershare.com/audio-editing/normalize-volume-vlc.html
  3. https://trac.ffmpeg.org/wiki/AudioVolume
  4. https://www.youtube.com/watch?v=15QyOPMZ9AM
  5. https://ottverse.com/transcode-audio-codec-ffmpeg-without-changing-video/
  6. https://www.vlchelp.com/syncing-audio-vlc-media-player/
  7. https://videoconverter.wondershare.com/sync-audio/vlc-audio-delay.html
  8. https://www.lifewire.com/improve-audio-quality-in-vlc-media-player-with-the-equalizer-2438322
  9. https://manpages.ubuntu.com/manpages/bionic/man1/ffmpeg-all.1.html

D-Bus is an inter-process communication (IPC) protocol used in the Linux, Windows and BSD operating systems. It allows multiple applications to exchange data and signals in a standardized way.

D-Bus has several layers: a library, libdbus, which allows two applications to connect to each other and exchange messages; a message bus daemon executable, built on libdbus, which multiple applications can connect to; and native objects and object paths. Native objects are objects that the application owns and manages and object paths allow applications to access those native objects.

Applications that use D-Bus are either servers or clients. A server listens for incoming connections and a client connects to a server. Once the connection is established, it is a symmetric flow of messages. D-Bus provides its own marshaling and language bindings for different languages like Glib, Qt, Python, etc.

Using D-Bus should feel more like object-oriented programming than like communication. Bus names can be used to coordinate single-instance applications. Addresses are also used to identify connections. The idea is to fit the D-Bus API into the native language and libraries as naturally as possible.

D-Bus is non-transactional and behaves like an RPC mechanism. Semantics are similar to the existing DCOP system, allowing KDE to adopt it more easily. It is also tailored to meet the needs of the desktop projects in particular.

To get started with using D-Bus, one should refer to the D-Bus specification, Doxygen reference documentation, and look at some examples of how other apps use D-Bus. An example of an application that uses D-Bus is ØMQ, an open source messaging middleware.

To query D-Bus from the terminal, you can use the dbus-send command.

Example 1: Get the current volume level of the PulseAudio server:

dbus-send --print-reply --dest=org.pulseaudio.Server /org/pulseaudio/server_lookup org.freedesktop.DBus.Properties.Get string:'org.pulseaudio.Server' string:'Volume'

Example 2: Change the volume level of the PulseAudio server:

dbus-send --print-reply --dest=org.pulseaudio.Server /org/pulseaudio/server_lookup org.freedesktop.DBus.Properties.Set string:'org.pulseaudio.Server' string:'Volume' variant:double:0.5

Example 3: Get the current time from the system bus:

dbus-send --print-reply --system --dest=org.freedesktop.timedate1 /org/freedesktop/timedate1 org.freedesktop.DBus.Properties.Get string:'org.freedesktop.timedate1' string:'TimeUSec'

Note: in above examples, the --dest flag specifies the destination service and the /org/pulseaudio/server_lookup or /org/freedesktop/timedate1 specifies the object path. The org.freedesktop.DBus.Properties.Get or org.freedesktop.DBus.Properties.Set specifies the interface and the method you want to call.

You can also use gdbus command which is a command-line tool for interacting with D-Bus objects.

You can get more information about dbus-send and gdbus from their man pages.

References: [1] https://www.freedesktop.org/wiki/IntroductionToDBus/ [2] https://dbus.freedesktop.org/doc/dbus-tutorial.html [3] https://en.wikipedia.org/wiki/D-Bus [4] https://www.cardinalpeak.com/blog/using-dbus-in-embedded-linux [5] https://stackoverflow.com/questions/482681/d-bus-equivalent-for-windows [6] https://alternativeto.net/software/d-bus/

Citations :

  1. https://www.freedesktop.org/wiki/IntroductionToDBus/
  2. https://dbus.freedesktop.org/doc/dbus-tutorial.html
  3. https://www.cardinalpeak.com/blog/using-dbus-in-embedded-linux
  4. https://en.wikipedia.org/wiki/D-Bus
  5. https://stackoverflow.com/questions/482681/d-bus-equivalent-for-windows
  6. https://alternativeto.net/software/d-bus/
  7. https://dbus.freedesktop.org/doc/dbus-tutorial.html#:~:text=D%2DBus%20is%20a%20system,multiple%20applications%20can%20connect%20to.

Wake-On-LAN (WOL) is a technology that allows one computer to remotely Wake Up another computer on a local area network (LAN). It requires the support of the computer's network card and motherboard. To configure WOL on Ubuntu 22.04, you will need to use the ethtool command to enable it.

First, you need to find out where ethtool is installed. This terminal command will do that:

foc@ubuntu22:~$ sudo --preserve-env systemctl edit --force --full wol-enable.service

[Unit] Description=Enable Wake-up on LAN [Service] Type=oneshot ExecStart=/sbin/ethtool -s enp2s0 wol g

[Install] WantedBy=basic.target

Replace enp2s0 value with the computer's network interface name. Next, install the ethtool package:

foc@ubuntu22:~$ sudo apt install ethtool -y

Then check if the network card supports wake-on-LAN using this command:

foc@ubuntu22:~$ sudo ethtool enp2s0

Settings for enp2s0: ... Supports Wake-on: pumbg Wake-on: d Link detected: yes

The expression “Wake-on:d” indicates that the wake-on-lan feature of the network card is supported but deactivated. To enable it, run the following command:

foc@ubuntu22:~$ sudo ethtool -s enp2s0 wol g

Settings for enp2s0: ... Supports Wake-on: pumbg Wake-on: g Link detected: yes

Some motherboard manufacturers require you to change the settings in the BIOS to enable this feature.

Finally, create a systemd service to enable WOL at startup:

foc@ubuntu22:~$ sudo --preserve-env systemctl edit --force --full wol-enable.service

[Unit] Description=Enable Wake-up on LAN [Service] Type=oneshot ExecStart=/sbin/ethtool -s enp2s0 wol g

[Install] WantedBy=basic.target

After creating the service, reload and enable it:

foc@ubuntu22:~$ sudo systemctl daemon-reload foc@ubuntu22:~$ sudo systemctl enable wol-enable.service Created symlink /etc/systemd/system/basic.target.wants/wol-enable.service → /etc/systemd/system/wol-enable.service

Enabling