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

USB audio support is disabled in PulseAudio #94

Closed
vaskas opened this issue Dec 20, 2020 · 7 comments
Closed

USB audio support is disabled in PulseAudio #94

vaskas opened this issue Dec 20, 2020 · 7 comments

Comments

@vaskas
Copy link

vaskas commented Dec 20, 2020

Hi guys,

At the moment (at least in a fresh 3.4.0.24 on h8216) PulseAudio doesn't pick up external USB devices from ALSA. You can see them with aplay -l but not in pactl list short cards.

The following enables USB audio support with automatic switching:

  1. Add the following module to /etc/pulse/arm_droid_default.pa
### Automatically load driver modules depending on the hardware available¬
.ifexists module-udev-detect.so¬
load-module module-udev-detect¬
.else
  1. Enable the policy:
ln -s /etc/pulse/xpolicy.conf.d/usbaudio.conf{.disabled,}
  1. Reboot or kill PulseAudio

P.S. I can see that /etc/pulse/arm_droid_default.pa is a part of the droid-config-h8216-pulseaudio-settings package but couldn't find it in the port infrastructure - happy to send a pull request if you point me to it!

@rinigus
Copy link
Contributor

rinigus commented Dec 21, 2020

Nice work!

To add the link, you would need to make PR to https://github.com/sailfishos-sony-tama/droid-config-sony-tama-pie and make it as in https://github.com/mer-hybris/droid-config-sony-ganges-pie/tree/master/sparse/etc/pulse/xpolicy.conf.d

As for .pa adjustments, I don't know why it is not needed for ganges. Can we add it as a separate config file? If we can, then add it to -configs package as well (under sparse)

@vaskas
Copy link
Author

vaskas commented Dec 23, 2020

Actually ganges includes the pa adjustment in a separate file - https://github.com/mer-hybris/droid-config-sony-ganges-pie/blob/master/sparse/etc/pulse/arm_droid_card_custom.pa, which is in fact included by arm_droid_default.pa. So we can follow the same pattern.

That said, I am starting to suspect that the fix is draining the battery. I've had noticeably worse battery life with collectd / SystemDataScope showing around 70% CPU load, and the pulseaudio process sitting around 2.2%-5% CPU usage according to Crest. I have now switched the udev module off to monitor the consumption and the initial testing confirms the theory.

@ApostolosB
Copy link

ApostolosB commented Dec 28, 2020

This is a nice feature (plug DACs). Is the power consumption issue fixable easily or its not worth it since we move to aosp 10 at some point?

@lal883
Copy link

lal883 commented Oct 15, 2021

It appears this feature is enabled by default in the AOSP 10 based 64 bit build 4.2.0.21 at least. Without any specific configuration changes mentioned here, a USB DAC seems to work on my device (XZ2c).

Following reports that this feature is somehow hard on the battery, wonder if disabling this would make the Tama devices more power efficient Power Consumption While Idling. I will try disabling this referring to the above instructions and monitor as time permits.

@rinigus
Copy link
Contributor

rinigus commented Nov 11, 2021

Is this still the case or we can close it?

@lal883
Copy link

lal883 commented Nov 11, 2021

Works by default in the 4.2 build. Also I didn't notice any difference in power consumption while daily driving with this feature disabled.

@rinigus
Copy link
Contributor

rinigus commented Nov 11, 2021

Thanks, closing

@rinigus rinigus closed this as completed Nov 11, 2021
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

No branches or pull requests

4 participants