Showing posts with label pulseaudio. Show all posts
Showing posts with label pulseaudio. Show all posts

Wednesday, 31 October 2018

Pipewire Hackfest 2018

Good morning from Edinburgh, where the breakfast contains haggis, and the charity shops have some interesting finds.

My main goal in attending this hackfest was to discuss Pipewire integration in the desktop, and how it will eventually replace PulseAudio as the audio daemon.

The main problem GNOME has had over the years with PulseAudio relate mostly to how PulseAudio was a black box when it came to its routing policy. What happens when you plug in an HDMI cable into your laptop? Or turn on your Bluetooth headset? I've heard the stories of folks with highly mobile workstations having to constantly visit the Sound settings panel.

PulseAudio has policy scattered in a number of places (do a "git grep routing" inside the sources to see that): some are in the device manager, then modules themselves can set priorities for their outputs and inputs. But there's nothing to take all the information in, and take a decision based on the hardware that's plugged in, and the applications currently in use.

For Pipewire, the policy decisions would be split off from the main daemon. Pipewire, as it gains PulseAudio compatibility layers, will grow a default/example policy engine that will try to replicate PulseAudio's behaviour. At the very least, that will mean that Pipewire won't regress compared to PulseAudio, and might even be able to take better decisions in the short term.

For GNOME, we still wanted to take control of that part of the experience, and make our own policy decisions. It's very possible that this engine will end up being featureful and generic enough that it will be used by more than just GNOME, or even become the default Pipewire one, but it's far too early to make that particular decision.

In the meanwhile, we wanted the GNOME policies to not be written in C, difficult to experiment with for power users, and for edge use cases. We could have started writing a configuration language, but it would have been too specific, and there are plenty of embeddable languages around. It was also a good opportunity for me to finally write the helper library I've been meaning to write for years, based on my favourite embedded language, Lua.

So I'm introducing Anatole. The goal of the project is to make it trivial to write chunks of programs in Lua, while the core of your project is written in C (we might even be able to embed it in Python or Javascript, once introspection support is added).

It's still in the very early days, and unusable for anything as of yet, but progress should be pretty swift. The code is mostly based on Victor Toso's incredible "Lua factory" plugin in Grilo. (I'm hoping that, once finished, I won't have to remember on which end of the stack I need to push stuff for Lua to do something with it ;)

Tuesday, 9 August 2016

Blog backlog, Post 4, Headset fixes for Dell machines

At the bottom of the release notes for GNOME 3.20, you might have seen the line:
If you plug in an audio device (such as a headset, headphones or microphone) and it cannot be identified, you will now be asked what kind of device it is. This addresses an issue that prevented headsets and microphones being used on many Dell computers.
Before I start explaining what this does, as a picture is worth a thousand words:


This selection dialogue is one you will get on some laptops and desktop machines when the hardware is not able to detect whether the plugged in device is headphones, a microphone, or a combination of both, probably because it doesn't have an impedance detection circuit to figure that out.

This functionality was integrated into Unity's gnome-settings-daemon version a couple of years ago, written by David Henningsson.

The code that existed for this functionality was completely independent, not using any of the facilities available in the media-keys plugin to volume keys, and it could probably have been split as an external binary with very little effort.

After a bit of to and fro, most of the sound backend functionality was merged into libgnome-volume-control, leaving just 2 entry points, one to signal that something was plugged into the jack, and another to select which type of device was plugged in, in response to the user selection. This means that the functionality should be easily implementable in other desktop environments that use libgnome-volume-control to interact with PulseAudio.

Many thanks to David Henningsson for the original code, and his help integrating the functionality into GNOME, Bednet for providing hardware to test and maintain this functionality, and Allan, Florian and Rui for working on the UI notification part of the functionality, and wiring it all up after I abandoned them to go on holidays ;)

Friday, 13 May 2016

Blutella, a Bluetooth speaker receiver

Quite some time ago, I was asked for a way to use the AV amplifier (which has a fair bunch of speakers connected to it) in our living-room that didn't require turning on the TV to choose a source.

I decided to try and solve this problem myself, as an exercise rather than a cost saving measure (there are good-quality Bluetooth receivers available for between 15 and 20€).

Introducing Blutella



I found this pot of Nutella in my travels (in Europe, smaller quantities are usually in a jar that looks like a mustard glass, with straight sides) and thought it would be a perfect receptacle for a CHIP, to allow streaming via Bluetooth to the amp. I wanted to make a nice how-to for you, dear reader, but best laid plans...

First, the materials:
  • a CHIP
  • jar of Nutella, and "Burnt umber" acrylic paint
  • micro-USB to USB-A and jack 3.5mm to RCA cables
  • Some white Sugru, for a nice finish around the cables
  • bit of foam, a Stanley knife, a CD marker

That's around 10€ in parts (cables always seem to be expensive), not including our salvaged Nutella jar, and the CHIP itself (9$ + shipping).

You'll start by painting the whole of the jar, on the inside, with the acrylic paint. Allow a couple of days to dry, it'll be quite thick.

So, the plan that went awry. Turns out that the CHIP, with the cables plugged in, doesn't fit inside this 140g jar of Nutella. I also didn't make the holes exactly in the right place. The CHIP is tiny, but not small enough to rotate inside the jar without hitting the side, and the groove to screw the cap also have only one position.

Anyway, I pierced two holes in the lid for the audio jack and the USB charging cable, stuffed the CHIP inside, and forced the lid on so it clipped on the jar's groove.

I had nice photos with foam I cut to hold the CHIP in place, but the finish isn't quite up to my standards. I guess that means I can attempt this again with a bigger jar ;)

The software

After flashing the CHIP with Debian, I logged in, and launched a script which I put together to avoid either long how-tos, or errors when I tried to reproduce the setup after a firmware update and reset.

The script for setting things up is in the CHIP-bluetooth-speaker repository. There are a few bugs due to drivers, and lack of integration, but this blog is the wrong place to track them, so check out the issues list.

Apart from those driver problems, I found the integration between PulseAudio and BlueZ pretty impressive, though I wish there was a way for the speaker to reconnect to the phone I streamed from when turned on again, as Bluetooth speakers and headsets do, removing one step from playing back audio.

Monday, 23 September 2013

GNOME 3.10 is coming!

The new release is coming! As has been the case for the past couple of releases, I've mostly been shepherding great work by other contributors, and I'll detail my limited contributions beyond mere bug fixing.

Wayland support

I've done some work on enabling clutter-gtk applications to be able to run on  Wayland though the harder work of implementing sub-surfaces is still pending.

Giovanni has done incredible work on mutter to start moving some of the X11 dependent code inside the compositor, which should allow you to run a (cut down) Wayland session using gnome-shell.

This also means that Thomas Wood's redesigned Displays panel has Wayland support. A perfect storm of changes for one of the only panels that received little attention since the GNOME 2.x days.


The new displays panel with a TV that claims to be oh so small


Date & Time redesign

Zeeshan, through his work on Geoclue2, and Kalev, through his Summer of Code project, have completely redesigned the Date & Time panel. Aside from being easier to setup, it means that we can finally implement the automatic timezone switching depending on your location.


The new Date & Time panel


BlueZ 5 support

GNOME is the first major desktop to ship with BlueZ 5 support, thanks to work by Gustavo Padovan and Emilio Pozuelo Monfort.

The older version was not supported anymore, and the new version allows us to support things like "Just Works" pairing, better support of audio devices (though the PulseAudio 5.x release to support this is only coming shortly after GNOME 3.10) and a much better architecture for a more stable operation.

GNOME 3.12 should see a redesigned Bluetooth panel, to match current best practices on other platforms (such as merging the management and pairing wizard UIs into one).


Bluetooth devices in use


Miscellaneous


Intuos 4 OLEDs

OLED support for Wacom Intuos 4 tablets (as seen above, thanks Przemo), media keys support for MPRIS applications such as Spotify (thanks to Michael Wood and Lars Uebernickel), updated UI for the Universal Access panel (the ever present Matthias Clasen), support for many more fingerprint readers in libfprint (thanks Vasily Khoruzhick).


Redesigned Universal Access panel



And to my contributions

More work on Videos. Totem 3.10 is still based on the same interface as in GNOME 3.8, but some work has been on the master branch towards the new UI, with some of the features getting backported. We have:
  • new session management for when Totem crashes
  • support for chapters within files (such as Matroska videos)
  • Wayland bug fixes in GTK+, clutter and the combined clutter-gtk
  • a completed GDBus port
  • Working overlaid controls (though their behaviour isn't quite up to scratch)
  • Remote files support in Grilo, including support for Recent files
  • Started work on merging the various sidebars within the main view (which included landing GtkSearchBar in GTK+)
  • libquvi 0.9 support
On top of which you'll find the usual mix of bug fixes, small featuresitch scratching, and swamp-draining in finger-pointing fests.

I also spent quite a bit of time on a side project that didn't come to fruition at this time, but I hope to be able to post some details soon.

Thursday, 21 May 2009

I really haz 5.1

As promised, gnome-volume-control in master now has fade and subwoofer support, as well as instant-apply for the default output selection. We just need to be able to set it up for 5.1 now...

I haz 5.1!

Thursday, 12 March 2009

Our new volume feature

The feature was some time in coming, but Jon bit the bullet, and created the new gnome-volume-control. I came in afterwards, and did bug fixing and small new features.

Compared to the old volume control, we're already winning in terms of ease of use: no more weirdly named ALSA mixers we need to work-around, easy selection of input and output devices, microphone level bar.

Even the applet (as well as the gnome-settings-daemon media keys plugin) is now simpler because it doesn't need to work-around weird sound cards, with weirdly named channels.

PulseAudio 0.9.15 brings a few new features that we'll be able to use in the near future, such as back/front fade, sound card profiles selection (one click to setup multi-speaker output), and probably even Bluetooth headsets integration. Speaker testing is also on the cards.

I haz 5.1!

Yay for the desktop with a modern sound system.

Monday, 15 September 2008

Living on the edge

If you want to try out the new BlueZ 4 code, and D-Bus API, come to try the upcoming Fedora 10 Beta (coming Tuesday a week). We have BlueZ 4.x and updated obex-data-server, and gvfs working with the new APIs.

gnome-user-share and nautilus-sendto are upcoming as well.

It also allows you to test the PulseAudio Bluetooth integration, if you're feeling particularly adventurous.

Saturday, 23 February 2008

gnome-bluetooth nearly dead

After the fun time debugging, I started implementing ObexPush in gnome-user-share, pretty much as planned. Code's in SVN. Next up are notifications, and asking whether to accept transfers for each session.

My little transfer just got started

I also committed the new goom visuals to gst-plugins-good. Better visuals, MMX, SSE2 and Altivec optimisations (I think). Get it from CVS while it's hot!

Hot chips, yummy