mate-desktop / libmatemixer

Mixer library for MATE Desktop
https://mate-desktop.org/
GNU Lesser General Public License v2.1
14 stars 10 forks source link

alsa: Add udev support #33

Closed syrjala closed 3 years ago

syrjala commented 3 years ago

Instead of polling for new devices once per second ask udev to send us events. Avoids waking up the CPU all the time and wasting power.

We keep the timeout source as a fallback when udev support is not enabled, or the udev setup fails for whatever reason.

The logic for udev_event_ok() was snooped from pulseaudio.

vkareh commented 3 years ago

I'm not entirely sure how to test this. It definitely builds and runs with --enable-udev, and my audio works just as well as before, but apart from that I don't know how to tell the difference between master and pull/33

raveit65 commented 3 years ago

@vkareh systemctl --user mask pulseaudio.service pulseaudio.socket This will disable pulseaudio in user session, than restart your box. Back in session mate-volume-control use alsa and you should see your audio hardware in device tab, if alsa-udev audio-detection from libmatemixer is working. Don't forget to enable pulseaudio after testing. systemctl --user unmask pulseaudio.service pulseaudio.socket

syrjala commented 3 years ago

@vkareh systemctl --user mask pulseaudio.service pulseaudio.socket This will disable pulseaudio in user session, than restart your box. Back in session mate-volume-control use alsa and you should see your audio hardware in device tab, if alsa-udev audio-detection from libmatemixer is working. Don't forget to enable pulseaudio after testing. systemctl --user unmask pulseaudio.service pulseaudio.socket

I would say the main thing to test would be audio device hotplug. Eg. if you plug in usb headphones/etc. they should get detected immediately.

raveit65 commented 3 years ago

I would say the main thing to test would be audio device hotplug. Eg. if you plug in usb headphones/etc. they should get detected immediately.

This works well with my usb headset.