pactl parser chokes on pactl list sinks from phablet (nexus 7)

Bug #1333300 reported by Daniel Manrique
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox Provider - Base
Fix Released
High
Sylvain Pineau

Bug Description

I was trying to run pulse-active-port-change on the nexus 7, and it crashed, apparently the parser is unable to handle the pactl list sinks output from this device.

What I did, on Nexus 7 with image 14.10 (r87):

- Enabled r-w with phablet-config writable-image
- Copied pulse-active-port-change with adb push.
- Installed dependency pyton3-checkbox-support to get our pactl parser and some dependencies (pyparsing).
- Installed the required dependency (pulseaudio-utils), to get the pactl command on the tablet.
- ran pulse-active-port-change sinks (on the tablet, via the terminal).

Expected:
- prompt to plug in headphones

Actual: Ugly trace ending in:
  File "/usr/lib/python3/dist-packages/pyparsing.py", line 320, in __getitem__
    return self.__tokdict[i][-1][0]
KeyError: 'property-value'

I'll attach a complete trace (too big for the comment) as well as the actual output from pactl list sinks which is the command whose output made it crash.

Tags: phablet

Related branches

Revision history for this message
Daniel Manrique (roadmr) wrote :
Revision history for this message
Daniel Manrique (roadmr) wrote :
Daniel Manrique (roadmr)
tags: added: phablet
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Looks like a bit of new syntax:

  [Out] Speaker: Main speaker (priority: 150)

The [Out] bit is new. We should check pactl source and patch the parser.

Changed in checkbox-support:
status: New → Triaged
importance: Undecided → High
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

I've updated the parser for Vivid, I retested on a NExus 7 and got a different error but easy to fix:

$ ./pulse-active-port-change sinks
Starting with config: {('Sink #0', 'output-speaker', '')}
You have 30 seconds to plug something
Traceback (most recent call last):
  File "./pulse-active-port-change", line 148, in <module>
    raise SystemExit(AudioPlugDetection.main())
  File "./pulse-active-port-change", line 106, in main
    return cls(ns.timeout, ns.mode).run()
  File "./pulse-active-port-change", line 133, in run
    new_cfg = self.get_sound_config()
  File "./pulse-active-port-change", line 86, in get_sound_config
    cfg.add((record.name, active_port, port_availability))
UnboundLocalError: local variable 'port_availability' referenced before assignment

Once port_availability properly defined (to None) it works:

$ ./pulse-active-port-change sinks
Starting with config: {('Sink #0', 'output-speaker', '')}
You have 30 seconds to plug something
Now using config: {('Sink #0', 'output-wired_headset', None)}
It seems to work!

Changed in checkbox-support:
status: Triaged → In Progress
assignee: nobody → Sylvain Pineau (sylvain-pineau)
affects: checkbox-support → plainbox-provider-checkbox
Changed in plainbox-provider-checkbox:
milestone: none → 0.26
Changed in plainbox-provider-checkbox:
status: In Progress → Fix Committed
Pierre Equoy (pieq)
Changed in plainbox-provider-checkbox:
status: Fix Committed → Fix Released
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.