This will however obviously fail if the network source doesn’t provide any audio at all.

Advertisements

]]>https://fhackts.wordpress.com/2017/12/22/delayed-linking-failed-with-rtspsrc-video-and-audio/feed/0fthieryterminator-compatible tmux quick pane switchinghttps://fhackts.wordpress.com/2017/12/21/terminator-and-tmux-fighting-for-meta-key/
https://fhackts.wordpress.com/2017/12/21/terminator-and-tmux-fighting-for-meta-key/#respondThu, 21 Dec 2017 09:57:44 +0000http://fhackts.wordpress.com/?p=671I was trying to use tmux from within terminator with improved keyboard shortcuts. Using tips from some useful resources, i added the following to ~/.tmux.conf, which was supposed to let me switch panes with a simple Alt+arrow

This didn’t work out as expected (nothing was happening), and the culprit was terminator itself which was already binding these for the same task (i.e. switching between panes). After fiddling a bit, i found that the Windows key + Alt combination was pretty much left available on Gnome / terminator:

]]>https://fhackts.wordpress.com/2017/12/21/terminator-and-tmux-fighting-for-meta-key/feed/0fthieryPurging librelec databaseshttps://fhackts.wordpress.com/2017/12/17/purging-librelec-database/
https://fhackts.wordpress.com/2017/12/17/purging-librelec-database/#respondSun, 17 Dec 2017 08:38:22 +0000http://fhackts.wordpress.com/?p=666My Pi2 powered Librelec had a music library with ~2000 albums, which was making the Yastse android kodi remote take litterally 60 minutes to refresh in the background (happily draining the battery along the way).

I needed to purge the complete audio database, and rely on directory browsing instead to launch music.

To do this, log into your librelect device, and remove the culprit db file(s):

]]>https://fhackts.wordpress.com/2017/12/17/purging-librelec-database/feed/0fthierySetting up a gst_uninstalled environment with gst-buildhttps://fhackts.wordpress.com/2017/11/14/setting-up-a-gst_uninstalled-environment-with-gst-build/
https://fhackts.wordpress.com/2017/11/14/setting-up-a-gst_uninstalled-environment-with-gst-build/#respondTue, 14 Nov 2017 15:08:22 +0000http://fhackts.wordpress.com/?p=655I used to follow Arun’s QuickStart guide to setup gst-uninstalled environments easily, but this left quite a lot of manual tasks. It is now possible to make it much faster and easier thanks to gst-build, which

uses meson/ninja instead of autotools (much faster)

replaces both create-uninstalled-setup.sh and git-update.sh scripts

includes built-in support for python and newer projects like gstreamer-vaapi

After installing the required dependencies (meson, ninja), it’s a few lines of commands to have a complete environment usable (not to mention that it is much, much faster and automated):

Updating and rebuilding is a simple (from the main gst-build directory, not from build/):

However, since the deadline i/o scheduler does ignore ionice, even though the –idle argument is passed, the raid check (which is very long) will just not run with a low i/o priority…

The most incredible part is how undocumented this all is…

Advertisements

]]>https://fhackts.wordpress.com/2017/11/10/software-raid-check-killing-ubuntu-16-04-servers/feed/0fthieryGenerating multichannel audio samples from gstreamer using AudioChannelPosition in Pythonhttps://fhackts.wordpress.com/2017/10/06/generating-multichannel-audio-samples-from-gstreamer-using-audiochannelposition-in-python/
https://fhackts.wordpress.com/2017/10/06/generating-multichannel-audio-samples-from-gstreamer-using-audiochannelposition-in-python/#respondFri, 06 Oct 2017 16:33:42 +0000http://fhackts.wordpress.com/?p=596For test purposes it can be useful to generate samples with multiple audio channels, with a different sound per channel to identify it easily. This is something that can be achieved with the audiointerleave plugin, but defining the channel-positions property cannot be done on the command-line.

My goal was to generate a tone of specific frequency for each channel (for a given target channel count), then feed it to a target channel encoded with aac (using fdkaacenc) and save it as m4a file.

The supported channel configuration were found in the fdkaacenc source code. Note that 8 channels does not seem to be supported with the current version of fdk-aac included in gstreamer (8 channels seems to require v0.1.4).

I didn’t find any available example program explaining how to achieve this in python, so i’m sharing it:

Opening one of the m4a file with audacity shows that each channel got a different sound:

Interestingly, one can see that LFE channel is filtering the input (applying a low pass filter), which makes sense since LFE is for the subwoofer.

Advertisements

]]>https://fhackts.wordpress.com/2017/10/06/generating-multichannel-audio-samples-from-gstreamer-using-audiochannelposition-in-python/feed/0fthieryCapture d'écran de 2017-10-06 18-29-19Gstreamer/python: ‘Iterator’ object is not iterable errorhttps://fhackts.wordpress.com/2017/09/26/gstreamerpython-iterator-object-is-not-iterable-error/
https://fhackts.wordpress.com/2017/09/26/gstreamerpython-iterator-object-is-not-iterable-error/#respondTue, 26 Sep 2017 10:23:31 +0000http://fhackts.wordpress.com/?p=570While working on a python gstreamer program (through gobject introspection bindings), i encountered the following error (which was a bit confusing) when trying to iterate over all elements inside a pipeline :

]]>https://fhackts.wordpress.com/2017/09/26/gstreamerpython-iterator-object-is-not-iterable-error/feed/0fthieryChromium opening folders with Audacious on Archhttps://fhackts.wordpress.com/2017/07/21/chromium-opening-folders-with-audacious-on-arch/
https://fhackts.wordpress.com/2017/07/21/chromium-opening-folders-with-audacious-on-arch/#respondFri, 21 Jul 2017 07:54:51 +0000http://fhackts.wordpress.com/?p=552When installing audacious on Arch linux, trying to locate a downloaded file in the file manager will open the audacious music player.

This happens because the audacious.desktop file provided by the upstream source package does register the “inode/directory” mime type. The mime apps specs state that if multiple apps register the same mime type, the opener app (e.g. xdg-open, as used by Chromium or Firefox) will use the first found (in that case, audacious, probably because of the alphabetical sort).

This can be checked by running

$ xdg-mime query default inode/directory
audacious.desktop

To fix this, you can add the following to /etc/xdg/mimeapps.list (as described in the Arch wiki):

[Default Applications]
inode/directory=org.gnome.Nautilus.desktop

From now on, nautilus will open folders by default:

$ xdg-mime query default inode/directory
org.gnome.Nautilus.desktop

Advertisements

]]>https://fhackts.wordpress.com/2017/07/21/chromium-opening-folders-with-audacious-on-arch/feed/0fthieryDisplaying a host IP pre-logon on Archhttps://fhackts.wordpress.com/2017/07/04/displaying-a-host-ip-pre-logon-on-arch/
https://fhackts.wordpress.com/2017/07/04/displaying-a-host-ip-pre-logon-on-arch/#respondTue, 04 Jul 2017 09:58:06 +0000http://fhackts.wordpress.com/?p=535Sometimes it’s useful to be able to determine a system’s IP address directly from the terminal, prior to logon.

To do that, you can create a dedicated systemd unit file (e.g. /lib/systemd/system/display_ip_on_logon.service):

]]>https://fhackts.wordpress.com/2017/07/04/displaying-a-host-ip-pre-logon-on-arch/feed/0fthieryRunning pulseaudio system-wide with pacmd on Archhttps://fhackts.wordpress.com/2017/07/01/running-pulseaudio-system-wide-with-pacmd-on-arch/
https://fhackts.wordpress.com/2017/07/01/running-pulseaudio-system-wide-with-pacmd-on-arch/#commentsSat, 01 Jul 2017 14:47:54 +0000http://fhackts.wordpress.com/?p=492While pulseaudio is, by default, run for each user session (socket-activated, or manually started with systemctl –user start pulseaudio), some scenarios can require having an always-running, system-wide pulseaudio instance. The official documentation on freedesktop.org describes how to achieve that and the drawbacks it implies.

At this point, pulseaudio should work already (try gst-launch pulsesrc ! fakesink -v to check).

4. Enable –disallow-module-loading

The official documentation states: “If the system-wide mode is enabled it is advisable to disable module loading during runtime by passing –disallow-module-loading to the daemon, to inhibit the user from loading arbitrary modules with potentially vulnerable code into the daemon. However, this might break some modules like module-hal-detect which will load a sound driver module each time HAL signals that a new sound card became available in the system.”

I first tried to run with –disallow-module-loading, and the alsa configuration was messed up; even aplay -l or arecord -l were failing. The trick seems to be to add –disallow-module-loading only after a first successful use.

5. Disable –disallow-module-loading to use pacmd

This was the hardest to figure out: if you want pacmd to work, you cannot run pulseaudio with –disallow-module-loading (which is recommended by the official documentation), or you will get: