BQ Aquaris M10 cannot successfully connect with LG WebOS SmartTV / Attempts to connect always time out (issue with apparmor profiles?)

Bug #1590135 reported by Gerry-treppel
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical System Image
In Progress
Undecided
Unassigned
aethercast
In Progress
High
Simon Fels

Bug Description

Following Alan Pope's description of how to connect via Aethercast to a SmartTV, I tried to connect the BQ Aquaris M10 Ubuntu edition with an LG 55UF6809 WebOS smart TV.

First, everything looks fine.

These four commands work fine:
$ sudo service aethercast restart
$ aethercastctl
> enable
> scan

Then the tablet correctly identifies the TV and shows:
"[CHG] Manager Scanning changed: true
Device <mac address> [LG] WebOS TV added"

Then I tried:
> connect <mac address>
and the TV shows that the tablet tries to connect, but then the tablet shows after a couple of seconds:
"[CHG] Manager Scanning changed: false
[CHG] Manager state changed: configuration
[CHG] Manager state changed: disconnected [then the TV also shows that the connection was disconnected]
[CHG] Manager state changed: idle"

It looks to me that the Aethercast connection ends shortly before a real connection can be established.

In comparison, I tried with the same TV a Miracast screen share with a Samsung Note 4 (with Android) and it worked without problems.

summary: - BQ Aquaris M10 cannot successfully connect with LG WebOS SmartTV / Try
- to connet times out
+ BQ Aquaris M10 cannot successfully connect with LG WebOS SmartTV /
+ Attempts to connect always time out
Revision history for this message
Simon Fels (morphis) wrote : Re: BQ Aquaris M10 cannot successfully connect with LG WebOS SmartTV / Attempts to connect always time out

Can you attach the following log files:

 - /var/log/syslog
 - /var/log/upstart/aethercast.log

Simon Fels (morphis)
Changed in aethercast:
importance: Undecided → High
assignee: nobody → Simon Fels (morphis)
Revision history for this message
Gerry-treppel (gerry-treppel) wrote :

Thanks Simon for looking into this bug. I attach both log files: syslog and aethercast.log
Please let me know if you need any other file or info. Thanks!

Revision history for this message
Gerry-treppel (gerry-treppel) wrote :
Rex Tsai (chihchun)
tags: added: compatiblity
tags: added: compatibility
removed: compatiblity
Revision history for this message
GT (gleppert) wrote :

In the meanwhile, I updated the BQ m10 tablet to OTA-12, which officially supports Miracast screens. However, the connection to the LG 55UF6809 WebOS smart TV still does not work:

Test 1 via UI:
In the new option Wireless Displays, it finds my external screen, but when connecting, it simply says that it could not connect to "[LG] webOS TV".

Test 2 via console:
Trying to connect via console, aethercastctl correctly finds the screen, but then when try connecting it gives the error message:
"Failed to connect with device: GDBus.Error:org.aethercast.Error.Failed: Operation failed"

I'd be glad it you could look into this bug. Thanks in advance!

Revision history for this message
GT (gleppert) wrote :

Also after update to OTA-13, the problem still exists.

In OTA 13, everything in the UI looks nicer, but still the tablet cannot connect to the external screen. It tries, but the connection always times out.

If you require any additional information, please get back to me.

Revision history for this message
Andrea Bernabei (faenil) wrote :

@Simon have you had a chance to look at the logs yet?

Revision history for this message
Michael Sievers (mike+s) wrote :

I have the same symptoms. Am trying to connect a BQ M10 with OTA-13 to a Microsoft Wireless Display Adapter and having only timeouts:

aethercastctl> scan
[CHG] Manager Scanning changed: true
Device 9a:5f:d3:ba:f6:f2 MSDisplayAdapter_F2 added
aethercastctl> connect 9a:5f:d3:ba:f6:f2
[CHG] Manager State changed: association
[CHG] Manager Scanning changed: false
[CHG] Manager State changed: configuration
Failed to connect with device: Timeout was reached
[CHG] Manager State changed: disconnected
[CHG] Manager State changed: idle

Looking at /var/log/syslog, I get the impression that it is a file permisson problem (lease file can't be created) or that apparmor is blocking the DHCP process:

Oct 20 15:30:16 ubuntu-phablet dhclient: DHCPREQUEST of 192.168.157.100 on p2p0
to 255.255.255.255 port 67 (xid=0x24353745)
Oct 20 15:30:16 ubuntu-phablet dhclient: DHCPOFFER of 192.168.157.100 from 192.1
68.157.1
Oct 20 15:30:16 ubuntu-phablet dhclient: DHCPACK of 192.168.157.100 from 192.168
.157.1
Oct 20 15:30:16 ubuntu-phablet dhclient: can't create /run/aethercast/dhclient-b
288-e425-ac76-e0af-p2p0.leases: Permission denied
Oct 20 15:30:16 ubuntu-phablet dhclient: bound to 192.168.157.100 -- renewal in
419807 seconds.
Oct 20 15:30:16 ubuntu-phablet kernel: [114896.700534] (0)[21159:dhclient]type=1
400 audit(1476970216.550:728): apparmor="DENIED" operation="open" profile="/sbin
/dhclient" name="/run/aethercast/dhclient-b288-e425-ac76-e0af-p2p0.leases" pid=2
1159 comm="dhclient" requested_mask="wc" denied_mask="wc" fsuid=0 ouid=0

After setting /run/aethercast/ to world-writable for testing:
 sudo chmod 777 /run/aethercast/

I got to a new error message:

Oct 20 15:48:47 ubuntu-phablet dhcpd: Can't create new lease file: Permission de
nied
Oct 20 15:48:47 ubuntu-phablet kernel: [116007.269469] (1)[22043:dhcpd]type=1400
 audit(1476971327.120:737): apparmor="DENIED" operation="mknod" profile="/usr/sb
in/dhcpd" name="/run/aethercast/dhcpd-af7c-12b4-43e0-c782-p2p0.leases.1476971327
" pid=22043 comm="dhcpd" requested_mask="c" denied_mask="c" fsuid=0 ouid=0

I believe this points to a problem with directory rights and/or AppArmor configuration.

Hope this helps..

Best regards,
Michael

Revision history for this message
Michael Sievers (mike+s) wrote :

Indeed, after disabling apparmor (sudo /etc/init.d/apparmor teardown) , aethercastctl connect succeeds!

It might be that just the corresponding apparmor profiles need to be updated.

Revision history for this message
Michael Sievers (mike+s) wrote :

one more comment: when running with apparmor disabled and aethercast active, /var/log/syslog is flooded by messages like this:

Oct 20 16:04:08 ubuntu-phablet kernel: [116928.777799] (1)[22552:MtkOmxVencEncod
]M4Uconfig_port-sec port=VENC_RCPU Vir=1 Sec=0 Dis=1 Dir=0
Oct 20 16:04:08 ubuntu-phablet kernel: [116928.777825] (1)[22552:MtkOmxVencEncod
]M4Uconfig_port-sec port=VENC_REC Vir=1 Sec=0 Dis=1 Dir=0
Oct 20 16:04:08 ubuntu-phablet kernel: [116928.777835] (1)[22552:MtkOmxVencEncod
]M4Uconfig_port-sec port=VENC_BSDMA Vir=1 Sec=0 Dis=1 Dir=0
Oct 20 16:04:08 ubuntu-phablet kernel: [116928.777845] (1)[22552:MtkOmxVencEncod
]M4Uconfig_port-sec port=VENC_SV_COMV Vir=1 Sec=0 Dis=1 Dir=0
Oct 20 16:04:08 ubuntu-phablet kernel: [116928.777890] (1)[22552:MtkOmxVencEncod
]M4Uconfig_port-sec port=VENC_RD_COMV Vir=1 Sec=0 Dis=1 Dir=0
Oct 20 16:04:08 ubuntu-phablet kernel: [116928.777901] (1)[22552:MtkOmxVencEncod
]M4Uconfig_port-sec port=VENC_CUR_LUMA Vir=1 Sec=0 Dis=1 Dir=0
Oct 20 16:04:08 ubuntu-phablet kernel: [116928.777916] (1)[22552:MtkOmxVencEncod
]M4Uconfig_port-sec port=VENC_CUR_CHROMA Vir=1 Sec=0 Dis=1 Dir=0
Oct 20 16:04:08 ubuntu-phablet kernel: [116928.777931] (1)[22552:MtkOmxVencEncod
]M4Uconfig_port-sec port=VENC_REF_LUMA Vir=1 Sec=0 Dis=1 Dir=0
Oct 20 16:04:08 ubuntu-phablet kernel: [116928.777941] (1)[22552:MtkOmxVencEncod
]M4Uconfig_port-sec port=VENC_REF_CHROMA Vir=1 Sec=0 Dis=1 Dir=0
Oct 20 16:04:08 ubuntu-phablet kernel: [116928.778055] (1)[22552:MtkOmxVencEncod
][VCODEC_DEBUG] vcodec_unlocked_compat_ioctl: 0x40044d0b

This might lead to performance issues, I assume, if it is sustained over a longer period of time.

Revision history for this message
GT (gleppert) wrote :

I also can confirm on LG WebOS SmartTV: After disabling apparmor (sudo /etc/init.d/apparmor teardown), aethercastctl connect succeeds!

@Simon: Could you please correct the apparmor profile. This bug seems to be a low hanging fruit :-)

(the screen is blury, but this seems to be https://bugs.launchpad.net/aethercast/+bug/1585534)

Revision history for this message
GT (gleppert) wrote :

Same issue on LG 55UF6809 WebOS smart TV, connected from BQ M10 tablet

(I don't know what screen resolution is transferred from the tablet, but the screen allows Ultra HD)

Revision history for this message
GT (gleppert) wrote :

Sorry for comment #11, this comment was meant for bug https://bugs.launchpad.net/aethercast/+bug/1585534

GT (gleppert)
summary: BQ Aquaris M10 cannot successfully connect with LG WebOS SmartTV /
- Attempts to connect always time out
+ Attempts to connect always time out (issue with apparmor profiles?)
Revision history for this message
Michael Sievers (mike+s) wrote :

Hello,

I got it to work by changing to profiles in /etc/apparmor.d

See the patches attached to this issue. (Diff against M10 FHD, OTA-13)

First, I remounted the filesystem as read/write (from adb shell):

 sudo mount -o rw,remount /

Then, I needed to add a line to sbin.dhclient expicitly:

  /run/aethercast/dhclient*.leases lrw,

Although this should already have been present in

   /{,var/}run/aethercast/dhclient*.leases lrw,

Finally, in usr.sbin.dhcpd I had to add a line to allow accessing the dhcpd leases:

   # aethercast
  /{,var/}run/aethercast/dhcpd*.leases.*

With these changes, it works even after reboot.

Revision history for this message
Michael Sievers (mike+s) wrote :

Attached second patch, both are needed

Revision history for this message
Michael Sievers (mike+s) wrote :
Revision history for this message
GT (gleppert) wrote :

@Michael @Simon Fels: Will this patch be integrated in the upcoming OTA 14?

Revision history for this message
Michael Sievers (mike+s) wrote :

@gleppert: I am not involved with Ubuntu, so I cannot and only wish that it will be.

I have one more related issue on my MD10 FHD with OTA-13: When using aethercast, the internet connection can't be used. It only works after either manually removing the dafault route via the p2p connection each time or by adapting the dhclient config to request the router for wlan0 or for p2p* .

There already seems to be an issue fixing this for mii-box, but the fix does at least not work for MD10.

Whoever resolves this bug here should also test if in the development version internet connection works when aethercast connect is active, otherwise raise a separate issue. My solution was to remove router (or routers?) from the global dhclient.conf request and copy the full request configuration to a new wlan0 section. But that does not seem like the best solution, it is just an indicator for the root cause.

Revision history for this message
GT (gleppert) wrote :

I really hope that @Simon Fels(morphis) has the time to integrate the patch for this bug for the upcoming OTA 14.

Concerning Michael's additional info, I opened a new bug here:
https://bugs.launchpad.net/aethercast/+bug/1639630

Revision history for this message
Simon Fels (morphis) wrote :

Sorry, I just saw this. I've pushed the fix for dhclient into a silo at https://bileto.ubuntu.com/#/ticket/2162. Would be great if you guys can help me testing this change.

For the second policy change for dhcpd I am not sure why you're adding that line as its already present in https://git.launchpad.net/aethercast/tree/debian/usr.sbin.aethercast which gets installed into /etc/apparmor.d/dhcpd.d/ Can you please check this again?

Changed in aethercast:
status: New → In Progress
Revision history for this message
Simon Fels (morphis) wrote :

Added a fix for LP #1639630 to the same Silo. Would be awesome if you guys can help me to verify both fixes in time for OTA 14.

Changed in canonical-devices-system-image:
status: New → In Progress
Revision history for this message
GT (gleppert) wrote :

Thanks a lot, Simon. Could you please point to a manual how to test OTA14 prerelases/Silos. Thanks.

The question on dhcpd goes to Michael Sievers.

Revision history for this message
Michael Sievers (mike+s) wrote :

hello, thanks for pushing this!

comparing the change for dhcpd that was needed on my M10 with what you reference in git, I believe that the missing bit is the '.*' at the end. It appears that also files having some file part after 'leases' need to be written. This might be merged with the other rule by appending '*' to the line ending in 'leases' which should catch both cases (I am assuming, have not tried that, but it would not disperse the configuration over multiple files).

I am actually more concerned about the dhclient change - the line above it should IMHO have covered the case that I needed to add. This should be covered by the empty part in the curly braces. For some reason, that did not work and I had to add that line explicitly.

Best regards,
Michael

Revision history for this message
Michael Sievers (mike+s) wrote :

... and just wondering-doesn't the line in git influence the aethercast binary and not dhcpd? in that case just adding the asterisk would not work.

Revision history for this message
Simon Fels (morphis) wrote :

@Michael: It influences the security context when dhcpd is called from aethercast. debian/usr.sbin.aethercast is installed into /etc/apparmor.d/dhcpd.d/ which is read from /etc/apparmor.d/usr.sbin.dhcpd

Fixed the asterisk at the end for dhcpd. See https://code.launchpad.net/~morphis/aethercast/+git/aethercast/+merge/310189

@GT: Have a look at https://wiki.ubuntu.com/Bileto?action=show&redirect=citrain%2FLandingProcess#Command-Line_Tool ; it requires you to make the filesystem writable. Once you have installed the bileto tool and switched your device into devmode verify its able to connect over adb and then issue

 $ bileto device-upgrade 2162

on your host. This will install all things from the silo mentioned above.

Revision history for this message
Michael Sievers (mike+s) wrote :

@Simon: thanks, that makes matters clearer for me! I will try to find time soon the revert my changes and try if it works with what is committed.

@GT: My M10 is still in "normal" mode except for the files I touched after briefly making it read-write. I am a little reluctant on putting it in full dev mode to try this silo. If you don't have success with it, please give me a signal and I'll see if I get it to run.

Revision history for this message
Michael Sievers (mike+s) wrote :

Hello,

I am afraid I have no success installing bileto. after installing the ppa following the link supplied above and addint a "sudo apt-get update", I could fire the command to install it. It needs phablet-tools as well, so I installed that as well.

Now I have:

$ sudo apt-get install phablet-tools-biletoReading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 phablet-tools-bileto : Depends: phablet-tools (= 1.2.1+15.04.20161102-0ubuntu1) but 1.2+15.04.20160317-0ubuntu1 is to be installed

trying to install the correct version of phablet tools yields another error message:

$ sudo apt-get install phablet-tools=1.2.1+15.04.20161102-0ubuntu1
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 phablet-tools : Depends: repo but it is not installable

Then, I thought an apt-get upgrade might be needed and am stuck at repowerd-data not able to upgrade and assume my M10 now needs reflashing.

So, sorry, I did not get the silo to install because I never got bileto to run.

Revision history for this message
Simon Fels (morphis) wrote :

@Michael: You shouldn't install bileto on the device. Its a host tool you should install on your Ubuntu Desktop device. It will talk to the M10 over adb and then does the right things to update.

Revision history for this message
Michael Sievers (mike+s) wrote :

@Simon: Thanks, that explains a lot... :-)
The upside is, I ended up flashing to plain OTA-13 yesterday night, so I'm in a perfect position to test the silo. Will try to do that by tomorrow.

Revision history for this message
GT (gleppert) wrote :

@Simon: sorry, it took me a while to respond and to figure out how to install the silo. I now tested the Silo 2162 and I can now successfully connect with the LG smart TV. This is excellent news!

However, the issue with bug 1639630 concerning the internet connection is not yet solved. There is no internet connection while screen sharing and also not after having disconnected the screen. Even then, the tablet cannot access the internet. In order to re-establish the internet connection, I have to manually disable Wifi and enable it again, and wait a few seconds.

Please let me know if there is anything else I can test.

Revision history for this message
Michael Sievers (mike+s) wrote :

@Simon: I have been able to connect via aethercast without problems now as well with silo 2162 installed, this change has landed successfully, thanks!

I too am still observing the lost internet connection issue, will comment in the related issue.

thanks,
Michael

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.