ALSA preferred instead of pulseaudio

Bug #1656289 reported by Robie Basak
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
snapd (Ubuntu)
Confirmed
Undecided
Chad Miller

Bug Description

Since the update from snapd 2.17.1ubuntu1 to snapd 2.20.1ubuntu1 that landed in xenial-updates on 2017-01-05, a (private) snap I use that speaks to the soundcard no longer can do so. I now get errors of the type:

ALSA lib conf.c:3759:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf

I see that there is an alsa slot now, but my snap (provided by a third party) does not provide an alsa plug, so there appears to be no workaround.

I understand why you'd want to add an alsa slot and disable access to ALSA by default in an update. I'm not against this in principle, but if this change is to land in Xenial automatically, it seems to me that there needs to be a migration path and mention in the changelog. The changelog does say "interfaces: add alsa" but makes no mention of the ensuing expected breakage.

Downgrading just the snapd package to 2.17.1ubuntu1 works around the problem.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

@Robie, thanks for the bug! Just wanted to mention that as a matter stable series release policy we will not remove rules providing access precisely because we do not want to break applications in the manner described (unless there are extraordinary circumstances that would require communication to developers-- we haven't exercised that and this bug is not an example of that). More specifically, we did not allow /usr/share/alsa/alsa.conf in 2.17 and take it away in 2.20; we only added the alsa interface to allow it in 2.20.

I suspect that this is a side-effect of changes to snapd/snap-confine related to how mounts are setup. Assigning to Zygmunt for now since he worked on those changes and could better advise (Zygmunt, please adjust who this is assigned to/etc as necessary).

Changed in snapd (Ubuntu):
assignee: nobody → Zygmunt Krynicki (zyga)
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

@Robie-- I suspect that the snap in question was installed with --devmode. Can you confirm?

Revision history for this message
Robie Basak (racb) wrote : Re: [Bug 1656289] Re: [Regression] 2.20.1ubuntu1 breaks snaps that use ALSA

On Fri, Jan 13, 2017 at 02:56:52PM -0000, Jamie Strandboge wrote:
> @Robie-- I suspect that the snap in question was installed with
> --devmode. Can you confirm?

I don't think it was. The snap is still installed. Is there a way to
tell for sure?

"snap info <snap>" doesn't say devmode anywhere.

Revision history for this message
Jamie Strandboge (jdstrand) wrote : Re: [Regression] 2.20.1ubuntu1 breaks snaps that use ALSA

@Robie: 'snap list' will show if it is installed in devmode.

Revision history for this message
Zygmunt Krynicki (zyga) wrote : Re: [Bug 1656289] Re: [Regression] 2.20.1ubuntu1 breaks snaps that use ALSA

Hi

Ogra checked that we never shipped /usr/share/alsa/alsa.conf so this
particular error seems not to be the cause of the breakage to me.

I would love to know if the snap was installed in devmode before but also
if the snap works if you re-install it with devmode.

Thanks
ZK

On Fri, Jan 13, 2017 at 4:41 PM, Jamie Strandboge <email address hidden> wrote:

> @Robie: 'snap list' will show if it is installed in devmode.
>
> --
> You received this bug notification because you are a member of Snappy
> Developers, which is subscribed to snapd in Ubuntu.
> Matching subscriptions: xxx-bugs-on-snapd
> https://bugs.launchpad.net/bugs/1656289
>
> Title:
> [Regression] 2.20.1ubuntu1 breaks snaps that use ALSA
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/
> 1656289/+subscriptions
>

Revision history for this message
Robie Basak (racb) wrote : Re: [Regression] 2.20.1ubuntu1 breaks snaps that use ALSA

"snap list" doesn't mention devmode. I'm pretty confident I didn't install it with devmode, since that's not what the instructions I followed say to do and I had no other reason to do so. I specifically installed this particular snap because I wanted it confined.

Revision history for this message
Oliver Grawert (ogra) wrote :

obviously the snap ships with a pulse library for pulse 9.0 ... since the ubuntu-core/core snap is xenial and teh host os we are seeing this issue on is also xenial there is only pulse 8.0, this might have some effect ... teh snap should really be built either using cleanbuild or launchpad to only ship the xenial versions of libs inside

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Using 2.20.1, the snap was rebuilt using xenial libraries and now has pulse 8.0. This had no effect. Putting the profile in complain mode also had no effect. It appears the snap is not using pulseaudio and trying to fallback to alsa, but the alsa configuration doesn't exist in the core snap, so that fallback doesn't work.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

I just tested on a clean system with:

$ apt-cache policy snapd snap-confine
snapd:
  Installed: 2.17.1ubuntu1
  Candidate: 2.20.1ubuntu1
  Version table:
     2.20.1ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
 *** 2.17.1ubuntu1 100
        100 /var/lib/dpkg/status
     2.0.2 500
        500 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
snap-confine:
  Installed: 1.0.43-0ubuntu1~16.04.1
  Candidate: 2.20.1ubuntu1
  Version table:
     2.20.1ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
 *** 1.0.43-0ubuntu1~16.04.1 100
        100 /var/lib/dpkg/status

and installed the latest snap in edge (r21, ie the one with xenial libraries) and I see the snap is not using pulseaudio and instead preferring alsa:

ALSA lib conf.c:3750:(snd_config_update_r) Cannot access file /usr/share/alsa/alsa.conf
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM plug:default

This does not appear to be a regression in snapd 2.17 vs 2.20.1. Downgrading the snap itself to r16 allows for sound to work with 2.17. Downgrading/reverting the snap itself to r16 with snapd and snap-confine 2.20.1 also allows sound to work.

It appears to be something in the snap that making it not use pulseaudio.

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Removing the regression-update tag.

tags: removed: regression-update
Changed in snapd (Ubuntu):
assignee: Zygmunt Krynicki (zyga) → Chad Miller (cmiller)
status: New → Confirmed
summary: - [Regression] 2.20.1ubuntu1 breaks snaps that use ALSA
+ ALSA preferred instead of pulseaudio
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.