Re: [PATCH] pulse8-cec: return 0 when invalidating the logical address

2018-12-02 Thread Torbjorn Jansson

On 2018-11-14 14:25, Hans Verkuil wrote:

Return 0 when invalidating the logical address. The cec core produces
a warning for drivers that do this.

Signed-off-by: Hans Verkuil 
Reported-by: Torbjorn Jansson 
---
diff --git a/drivers/media/usb/pulse8-cec/pulse8-cec.c 
b/drivers/media/usb/pulse8-cec/pulse8-cec.c
index 365c78b748dd..b085b14f3f87 100644
--- a/drivers/media/usb/pulse8-cec/pulse8-cec.c
+++ b/drivers/media/usb/pulse8-cec/pulse8-cec.c
@@ -586,7 +586,7 @@ static int pulse8_cec_adap_log_addr(struct cec_adapter 
*adap, u8 log_addr)
else
pulse8->config_pending = true;
mutex_unlock(&pulse8->config_lock);
-   return err;
+   return log_addr == CEC_LOG_ADDR_INVALID ? 0 : err;
  }

  static int pulse8_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,




question, is below warning also fixed by this patch? or is it a different 
problem?
note that this warning showed up without me unplugging the usb device.
and cec-ctl have stopped working (again...)


[75420.604557] WARNING: CPU: 5 PID: 23114 at drivers/media/cec/cec-adap.c:1217 
cec_adap_unconfigure+0x9c/0xa0 [cec]
[75420.604562] Modules linked in: fuse 8021q garp mrp xt_nat macvlan 
xt_CHECKSUM iptable_mangle ip6t_REJECT nf_reject_ipv6 tun xfs devlink 
ebtable_filter ebtables ipt_MASQUERADE iptable_nat nf_nat_ipv4 xt_addrtype 
xt_conntrack nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 br_netfilter 
bridge stp llc nfsv3 rpcsec_gss_krb5 nfsv4 dns_resolver nfs fscache 
target_core_user uio target_core_pscsi bonding target_core_file 
target_core_iblock iscsi_target_mod target_core_mod rc_cec pulse8_cec cec 
ip6table_filter ip6_tables nct6775 hwmon_vid vfat fat dm_multipath scsi_dh_rdac 
scsi_dh_emc scsi_dh_alua nvidia_drm(POE) nvidia_modeset(POE) nvidia_uvm(POE) 
nvidia(POE) cx25840 cx23885 rc_tt_1500 altera_ci tda18271 altera_stapl tveeprom 
cx2341x sp2 si2157 si2168 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp
[75420.604634]  snd_hda_codec_hdmi ir_rc6_decoder videobuf2_dma_sg 
videobuf2_memops kvm_intel dvb_usb_dvbsky dvb_usb_v2 videobuf2_dvb m88ds3103 
videobuf2_v4l2 videobuf2_common rc_rc6_mce v4l2_common videodev kvm dvb_core 
iTCO_wdt mceusb rc_core iTCO_vendor_support snd_hda_codec_realtek 
snd_hda_codec_generic joydev crct10dif_pclmul cdc_acm cp210x snd_hda_intel 
crc32_pclmul ghash_clmulni_intel snd_hda_codec intel_cstate intel_uncore 
ipmi_ssif snd_hda_core intel_rapl_perf media snd_hwdep drm_kms_helper i2c_mux 
snd_seq snd_seq_device snd_pcm drm snd_timer snd soundcore i2c_i801 mei_me 
lpc_ich mei ipmi_si ipmi_devintf ipmi_msghandler pcc_cpufreq nfsd binfmt_misc 
auth_rpcgss nfs_acl lockd grace sunrpc dm_thin_pool dm_cache_smq dm_cache 
dm_persistent_data libcrc32c dm_bio_prison mxm_wmi uas crc32c_intel igb
[75420.604705]  usb_storage megaraid_sas dca i2c_algo_bit wmi vfio_pci 
irqbypass vfio_virqfd vfio_iommu_type1 vfio i2c_dev
[75420.604722] CPU: 5 PID: 23114 Comm: cec-ctl Tainted: P   OE 
4.19.5-200.local.fc28.x86_64 #1
[75420.604725] Hardware name: Supermicro C7X99-OCE-F/C7X99-OCE-F, BIOS 2.1a 
06/15/2018

[75420.604732] RIP: 0010:cec_adap_unconfigure+0x9c/0xa0 [cec]
[75420.604736] Code: 3c 05 00 00 e8 b5 fa ff ff 48 8d bb 30 04 00 00 31 c9 ba 
01 00 00 00 be 01 00 00 00 e8 8d a8 80 e0 48 89 df 5b e9 a4 fe ff ff <0f> 0b eb 
98 0f 1f 44 00 00 41 57 41 56 4c 8d b7 d0 03 00 00 41 55

[75420.604739] RSP: 0018:aa7423197d78 EFLAGS: 00010282
[75420.604743] RAX: ff92 RBX: 99d61cdbd800 RCX: 
[75420.604746] RDX:  RSI: 0246 RDI: 99d62e903700
[75420.604749] RBP: 99d19d4aaa00 R08: 000e R09: 
[75420.604752] R10: 18fa R11:  R12: aa7423197de8
[75420.604755] R13: 7ffe4fb9bd40 R14: 7ffe4fb9bd01 R15: 99d61cdbd800
[75420.604759] FS:  7f1e0310d740() GS:99d63f94() 
knlGS:

[75420.604762] CS:  0010 DS:  ES:  CR0: 80050033
[75420.604765] CR2: 7f0d225fe680 CR3: 000ac544a005 CR4: 003626e0
[75420.604768] DR0:  DR1:  DR2: 
[75420.604771] DR3:  DR6: fffe0ff0 DR7: 0400
[75420.604773] Call Trace:
[75420.604784]  __cec_s_log_addrs+0x25c/0x4c0 [cec]
[75420.604790]  cec_ioctl+0x1e2/0xda0 [cec]
[75420.604800]  ? do_filp_open+0xa7/0x100
[75420.604806]  do_vfs_ioctl+0xa4/0x630
[75420.604812]  ksys_ioctl+0x60/0x90
[75420.604818]  __x64_sys_ioctl+0x16/0x20
[75420.604826]  do_syscall_64+0x5b/0x160
[75420.604833]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[75420.604838] RIP: 0033:0x7f1e0210bc57
[75420.604842] Code: 00 00 90 48 8b 05 49 82 2c 00 64 c7 00 26 00 00 00 48 c7 
c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 
f0 ff ff 73 01 c3 48 8b 0d 19 82 2c 00 f7 d8 64 89 01 48
[75420.604845] RSP: 002b:7ffe4fb9b908 EFLAGS: 0246 ORIG_RAX: 
00

Re: cec kernel oops with pulse8 usb cec adapter

2018-11-14 Thread Torbjorn Jansson

On 2018-11-14 14:23, Hans Verkuil wrote:

On 11/14/18 14:00, Torbjorn Jansson wrote:




since there now is a patch that appears to be working and fixing this problem
i'd like to ask for some troubleshooting advice with another cec issue i have
that i haven't figured out why it is happening and exactly whats causing it.

i'm not sure if it is a hardware issue or a software issue or both.

this is what is happening:
i have a script that polls the tv for current status by running:
cec-ctl --to=0 --give-device-power-status
after a fresh reboot this works fine for a while then sometime later it stops
working and errors with:
-
# cec-ctl --to=0 --give-device-power-status
Driver Info:
  Driver Name: pulse8-cec
  Adapter Name   : serio0
  Capabilities   : 0x003f
  Physical Address
  Logical Addresses
  Transmit
  Passthrough
  Remote Control Support
  Monitor All
  Driver version : 4.18.16
  Available Logical Addresses: 1
  Physical Address   : 1.4.0.0
  Logical Address Mask   : 0x0800
  CEC Version: 2.0
  Vendor ID  : 0x000c03
  Logical Addresses  : 1 (Allow RC Passthrough)

Logical Address  : 11 (Playback Device 3)
  Primary Device Type: Playback
  Logical Address Type   : Playback
  All Device Types   : Playback
  RC TV Profile  : None
  Device Features:
  None


Transmit from Playback Device 3 to TV (11 to 0):
CEC_MSG_GIVE_DEVICE_POWER_STATUS (0x8f)
  Sequence: 119437 Tx Timestamp: 865389.535s
  Tx, Error (1), Max Retries
-

once this happens i can never get back any status and also running:
cec-ctl -M
gives me a lot of:
Transmitted by Playback Device 3 to TV (11 to 0):
CEC_MSG_GIVE_DEVICE_POWER_STATUS (0x8f)
  Tx, Error (1), Max Retries
once for every run of my status checking script.

i know polling like this is not the best option and a better way would be to
listen for events and then take action when status changes but that's not
easily doable with what i need it for.

anyway, once i start getting the above errors when i poll it will not give me
back any good status any more (everything errors out)

also sending commands to tv to turn on or off like:
cec-ctl --to=0 --image-view-on
or
cec-ctl --to=0 --standby
doesn't work.

BUT if i remove power to tv and wait for standby led to go out completely then
power it back on i can use above two commands to turn on/off the tv even when
they return errors and i still can't poll for current status.

so even with the errors always returned at this stage the on/off commands still
gets sent and works.

do you think this behavior is a sw or hw issue or both?


Does 'cec-ctl --to=0 --give-device-power-status' eventually fail even if the TV 
is
on all the time? Or does it only fail if the TV goes to standby or has been in
standby for a very long time?



good question, tv will go to standby by itself after some time and i can't have 
the tv turned on for a few days in a row (not practical).

my gut feeling is that it happens after being in standby for a long time.
it may work fine for a day or two then it fails.


This error ('Tx, Error (1), Max Retries') indicates that the pulse-eight returns
transmit errors suggesting that the CEC line is locked (always high or low).



I did some more testing and i was able to somehow trigger the error state by 
having one cec-ctl -M and one cec-ctl -S going at the same time but this is not 
consistent (tested several times and was only able to get it to fail like this 
once)
Also i tested to pull hdmi cable from tv when in error state and see if i could 
reach other devices, tested with cec-ctl -S and it did display a some of my 
other hdmi devices like amp & bd player.


So i guess my tv is to blame for locking up cec.
Maybe i'll just schedule something to cut power completely to tv during night 
for a few hours.






if i'm not mistaken i could unplug usb cable to pulse8 cec adapter and reinsert
to make it work properly again (no errors and correct response like a fresh 
start)
but i'm not 100% sure of this.
when i tried it now i get a new kernel oops:
-
[866129.392139] usb 7-2: USB disconnect, device number 3
[866129.409568] cdc_acm 7-2:1.1: acm_start_wb - usb_submit_urb(write bulk)
failed: -19
[866129.409576] cdc_acm 7-2:1.1: acm_start_wb - usb_submit_urb(write bulk)
failed: -19
[866129.409635] WARNING: CPU: 10 PID: 1571 at drivers/media/cec/cec-adap.c:1243


Not a kernel oops, just a warning. The pulse-eight driver has a small bug
that causes this warning, but it does not affect the CEC behavior in any way.

I'll post a patch.



Ok so nothing to worry about then.


Re: cec kernel oops with pulse8 usb cec adapter

2018-11-14 Thread Torbjorn Jansson

On 2018-10-22 10:59, Sean Young wrote:

On Sat, Oct 20, 2018 at 11:12:16PM +0200, Hans Verkuil wrote:

Hi Sean,

Can you take a look at this, it appears to be an RC issue, see my analysis 
below.

On 10/20/2018 03:26 PM, Torbjorn Jansson wrote:

Hello

i'm using the pulse8 usb cec adapter to control my tv.
i have a few scripts that poll the power status of my tv and after a while it 
stops working returning errors when trying to check if tv is on or off.
this i think matches a kernel oops i'm seeing that i suspect is related to this.

i have sometimes been able to recover from this problem by completely cutting 
power to my tv and also unplugging the usb cec adapter.
i have a feeling that the tv is at least partly to blame for cec-ctl not 
working but in any case there shouldn't be a kernel oops.


also every now and then i see this in dmesg:
cec cec0: transmit: failed 05
cec cec0: transmit: failed 06
but that doesn't appear to do any harm as far as i can tell.

any idea whats causing the oops?

the ops:

BUG: unable to handle kernel NULL pointer dereference at 0038
PGD 0 P4D 0
Oops:  [#1] SMP PTI
CPU: 9 PID: 27687 Comm: kworker/9:2 Tainted: P   OE 
4.18.12-200.fc28.x86_64 #1
Hardware name: Supermicro C7X99-OCE-F/C7X99-OCE-F, BIOS 2.1a 06/15/2018
Workqueue: events pulse8_irq_work_handler [pulse8_cec]
RIP: 0010:ir_lirc_scancode_event+0x3d/0xb0 [rc_core]


Huh. ir_lirc_scancode_event() calls spin_lock_irqsave(&dev->lirc_fh_lock, 
flags);

The spinlock dev->lirc_fh_lock is initialized in ir_lirc_register(), which is 
called
from rc_register_device(), except when the protocol is CEC:

 /* Ensure that the lirc kfifo is setup before we start the thread */
 if (dev->allowed_protocols != RC_PROTO_BIT_CEC) {
 rc = ir_lirc_register(dev);
 if (rc < 0)
 goto out_rx;
 }

So it looks like ir_lirc_scancode_event() fails because dev->lirc_fh_lock was 
never
initialized.

Could this be fall-out from the lirc changes you did not too long ago?


Yes, this is broken. My bad, sorry. I think this must have been broken since
v4.16. I can write a patch but I don't have a patch but I'm on the train
to ELCE in Edinburgh now, with no hardware to test on.


Sean


since there now is a patch that appears to be working and fixing this problem 
i'd like to ask for some troubleshooting advice with another cec issue i have 
that i haven't figured out why it is happening and exactly whats causing it.


i'm not sure if it is a hardware issue or a software issue or both.

this is what is happening:
i have a script that polls the tv for current status by running:
cec-ctl --to=0 --give-device-power-status
after a fresh reboot this works fine for a while then sometime later it stops 
working and errors with:

-
# cec-ctl --to=0 --give-device-power-status
Driver Info:
Driver Name: pulse8-cec
Adapter Name   : serio0
Capabilities   : 0x003f
Physical Address
Logical Addresses
Transmit
Passthrough
Remote Control Support
Monitor All
Driver version : 4.18.16
Available Logical Addresses: 1
Physical Address   : 1.4.0.0
Logical Address Mask   : 0x0800
CEC Version: 2.0
Vendor ID  : 0x000c03
Logical Addresses  : 1 (Allow RC Passthrough)

  Logical Address  : 11 (Playback Device 3)
Primary Device Type: Playback
Logical Address Type   : Playback
All Device Types   : Playback
RC TV Profile  : None
Device Features:
None


Transmit from Playback Device 3 to TV (11 to 0):
CEC_MSG_GIVE_DEVICE_POWER_STATUS (0x8f)
Sequence: 119437 Tx Timestamp: 865389.535s
Tx, Error (1), Max Retries
-

once this happens i can never get back any status and also running:
cec-ctl -M
gives me a lot of:
Transmitted by Playback Device 3 to TV (11 to 0): 
CEC_MSG_GIVE_DEVICE_POWER_STATUS (0x8f)

Tx, Error (1), Max Retries
once for every run of my status checking script.

i know polling like this is not the best option and a better way would be to 
listen for events and then take action when status changes but that's not 
easily doable with what i need it for.


anyway, once i start getting the above errors when i poll it will not give me 
back any good status any more (everything errors out)


also sending commands to tv to turn on or off like:
cec-ctl --to=0 --image-view-on
or
cec-ctl --to=0 --standby
doesn't work.

BUT if i remove power to tv and wait for standby led to go out completely then 
power it back on i can use above two commands to turn on/off the tv even when 
they return errors a

Re: [PATCH] media: rc: cec devices do not have a lirc chardev

2018-11-14 Thread Torbjorn Jansson

On 2018-10-22 15:17, Sean Young wrote:

On Mon, Oct 22, 2018 at 01:28:42PM +0100, Sean Young wrote:

On Mon, Oct 22, 2018 at 12:30:29PM +0100, Hans Verkuil wrote:

On 10/22/2018 11:14 AM, Sean Young wrote:

Would you be able to test the following patch please?


Sean,

I think you should be able to test this with the vivid driver. Load the vivid 
driver,
run:

cec-ctl --tv; cec-ctl -d1 --playback

Then:

cec-ctl -d1 -t0 --user-control-pressed ui-cmd=F5


Ah, thanks. That will help with testing/reproducing.
  

That said, I tried this, but it doesn't crash for me, but perhaps I need to run
some RC command first...


Hmm I think those commands should be enough. It probably needs
CONFIG_DEBUG_SPINLOCK to detect the uninitialized spinlock. I'm trying it now.


Yes, that turned out to work. With CONFIG_DEBUG_SPINLOCK on, it goes bang
every time. With the patch, the problem goes away.

Without CONFIG_DEBUG_SPINLOCK we're going into undefined behaviour, so
Torbjorn you're only seeing the oops occassionally (and which is why it has
not been observed or reported before).

Thanks,

Sean



FYI i have tested this patch for a while now and have not seen any more kernel 
oops.

So it appears to be working.



Re: [PATCH] media: rc: cec devices do not have a lirc chardev

2018-10-22 Thread Torbjorn Jansson

On 2018-10-22 14:28, Sean Young wrote:

On Mon, Oct 22, 2018 at 12:30:29PM +0100, Hans Verkuil wrote:

On 10/22/2018 11:14 AM, Sean Young wrote:

On Mon, Oct 22, 2018 at 11:44:22AM +0200, Torbjorn Jansson wrote:

On 2018-10-22 10:59, Sean Young wrote:

On Sat, Oct 20, 2018 at 11:12:16PM +0200, Hans Verkuil wrote:

Hi Sean,

Can you take a look at this, it appears to be an RC issue, see my analysis 
below.

On 10/20/2018 03:26 PM, Torbjorn Jansson wrote:

Hello

i'm using the pulse8 usb cec adapter to control my tv.
i have a few scripts that poll the power status of my tv and after a while it 
stops working returning errors when trying to check if tv is on or off.
this i think matches a kernel oops i'm seeing that i suspect is related to this.

i have sometimes been able to recover from this problem by completely cutting 
power to my tv and also unplugging the usb cec adapter.
i have a feeling that the tv is at least partly to blame for cec-ctl not 
working but in any case there shouldn't be a kernel oops.


also every now and then i see this in dmesg:
cec cec0: transmit: failed 05
cec cec0: transmit: failed 06
but that doesn't appear to do any harm as far as i can tell.

any idea whats causing the oops?

the ops:

BUG: unable to handle kernel NULL pointer dereference at 0038
PGD 0 P4D 0
Oops:  [#1] SMP PTI
CPU: 9 PID: 27687 Comm: kworker/9:2 Tainted: P   OE 
4.18.12-200.fc28.x86_64 #1
Hardware name: Supermicro C7X99-OCE-F/C7X99-OCE-F, BIOS 2.1a 06/15/2018
Workqueue: events pulse8_irq_work_handler [pulse8_cec]
RIP: 0010:ir_lirc_scancode_event+0x3d/0xb0 [rc_core]


Huh. ir_lirc_scancode_event() calls spin_lock_irqsave(&dev->lirc_fh_lock, 
flags);

The spinlock dev->lirc_fh_lock is initialized in ir_lirc_register(), which is 
called
from rc_register_device(), except when the protocol is CEC:

  /* Ensure that the lirc kfifo is setup before we start the thread */
  if (dev->allowed_protocols != RC_PROTO_BIT_CEC) {
  rc = ir_lirc_register(dev);
  if (rc < 0)
  goto out_rx;
  }

So it looks like ir_lirc_scancode_event() fails because dev->lirc_fh_lock was 
never
initialized.

Could this be fall-out from the lirc changes you did not too long ago?


Yes, this is broken. My bad, sorry. I think this must have been broken since
v4.16. I can write a patch but I don't have a patch but I'm on the train
to ELCE in Edinburgh now, with no hardware to test on.


Sean



the kernel oops have been happening for a while now.
yesterday when i checked my logs i can see them at least back a couple of
months when i was running 4.17

also my scripts to poll status of my tv and turn it on/off works for a while
so it doesn't crash right away.
maybe it only crashes when i send cec command to turn on/off tv and only
polling for status is no problem.


i think i have a separate issue too because i had problems even before the
kernel oopses started.
but i suspect this is caused by my tv locking up the cec bus because
unplugging power to tv for a few minutes (i must wait or it will still be
just as broken) and then back used to resolve the cec errors from my
scripts.



Would you be able to test the following patch please?


Sean,

I think you should be able to test this with the vivid driver. Load the vivid 
driver,
run:

cec-ctl --tv; cec-ctl -d1 --playback

Then:

cec-ctl -d1 -t0 --user-control-pressed ui-cmd=F5


Ah, thanks. That will help with testing/reproducing.
  

That said, I tried this, but it doesn't crash for me, but perhaps I need to run
some RC command first...


Hmm I think those commands should be enough. It probably needs
CONFIG_DEBUG_SPINLOCK to detect the uninitialized spinlock. I'm trying it now.

Thanks,

Sean



FYI the commands i run is as follows.

getting status, this is run frequently several times per minute (once every 10 
or 15 seconds):

cec-ctl --to=0 --give-device-power-status

then when i want to power on or off this is run:
cec-ctl --to=0 --image-view-on
or
cec-ctl --to=0 --standby


it usually takes day or two before i get a kernel oops.
but i haven't studied super closely when exactly the oops happens in relation 
to what commands i sent since by now I'm used to it not working most of the time.




Re: cec kernel oops with pulse8 usb cec adapter

2018-10-22 Thread Torbjorn Jansson

On 2018-10-22 10:59, Sean Young wrote:

On Sat, Oct 20, 2018 at 11:12:16PM +0200, Hans Verkuil wrote:

Hi Sean,

Can you take a look at this, it appears to be an RC issue, see my analysis 
below.

On 10/20/2018 03:26 PM, Torbjorn Jansson wrote:

Hello

i'm using the pulse8 usb cec adapter to control my tv.
i have a few scripts that poll the power status of my tv and after a while it 
stops working returning errors when trying to check if tv is on or off.
this i think matches a kernel oops i'm seeing that i suspect is related to this.

i have sometimes been able to recover from this problem by completely cutting 
power to my tv and also unplugging the usb cec adapter.
i have a feeling that the tv is at least partly to blame for cec-ctl not 
working but in any case there shouldn't be a kernel oops.


also every now and then i see this in dmesg:
cec cec0: transmit: failed 05
cec cec0: transmit: failed 06
but that doesn't appear to do any harm as far as i can tell.

any idea whats causing the oops?

the ops:

BUG: unable to handle kernel NULL pointer dereference at 0038
PGD 0 P4D 0
Oops:  [#1] SMP PTI
CPU: 9 PID: 27687 Comm: kworker/9:2 Tainted: P   OE 
4.18.12-200.fc28.x86_64 #1
Hardware name: Supermicro C7X99-OCE-F/C7X99-OCE-F, BIOS 2.1a 06/15/2018
Workqueue: events pulse8_irq_work_handler [pulse8_cec]
RIP: 0010:ir_lirc_scancode_event+0x3d/0xb0 [rc_core]


Huh. ir_lirc_scancode_event() calls spin_lock_irqsave(&dev->lirc_fh_lock, 
flags);

The spinlock dev->lirc_fh_lock is initialized in ir_lirc_register(), which is 
called
from rc_register_device(), except when the protocol is CEC:

 /* Ensure that the lirc kfifo is setup before we start the thread */
 if (dev->allowed_protocols != RC_PROTO_BIT_CEC) {
 rc = ir_lirc_register(dev);
 if (rc < 0)
 goto out_rx;
 }

So it looks like ir_lirc_scancode_event() fails because dev->lirc_fh_lock was 
never
initialized.

Could this be fall-out from the lirc changes you did not too long ago?


Yes, this is broken. My bad, sorry. I think this must have been broken since
v4.16. I can write a patch but I don't have a patch but I'm on the train
to ELCE in Edinburgh now, with no hardware to test on.


Sean



the kernel oops have been happening for a while now.
yesterday when i checked my logs i can see them at least back a couple of 
months when i was running 4.17


also my scripts to poll status of my tv and turn it on/off works for a while so 
it doesn't crash right away.
maybe it only crashes when i send cec command to turn on/off tv and only 
polling for status is no problem.



i think i have a separate issue too because i had problems even before the 
kernel oopses started.
but i suspect this is caused by my tv locking up the cec bus because unplugging 
power to tv for a few minutes (i must wait or it will still be just as broken) 
and then back used to resolve the cec errors from my scripts.


cec kernel oops with pulse8 usb cec adapter

2018-10-20 Thread Torbjorn Jansson

Hello

i'm using the pulse8 usb cec adapter to control my tv.
i have a few scripts that poll the power status of my tv and after a while it 
stops working returning errors when trying to check if tv is on or off.

this i think matches a kernel oops i'm seeing that i suspect is related to this.

i have sometimes been able to recover from this problem by completely cutting 
power to my tv and also unplugging the usb cec adapter.
i have a feeling that the tv is at least partly to blame for cec-ctl not 
working but in any case there shouldn't be a kernel oops.



also every now and then i see this in dmesg:
cec cec0: transmit: failed 05
cec cec0: transmit: failed 06
but that doesn't appear to do any harm as far as i can tell.

any idea whats causing the oops?

the ops:

BUG: unable to handle kernel NULL pointer dereference at 0038
PGD 0 P4D 0
Oops:  [#1] SMP PTI
CPU: 9 PID: 27687 Comm: kworker/9:2 Tainted: P   OE 
4.18.12-200.fc28.x86_64 #1

Hardware name: Supermicro C7X99-OCE-F/C7X99-OCE-F, BIOS 2.1a 06/15/2018
Workqueue: events pulse8_irq_work_handler [pulse8_cec]
RIP: 0010:ir_lirc_scancode_event+0x3d/0xb0 [rc_core]
Code: 8d ae b4 07 00 00 49 81 c6 b8 07 00 00 53 e8 4a df c3 d5 48 89 ef 49 89 
45 00 e8 4e 84 41 d6 49 8b 1e 49 89 c4 4c 39 f3 74 58 <8b> 43 38 8b 53 40 89 c1 
2b 4b 3c 39 ca 72 41 21 d0 49 8b 7d 00 49

RSP: 0018:aa10e3c07d58 EFLAGS: 00010017
RAX: 0002 RBX:  RCX: 0018
RDX: 0001 RSI: 00316245397fa93c RDI: 966d31c8d7b4
RBP: 966d31c8d7b4 R08:  R09: 
R10: 0003 R11: aa10e3c07e28 R12: 0002
R13: aa10e3c07d88 R14: 966d31c8d7b8 R15: 0073
FS:  () GS:966d3f44() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 0038 CR3: 0009d820a003 CR4: 003606e0
DR0:  DR1:  DR2: 
DR3:  DR6: fffe0ff0 DR7: 0400
Call Trace:
 ir_do_keydown+0x75/0x260 [rc_core]
 rc_keydown+0x54/0xc0 [rc_core]
 cec_received_msg_ts+0xaa8/0xaf0 [cec]
 process_one_work+0x1a1/0x350
 worker_thread+0x30/0x380
 ? pwq_unbound_release_workfn+0xd0/0xd0
 kthread+0x112/0x130
 ? kthread_create_worker_on_cpu+0x70/0x70
 ret_from_fork+0x35/0x40
Modules linked in: rc_tt_1500 dvb_usb_dvbsky dvb_usb_v2 uas usb_storage fuse 
vhost_net vhost tap xt_CHECKSUM iptable_mangle ip6t_REJECT nf_reject_ipv6 tun 
8021q garp mrp xt_nat macvlan xfs devlink ebta
 si2157 si2168 cx25840 cx23885 kvm altera_ci tda18271 joydev ir_rc6_decoder 
rc_rc6_mce crct10dif_pclmul crc32_pclmul ghash_clmulni_intel intel_cstate 
intel_uncore altera_stapl m88ds3103 tveeprom cx2341
 mxm_wmi igb crc32c_intel megaraid_sas dca i2c_algo_bit wmi vfio_pci irqbypass 
vfio_virqfd vfio_iommu_type1 vfio i2c_dev

CR2: 0038
---[ end trace 6cea307e2666b11a ]---
RIP: 0010:ir_lirc_scancode_event+0x3d/0xb0 [rc_core]
Code: 8d ae b4 07 00 00 49 81 c6 b8 07 00 00 53 e8 4a df c3 d5 48 89 ef 49 89 
45 00 e8 4e 84 41 d6 49 8b 1e 49 89 c4 4c 39 f3 74 58 <8b> 43 38 8b 53 40 89 c1 
2b 4b 3c 39 ca 72 41 21 d0 49 8b 7d 00 49

RSP: 0018:aa10e3c07d58 EFLAGS: 00010017
RAX: 0002 RBX:  RCX: 0018
RDX: 0001 RSI: 00316245397fa93c RDI: 966d31c8d7b4
RBP: 966d31c8d7b4 R08:  R09: 
R10: 0003 R11: aa10e3c07e28 R12: 0002
R13: aa10e3c07d88 R14: 966d31c8d7b8 R15: 0073
FS:  () GS:966d3f44() knlGS:
CS:  0010 DS:  ES:  CR0: 80050033
CR2: 0038 CR3: 0009d820a003 CR4: 003606e0
DR0:  DR1:  DR2: 
DR3:  DR6: fffe0ff0 DR7: 0400


si2168 b40 and lack of auto plp

2017-08-14 Thread Torbjorn Jansson

Hello

a few questions
is there any card out there with a si2168 b40 in a country that uses plp!=0 
that dvb-t2 actually works for?

i suspect the answer to this is no and that it is broken on all cards.

auto plp appears broken anyway on my ct2-4650 with si2168 b40 and has been 
broken for a long time.




i have done a number of things to try to figure out whats going on.
first i have extracted the firmware for si2168 b40 used by the windows driver 
and this matches exactly with:

http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-B40/4.0.25/dvb-demod-si2168-b40-01.fw
which is the one i use on my linux box, so firmware should theoretically be ok.

then i used debugfs to turn on the extra debugging in si2168, i was mainly 
interested in verifying what plp the scanning software actually sent to the 
driver (si2168_set_frontend)


i then found out that both dvbv5-scan and w_scan both appear to use 
stream_id=0, i then made a quick and dirty hack to w_scan so it always sets plp 
id to 1 instead of 0 and this resulted for the first time in a lock on a dvb-t2 mux


so problem i have with this card appears to be the lack of auto plp and also 
the fact that all scanning programs i have tried so far doesn't really know how 
to handle plp by themselves and expect driver to do the right thing.



i assume this is a problem that is best fixed in the driver? right?
or is the software using the dvb card expected to somehow figure out plp and 
sett it correctly?


is there a way to dump what commands the windows driver is sending? if so 
perhaps something could be figured out how it sets plp.



(please keep me on CC when replying to list so i don't miss it)


Re: DVBSky T980C CI issues (kernel 4.0.x)

2017-07-17 Thread Torbjorn Jansson

i think i need to revive this very old thread.
i ran into some problems with my new dvb box after the old one gave up 
permanently (probably due to worn out flash) and then learned a few things.


apparently i need to use PLP=1 for the dvb-t2 channels to get a lock.
if i use my dvb box and uses plp=0 as is the default it never locks on 
to the t2 frequencies and never finds any of the dvb-t2 channels (= all 
the hd channels)


so as was discussed earlier i think my issue with the new version of 
ct2-4650 is related to plp.


when this thread was going last year i ran into issues i could not solve 
and then gave up since it wasn't too important to have the ct2-4650 working.

but maybe it is time to give this another try.

also last year i had issues loading the media build modules due to an 
extra kernel module that was built that i just had to delete (didn't 
know it back then)




so, two main questions:
how is plp supposed to work? is the drivers supposed to auto detect this?
if so, how do i convince the drivers to use plp=1 when i use for example 
w_scan ?


and secondly, if drivers is supposed to auto detect plp, it clearly 
doesn't happen for me.
since this works on windows, is it possible that the windows driver is 
using a newer firmware for the si6168-b40 than 4.0.25?
(latest one i found on: 
http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-B40/)

any advice on how to check or capture what the windows driver uses?

thanks.


On 2016-06-06 13:30, Torbjorn Jansson wrote:
FYI i still get "Exec format error" while modprobing cx23885 with 
media_build from today.


any chance of having this fixed so i can test the mediabuild code with 
my dvbsky card?




On 2016-03-03 23:03, Torbjorn Jansson wrote:

found something, modprobe results in the following dmesg message:

frame_vector: exports duplicate symbol frame_vector_create (owned by
kernel)

every time i do a modprobe of cx23885
what does this mean?

On 2016-03-03 22:58, Torbjorn Jansson wrote:

i'm having a bit of a problem testing the changed firmware on my t980c
card.

complied the code from media_tree and i get the usb card to work with
those modules but for some reason modprobe of cx23885 results in:
# modprobe cx23885
modprobe: ERROR: could not insert 'cx23885': Exec format error

all the other modules work just fine, i'm not sure what i'm doing wrong.


On 2016-03-03 19:22, Torbjorn Jansson wrote:

i was about to ask how to easiest see what firmware i was running
without rebooting when i realized i already have it in this mail
thread ;)

all of the firmware i'm running is the ones that came from dvbsky
directly in this file:
http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz

i suspect i should go thru all of the firmware files i use since if one
is bad the other ones is probably also bad.

i assume i also should also check: dvb-tuner-si2158-a20-01.fw
what version is a good one? i have found 2 different files:

the one i current usefrom dvbsky, also same as OpenELEC fw repo uses
with md5sum:
8e98d25d6219e235b519a3c47dbfa856  dvb-tuner-si2158-a20-01.fw

and then i found another one at
http://palosaari.fi/linux/v4l-dvb/firmware/Si2158/Si2158-A20/
0cba7ce61c1411cbe7f22c0746e24e33  dvb-tuner-si2158-a20-01.fw
this file is a bit smaller.

i will retest with the new firmware you suggested and see what happens.


On 2016-03-03 12:02, Olli Salonen wrote:

Hi Jurgen, Torbjörn,

I've noticed that there is currently a small confusion about the
firmware versions for the Si2168-A20 demodulator. This is used in the
older versions of DVBSky T680C (TechnoTrend CT2-4650 CI) and DVBSky
T980C (TechnoTrend CT2-4500 CI).

The version 2.0.5 does not support PLP handling and seems to work very
badly with the Linux driver - at least for me. Version 2.0.35 on the
other hand seems to find all DVB-T/T2 channels for me just fine with
both dvbv5-scan and w_scan (devices used for this test: TechnoTrend
CT2-4650 CI and TechnoTrend CT2-4500 CI new version).

Versions used:
dvbv5-scan version 1.7.0
w_scan version 20150111 (compiled for DVB API 5.10)

So if you are running these Si2168-A20 based devices, make sure you've
got the firmware 2.0.35 that can be downloaded for example here:
http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-A20/32e06713b33915f674bfb2c209beaea5/ 






Cheers,
-olli

On 20 February 2016 at 19:20, Jurgen Kramer 
wrote:

Hi,

On Sat, 2016-02-20 at 16:57 +0100, Torbjorn Jansson wrote:

i have tested your patch with my dvbsky dvb-t2 card.
testing was done by compiling a custom kernel with your patch
included.
test was done against fedora 22 4.3.4-200 kernel

with the patch included the CI slot is found.
so there is some progress for sure
-
[   10.189408] cx25840 11-0044: loaded v4l-cx23885-avcore-01.fw
firmware
(16382 bytes)
[   10.206683] cx23885_dvb_register() allocating 1 frontend(s)
[   10.207968] cx23885[0]: cx23885 based dvb card
[   10.224306] i2c i2c-10: Ad

Re: uvcvideo

2016-07-14 Thread Torbjorn Jansson

On 2016-07-14 18:30, Charles Stegall wrote:
> On Thu, Jul 14, 2016 at 05:10:04PM +0200, Torbjorn Jansson wrote:
>> On 2016-07-14 16:16, Charles Stegall wrote:
>>>
>>> this happens ...
>>>
>>> modprobe uvcvideo
>>> modprobe: ERROR: could not insert 'uvcvideo': Exec format error
>>>
>> did you get any interesting output in dmesg ?
>> like problem loading modules or symbol errors?
>>
>> this sounds a bit like a problem i had where dmesg showed some symbol
>> conflicts when i built drivers via media_build.
>> but i'm no expert on this.
>


Thank you for the prompt response.

pieces of log files, perhaps relevant

Jul 14 13:15:26 fiji kernel: usb 2-6: new high-speed USB device number 6 using 
ehci-pci
Jul 14 13:15:26 fiji kernel: usb 2-6: New USB device found, idVendor=041e, 
idProduct=4095
Jul 14 13:15:26 fiji kernel: usb 2-6: New USB device strings: Mfr=3, Product=1, 
SerialNumber=2
Jul 14 13:15:26 fiji kernel: usb 2-6: Product: Live! Cam Sync HD VF0770
Jul 14 13:15:26 fiji kernel: usb 2-6: Manufacturer: Creative Technology Ltd.
Jul 14 13:15:26 fiji kernel: usb 2-6: SerialNumber: 2014032113535
Jul 14 13:15:26 fiji kernel: frame_vector: exports duplicate symbol 
frame_vector_create (owned by kernel)
Jul 14 13:15:55 fiji kernel: frame_vector: exports duplicate symbol 
frame_vector_create (owned by kernel)
Jul 14 15:44:16 fiji kernel: uvcvideo: Unknown symbol vb2_vmalloc_memops (err 0)
Jul 14 16:04:04 fiji kernel: frame_vector: exports duplicate symbol 
frame_vector_create (owned by kernel)
Jul 14 18:16:10 fiji kernel: frame_vector: exports duplicate symbol 
frame_vector_create (owned by kernel)



exactly the problem i had, Hans Verkuil pointed me in the right 
direction on solving this.


what has happened is that you most likely used media_build and it 
installed a module called frame_vector.ko but this module is already 
built into your kernel so when a module that depends on it tries to load 
things go wrong and module dont load properly.


what i did to work around this was to find the module under 
/lib/modules/`uname -r` that got installed by media_build and removed it.
then i reran 'depmod -a' to update module dependencies and problem was 
solved.


for reference see mail on linux-media list from 2016-06-26 from Hans 
with subject "Re: media_build & cx23885"


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: uvcvideo

2016-07-14 Thread Torbjorn Jansson

On 2016-07-14 16:16, Charles Stegall wrote:


this happens ...

modprobe uvcvideo
modprobe: ERROR: could not insert 'uvcvideo': Exec format error


did you get any interesting output in dmesg ?
like problem loading modules or symbol errors?

this sounds a bit like a problem i had where dmesg showed some symbol 
conflicts when i built drivers via media_build.

but i'm no expert on this.

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: media_build & cx23885

2016-06-26 Thread Torbjorn Jansson

On 2016-06-26 17:07, Hans Verkuil wrote:

On 06/26/2016 04:29 PM, Torbjorn Jansson wrote:

Hello

if i use media_build and modprobe cx23885 i get:
# modprobe cx23885
modprobe: ERROR: could not insert 'cx23885': Exec format error

and on dmesg i get:
frame_vector: exports duplicate symbol frame_vector_create (owned by kernel)


The frame_vector.ko module was incorrectly installed in /lib/modules/`uname -r`
(probably in the kernel/mm directory). Your kernel already has that module
compiled in, so that's the reason for the duplicate symbol.

Remove that module and run 'depmod -a' and it should work again.

I've seen this before, but I don't know why media_build compiles and installs it
for a kernel that doesn't need it.



thanks, that helped.
i removed frame_vector.ko and that solved the problem.

is it possible that the media_build scripts always make the module but 
only installs frame_vector.ko based on some conditions?

if so, it might be my own fault.

because i test different media build versions i want an easy way to 
remove just the modules produced by media build so i tend to first build 
it normally but instead of make install i copy over the modules manually.
copying all *.ko modules under media_build/v4l to /lib/modules/`uname 
-r`/updates/media and then run depmod.


this way i can just revert by deleting the entire updates/media folder 
and wont have to go thru loads of different folders and hunt for the 
relevant .ko files.


anyway, wish i had asked you earlier back in february/march when i first 
ran into this frame_vector problem.
now i can hopefully continue my troubleshooting, i suspect i need to fix 
some application problems too since it looks like this driver (compared 
to the old from dvbsky) don't support the old dvb api for getting signal 
strength causing application issues since the program is not yet updated 
fully to new dvb api.



--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


media_build & cx23885

2016-06-26 Thread Torbjorn Jansson

Hello

if i use media_build and modprobe cx23885 i get:
# modprobe cx23885
modprobe: ERROR: could not insert 'cx23885': Exec format error

and on dmesg i get:
frame_vector: exports duplicate symbol frame_vector_create (owned by kernel)

any idea whats causing this?
this prevents one of my cards from working with media_build
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Problems with Si2168 DVB-C card (cx23885)

2016-06-22 Thread Torbjorn Jansson

On 2016-06-22 15:57, Hurda wrote:



kernel: si2168 8-0064: found a 'Silicon Labs Si2168-B40'
kernel: si2168 8-0064: downloading firmware from file
'dvb-demod-si2168-b40-01.fw'
kernel: si2168 8-0064: firmware version: 4.0.19


Distribution is Arch. Kernel version is 4.6.2.


IIRC you have to use firmware-version 4.0.11 in pre-4.8-kernels.
http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-B40/4.0.11/
There was a message on this mailing list a few weeks ago (May 21st,
regarding DVBSky T330).

Might work with that.


i got a similar card but for dvb-t2 i also found out that one of the 
firmware files must be a specific version.
the one i got from dvbskys firmware package did not work at all except 
with their binary blob driver.


but i'm not yet able to properly test my card since i'm still on 4.4 
kernel (fedora 22) and media_build is broken when modprobing cx23885 
module, dmesg complains about duplicate symbol and modprobe fails with 
exec format error.



--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DVBSky T980C CI issues (kernel 4.0.x)

2016-06-06 Thread Torbjorn Jansson
FYI i still get "Exec format error" while modprobing cx23885 with 
media_build from today.


any chance of having this fixed so i can test the mediabuild code with 
my dvbsky card?




On 2016-03-03 23:03, Torbjorn Jansson wrote:

found something, modprobe results in the following dmesg message:

frame_vector: exports duplicate symbol frame_vector_create (owned by
kernel)

every time i do a modprobe of cx23885
what does this mean?

On 2016-03-03 22:58, Torbjorn Jansson wrote:

i'm having a bit of a problem testing the changed firmware on my t980c
card.

complied the code from media_tree and i get the usb card to work with
those modules but for some reason modprobe of cx23885 results in:
# modprobe cx23885
modprobe: ERROR: could not insert 'cx23885': Exec format error

all the other modules work just fine, i'm not sure what i'm doing wrong.


On 2016-03-03 19:22, Torbjorn Jansson wrote:

i was about to ask how to easiest see what firmware i was running
without rebooting when i realized i already have it in this mail
thread ;)

all of the firmware i'm running is the ones that came from dvbsky
directly in this file:
http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz

i suspect i should go thru all of the firmware files i use since if one
is bad the other ones is probably also bad.

i assume i also should also check: dvb-tuner-si2158-a20-01.fw
what version is a good one? i have found 2 different files:

the one i current usefrom dvbsky, also same as OpenELEC fw repo uses
with md5sum:
8e98d25d6219e235b519a3c47dbfa856  dvb-tuner-si2158-a20-01.fw

and then i found another one at
http://palosaari.fi/linux/v4l-dvb/firmware/Si2158/Si2158-A20/
0cba7ce61c1411cbe7f22c0746e24e33  dvb-tuner-si2158-a20-01.fw
this file is a bit smaller.

i will retest with the new firmware you suggested and see what happens.


On 2016-03-03 12:02, Olli Salonen wrote:

Hi Jurgen, Torbjörn,

I've noticed that there is currently a small confusion about the
firmware versions for the Si2168-A20 demodulator. This is used in the
older versions of DVBSky T680C (TechnoTrend CT2-4650 CI) and DVBSky
T980C (TechnoTrend CT2-4500 CI).

The version 2.0.5 does not support PLP handling and seems to work very
badly with the Linux driver - at least for me. Version 2.0.35 on the
other hand seems to find all DVB-T/T2 channels for me just fine with
both dvbv5-scan and w_scan (devices used for this test: TechnoTrend
CT2-4650 CI and TechnoTrend CT2-4500 CI new version).

Versions used:
dvbv5-scan version 1.7.0
w_scan version 20150111 (compiled for DVB API 5.10)

So if you are running these Si2168-A20 based devices, make sure you've
got the firmware 2.0.35 that can be downloaded for example here:
http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-A20/32e06713b33915f674bfb2c209beaea5/




Cheers,
-olli

On 20 February 2016 at 19:20, Jurgen Kramer 
wrote:

Hi,

On Sat, 2016-02-20 at 16:57 +0100, Torbjorn Jansson wrote:

i have tested your patch with my dvbsky dvb-t2 card.
testing was done by compiling a custom kernel with your patch
included.
test was done against fedora 22 4.3.4-200 kernel

with the patch included the CI slot is found.
so there is some progress for sure
-
[   10.189408] cx25840 11-0044: loaded v4l-cx23885-avcore-01.fw
firmware
(16382 bytes)
[   10.206683] cx23885_dvb_register() allocating 1 frontend(s)
[   10.207968] cx23885[0]: cx23885 based dvb card
[   10.224306] i2c i2c-10: Added multiplexed i2c bus 12
[   10.225633] si2168 10-0064: Silicon Labs Si2168 successfully
attached
[   10.243310] si2157 12-0060: Silicon Labs Si2147/2148/2157/2158
successfully attached
[   10.244560] DVB: registering new adapter (cx23885[0])
[   10.245807] cx23885 :07:00.0: DVB: registering adapter 0
frontend
0 (Silicon Labs Si2168)...
[   10.417402] sp2 9-0040: CIMaX SP2 successfully attached
[   10.447120] DVBSky T980C MAC address: 00:17:42:54:09:85
[   10.448844] cx23885_dev_checkrevision() Hardware revision = 0xa5
[   10.450550] cx23885[0]/0: found at :07:00.0, rev: 4, irq: 19,
latency: 0, mmio: 0xf6e0

later when tuning:

[   67.728109] si2168 10-0064: found a 'Silicon Labs Si2168-A20'
[   67.802203] si2168 10-0064: downloading firmware from file
'dvb-demod-si2168-a20-01.fw'
[   68.968336] si2168 10-0064: firmware version: 2.0.5
[   68.977071] si2157 12-0060: found a 'Silicon Labs Si2158-A20'
[   69.961057] si2157 12-0060: downloading firmware from file
'dvb-tuner-si2158-a20-01.fw'
[   70.969094] si2157 12-0060: firmware version: 2.1.9


but using dvbv5-scan to scan it doesn't find any channel.
all i get is this:

Scanning frequency #1 77000
 (0x00) Signal= -114.00dBm
Scanning frequency #2 75400
 (0x00) Signal= -27.00dBm C/N= 32.50dB
Scanning frequency #3 54600
 (0x00) Signal= -25.00dBm C/N= 33.75dB
Scanning frequency #4 65000
 (0x00) Signal= -18.00dBm C/N= 36.00dB
Scanning frequenc

Re: DVBSky T980C CI issues (kernel 4.0.x)

2016-03-05 Thread Torbjorn Jansson

that worked a bit better.

first some dmesg output for reference:
[   15.002224] cx25840 11-0044: loaded v4l-cx23885-avcore-01.fw firmware 
(16382 bytes)

[   15.019548] cx23885_dvb_register() allocating 1 frontend(s)
[   15.021444] cx23885[0]: cx23885 based dvb card
[   15.169994] i2c i2c-10: Added multiplexed i2c bus 12
[   15.172514] si2168 10-0064: Silicon Labs Si2168 successfully attached
[   15.232989] si2157 12-0060: Silicon Labs Si2147/2148/2157/2158 
successfully attached

[   15.235445] DVB: registering new adapter (cx23885[0])
[   15.237911] cx23885 :07:00.0: DVB: registering adapter 0 frontend 
0 (Silicon Labs Si2168)...

[   15.383847] sp2 9-0040: CIMaX SP2 successfully attached
[   15.414270] DVBSky T980C MAC address: 00:17:42:54:09:85
[   15.416377] cx23885_dev_checkrevision() Hardware revision = 0xa5
[   15.418433] cx23885[0]/0: found at :07:00.0, rev: 4, irq: 19, 
latency: 0, mmio: 0xf6e0


[   21.612743] dvb_ca adapter 0: DVB CAM detected and initialised 
successfully



[   61.890098] si2168 10-0064: found a 'Silicon Labs Si2168-A20'
[   62.000956] si2168 10-0064: downloading firmware from file 
'dvb-demod-si2168-a20-01.fw'

[   67.113044] si2168 10-0064: firmware version: 2.0.35
[   67.121721] si2157 12-0060: found a 'Silicon Labs Si2158-A20'
[   67.147054] si2157 12-0060: downloading firmware from file 
'dvb-tuner-si2158-a20-01.fw'

[   68.155814] si2157 12-0060: firmware version: 2.1.9



first test:
looks like it locks on and this time also the dvb-t2 muxes.
BUT output of w_scan for each found mux is like this:
77: (time: 03:31.238) signal ok:QAM_AUTO f = 77 kHz 
I999B8C999D999T999G999Y999P0 (0:0:0)

Info: no data from PAT after 2 seconds
deleting (QAM_AUTO f = 77 kHz I999B8C999D999T999G999Y999P0 
(0:0:0))


and finally:
ERROR: Sorry - i couldn't get any working frequency/transponder
 Nothing to scan!!


and w_scan never outputs the channel names as it normally does at the end.

second test:
unplug CA module and reinsert.
this is normally needed before i get picture with other programs than 
w_scan.


this did not result in any change, w_scan still outputs "no data from 
PAT after 2 seconds" for each found frequency.



third test:
remove CA module and repeat.
Success!
both t2 muxes was found and w_scan showed what looked like the complete 
channel list.



forth test:
now that it is working, reinsert CA module and retest.
problem is back.
same error as previous tests with CA module inserted "no data from PAT 
after 2 seconds" on each locked on frequency.




a comment regarding the CA module.
no matter what driver i have used, the dvbsky binary blob driver or 
linux-media driver or kernels built in driver all of them have had minor 
CA issues.


at every boot i need to first tune to a dvb channel then unplug the CA 
module and reinsert it, when this is done the channel starts working.

if i don't do this manually i will never get a picture.

i guess this could be an application issue too since sending a CA_RESET 
also seems to fix it, but because of how the program i use work doing a 
good test is a bit hard.




On 2016-03-05 06:36, Olli Salonen wrote:

Hi Torbjörn,

Apply the recent patch from Shuah to fix that recent oops:

https://patchwork.linuxtv.org/patch/33353/

It's not yet in the media_tree, but I reckon it'll be there shortly...

Cheers,
Olli
On 5 Mar 2016 1:09 a.m., "Torbjorn Jansson" <
torbjorn.jans...@mbox200.swipnet.se> wrote:


using a 4.2 kernel i get a bit further but now i'm getting a completely
different oops:
[  181.077662] BUG: unable to handle kernel NULL pointer dereference at
0010
[  181.077723] IP: []
v4l_vb2q_enable_media_source+0x9/0x40 [videodev]

latest git code is too unstable for testing this.
i will instead try to redo my test by rebuilding the kernel rpms and
include the patch to fix the CI.

the point of the test i was trying to do was to try the newer version of
the firmware and see if that improved things.


On 2016-03-04 05:42, Olli Salonen wrote:


Hi,

You probably have kernel 4.3 or newer? I've seen this same happening
as well. It's probable that the media_build will be updated in the
coming days to fix this, but so far I did not found an easy way out.
Kernel 4.2 or older works fine though.

Hans Verkuil is the resident media_build guru, so maybe he can help
you with that...

Cheers,
-olli


On 4 March 2016 at 00:03, Torbjorn Jansson
 wrote:


found something, modprobe results in the following dmesg message:

frame_vector: exports duplicate symbol frame_vector_create (owned by
kernel)

every time i do a modprobe of cx23885
what does this mean?

On 2016-03-03 22:58, Torbjorn Jansson wrote:



i'm having a bit of a problem testing the changed firmware on my t980c
card.

complied the code from media_tree and i get the usb card to work with
those modules but for som

Re: DVBSky T980C CI issues (kernel 4.0.x)

2016-03-04 Thread Torbjorn Jansson
using a 4.2 kernel i get a bit further but now i'm getting a completely 
different oops:
[  181.077662] BUG: unable to handle kernel NULL pointer dereference at 
0010
[  181.077723] IP: [] 
v4l_vb2q_enable_media_source+0x9/0x40 [videodev]


latest git code is too unstable for testing this.
i will instead try to redo my test by rebuilding the kernel rpms and 
include the patch to fix the CI.


the point of the test i was trying to do was to try the newer version of 
the firmware and see if that improved things.



On 2016-03-04 05:42, Olli Salonen wrote:

Hi,

You probably have kernel 4.3 or newer? I've seen this same happening
as well. It's probable that the media_build will be updated in the
coming days to fix this, but so far I did not found an easy way out.
Kernel 4.2 or older works fine though.

Hans Verkuil is the resident media_build guru, so maybe he can help
you with that...

Cheers,
-olli


On 4 March 2016 at 00:03, Torbjorn Jansson
 wrote:

found something, modprobe results in the following dmesg message:

frame_vector: exports duplicate symbol frame_vector_create (owned by kernel)

every time i do a modprobe of cx23885
what does this mean?

On 2016-03-03 22:58, Torbjorn Jansson wrote:


i'm having a bit of a problem testing the changed firmware on my t980c
card.

complied the code from media_tree and i get the usb card to work with
those modules but for some reason modprobe of cx23885 results in:
# modprobe cx23885
modprobe: ERROR: could not insert 'cx23885': Exec format error

all the other modules work just fine, i'm not sure what i'm doing wrong.


On 2016-03-03 19:22, Torbjorn Jansson wrote:


i was about to ask how to easiest see what firmware i was running
without rebooting when i realized i already have it in this mail
thread ;)

all of the firmware i'm running is the ones that came from dvbsky
directly in this file:
http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz

i suspect i should go thru all of the firmware files i use since if one
is bad the other ones is probably also bad.

i assume i also should also check: dvb-tuner-si2158-a20-01.fw
what version is a good one? i have found 2 different files:

the one i current usefrom dvbsky, also same as OpenELEC fw repo uses
with md5sum:
8e98d25d6219e235b519a3c47dbfa856  dvb-tuner-si2158-a20-01.fw

and then i found another one at
http://palosaari.fi/linux/v4l-dvb/firmware/Si2158/Si2158-A20/
0cba7ce61c1411cbe7f22c0746e24e33  dvb-tuner-si2158-a20-01.fw
this file is a bit smaller.

i will retest with the new firmware you suggested and see what happens.


On 2016-03-03 12:02, Olli Salonen wrote:


Hi Jurgen, Torbjörn,

I've noticed that there is currently a small confusion about the
firmware versions for the Si2168-A20 demodulator. This is used in the
older versions of DVBSky T680C (TechnoTrend CT2-4650 CI) and DVBSky
T980C (TechnoTrend CT2-4500 CI).

The version 2.0.5 does not support PLP handling and seems to work very
badly with the Linux driver - at least for me. Version 2.0.35 on the
other hand seems to find all DVB-T/T2 channels for me just fine with
both dvbv5-scan and w_scan (devices used for this test: TechnoTrend
CT2-4650 CI and TechnoTrend CT2-4500 CI new version).

Versions used:
dvbv5-scan version 1.7.0
w_scan version 20150111 (compiled for DVB API 5.10)

So if you are running these Si2168-A20 based devices, make sure you've
got the firmware 2.0.35 that can be downloaded for example here:

http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-A20/32e06713b33915f674bfb2c209beaea5/



Cheers,
-olli

On 20 February 2016 at 19:20, Jurgen Kramer  wrote:


Hi,

On Sat, 2016-02-20 at 16:57 +0100, Torbjorn Jansson wrote:


i have tested your patch with my dvbsky dvb-t2 card.
testing was done by compiling a custom kernel with your patch
included.
test was done against fedora 22 4.3.4-200 kernel

with the patch included the CI slot is found.
so there is some progress for sure
-
[   10.189408] cx25840 11-0044: loaded v4l-cx23885-avcore-01.fw
firmware
(16382 bytes)
[   10.206683] cx23885_dvb_register() allocating 1 frontend(s)
[   10.207968] cx23885[0]: cx23885 based dvb card
[   10.224306] i2c i2c-10: Added multiplexed i2c bus 12
[   10.225633] si2168 10-0064: Silicon Labs Si2168 successfully
attached
[   10.243310] si2157 12-0060: Silicon Labs Si2147/2148/2157/2158
successfully attached
[   10.244560] DVB: registering new adapter (cx23885[0])
[   10.245807] cx23885 :07:00.0: DVB: registering adapter 0
frontend
0 (Silicon Labs Si2168)...
[   10.417402] sp2 9-0040: CIMaX SP2 successfully attached
[   10.447120] DVBSky T980C MAC address: 00:17:42:54:09:85
[   10.448844] cx23885_dev_checkrevision() Hardware revision = 0xa5
[   10.450550] cx23885[0]/0: found at :07:00.0, rev: 4, irq: 19,
latency: 0, mmio: 0xf6e0

later when tuning:

[   67.728109] si2168 10-0064: found a 'Silicon Labs Si2168-A20'
[   67.802203] si2168 10-0064: downloading firm

Re: DVBSky T980C CI issues (kernel 4.0.x)

2016-03-03 Thread Torbjorn Jansson
i was about to ask how to easiest see what firmware i was running 
without rebooting when i realized i already have it in this mail thread ;)


all of the firmware i'm running is the ones that came from dvbsky 
directly in this file:

http://www.dvbsky.net/download/linux/dvbsky-firmware.tar.gz

i suspect i should go thru all of the firmware files i use since if one 
is bad the other ones is probably also bad.


i assume i also should also check: dvb-tuner-si2158-a20-01.fw
what version is a good one? i have found 2 different files:

the one i current usefrom dvbsky, also same as OpenELEC fw repo uses 
with md5sum:

8e98d25d6219e235b519a3c47dbfa856  dvb-tuner-si2158-a20-01.fw

and then i found another one at 
http://palosaari.fi/linux/v4l-dvb/firmware/Si2158/Si2158-A20/

0cba7ce61c1411cbe7f22c0746e24e33  dvb-tuner-si2158-a20-01.fw
this file is a bit smaller.

i will retest with the new firmware you suggested and see what happens.


On 2016-03-03 12:02, Olli Salonen wrote:

Hi Jurgen, Torbjörn,

I've noticed that there is currently a small confusion about the
firmware versions for the Si2168-A20 demodulator. This is used in the
older versions of DVBSky T680C (TechnoTrend CT2-4650 CI) and DVBSky
T980C (TechnoTrend CT2-4500 CI).

The version 2.0.5 does not support PLP handling and seems to work very
badly with the Linux driver - at least for me. Version 2.0.35 on the
other hand seems to find all DVB-T/T2 channels for me just fine with
both dvbv5-scan and w_scan (devices used for this test: TechnoTrend
CT2-4650 CI and TechnoTrend CT2-4500 CI new version).

Versions used:
dvbv5-scan version 1.7.0
w_scan version 20150111 (compiled for DVB API 5.10)

So if you are running these Si2168-A20 based devices, make sure you've
got the firmware 2.0.35 that can be downloaded for example here:
http://palosaari.fi/linux/v4l-dvb/firmware/Si2168/Si2168-A20/32e06713b33915f674bfb2c209beaea5/

Cheers,
-olli

On 20 February 2016 at 19:20, Jurgen Kramer  wrote:

Hi,

On Sat, 2016-02-20 at 16:57 +0100, Torbjorn Jansson wrote:

i have tested your patch with my dvbsky dvb-t2 card.
testing was done by compiling a custom kernel with your patch
included.
test was done against fedora 22 4.3.4-200 kernel

with the patch included the CI slot is found.
so there is some progress for sure
-
[   10.189408] cx25840 11-0044: loaded v4l-cx23885-avcore-01.fw
firmware
(16382 bytes)
[   10.206683] cx23885_dvb_register() allocating 1 frontend(s)
[   10.207968] cx23885[0]: cx23885 based dvb card
[   10.224306] i2c i2c-10: Added multiplexed i2c bus 12
[   10.225633] si2168 10-0064: Silicon Labs Si2168 successfully
attached
[   10.243310] si2157 12-0060: Silicon Labs Si2147/2148/2157/2158
successfully attached
[   10.244560] DVB: registering new adapter (cx23885[0])
[   10.245807] cx23885 :07:00.0: DVB: registering adapter 0
frontend
0 (Silicon Labs Si2168)...
[   10.417402] sp2 9-0040: CIMaX SP2 successfully attached
[   10.447120] DVBSky T980C MAC address: 00:17:42:54:09:85
[   10.448844] cx23885_dev_checkrevision() Hardware revision = 0xa5
[   10.450550] cx23885[0]/0: found at :07:00.0, rev: 4, irq: 19,
latency: 0, mmio: 0xf6e0

later when tuning:

[   67.728109] si2168 10-0064: found a 'Silicon Labs Si2168-A20'
[   67.802203] si2168 10-0064: downloading firmware from file
'dvb-demod-si2168-a20-01.fw'
[   68.968336] si2168 10-0064: firmware version: 2.0.5
[   68.977071] si2157 12-0060: found a 'Silicon Labs Si2158-A20'
[   69.961057] si2157 12-0060: downloading firmware from file
'dvb-tuner-si2158-a20-01.fw'
[   70.969094] si2157 12-0060: firmware version: 2.1.9


but using dvbv5-scan to scan it doesn't find any channel.
all i get is this:

Scanning frequency #1 77000
 (0x00) Signal= -114.00dBm
Scanning frequency #2 75400
 (0x00) Signal= -27.00dBm C/N= 32.50dB
Scanning frequency #3 54600
 (0x00) Signal= -25.00dBm C/N= 33.75dB
Scanning frequency #4 65000
 (0x00) Signal= -18.00dBm C/N= 36.00dB
Scanning frequency #5 52200
 (0x00) Signal= -28.00dBm C/N= 33.00dB


so something else is broken too.


I have been using the patches for a few days. So far everything works
great (using MythTV). Scanning with dvbv5_scan does indeed not work
(never did for me). w_scan works though.

Can these patches please be included in the stable kernels ?

Jurgen



On 2016-02-16 21:20, Olli Salonen wrote:

Hi all,

Found the issue and submitted a patch.

The I2C buses for T980C/T2-4500CI were crossed when CI registration
was moved to its own function.

Cheers,
-olli

On 31 January 2016 at 10:55, Torbjorn Jansson
 wrote:

this ci problem is the reason i decided to buy the CT2-4650 usb
based device
instead.
but the 4650 was a slightly newer revision needing a patch i
submitted
earlier.
and also this 4650 device does not have auto switching between
dvb-t and t2
like the dvbsky card have, so i also need an updated version of
mythtv

Re: TT USB CT2-4650 CI with new product id

2016-01-05 Thread Torbjorn Jansson

On 2016-01-05 11:24, Torbjorn Jansson wrote:

Hello.

i just bought a new CT2-4650 dvb usb device for use with dvb-t2.
i picked this since it was supposed to be already working with the built
in drivers in the kernel, but that is not the case.

as far as i can tell it is the module dvb-usb-dvbsky that is supposed to
be loaded for this device.

after checking the source and the output of lsusb the device i have
appears to have a new product id that the drivers dont yet support :(

top few lines of output from lsusb -v:

Bus 006 Device 003: ID 0b48:3015 TechnoTrend AG
Device Descriptor:
   bLength18
   bDescriptorType 1
   bcdUSB   2.00
   bDeviceClass0 (Defined at Interface level)
   bDeviceSubClass 0
   bDeviceProtocol 0
   bMaxPacketSize064
   idVendor   0x0b48 TechnoTrend AG
   idProduct  0x3015
   bcdDevice0.00
   iManufacturer   1 CityCom GmbH
   iProduct2 TechnoTrend USB2.0


the only id number i can find in the source for CT2_4650_CI is 0x3012
and not 0x3015

any idea what to do?


as an experiment i modified linux/drivers/media/dvb-core/dvb-usb-ids.h
by changing this line:
#define USB_PID_TECHNOTREND_CONNECT_CT2_4650_CI> 0x3012
to
#define USB_PID_TECHNOTREND_CONNECT_CT2_4650_CI> 0x3015

and recompiled the modules and got it to work.
modules load, i can scan channels, tuning and watching tv works and the 
CI module works too.


so looks like it will be possible to just add this id and get it to work.

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


TT USB CT2-4650 CI with new product id

2016-01-05 Thread Torbjorn Jansson

Hello.

i just bought a new CT2-4650 dvb usb device for use with dvb-t2.
i picked this since it was supposed to be already working with the built 
in drivers in the kernel, but that is not the case.


as far as i can tell it is the module dvb-usb-dvbsky that is supposed to 
be loaded for this device.


after checking the source and the output of lsusb the device i have 
appears to have a new product id that the drivers dont yet support :(


top few lines of output from lsusb -v:

Bus 006 Device 003: ID 0b48:3015 TechnoTrend AG
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize064
  idVendor   0x0b48 TechnoTrend AG
  idProduct  0x3015
  bcdDevice0.00
  iManufacturer   1 CityCom GmbH
  iProduct2 TechnoTrend USB2.0


the only id number i can find in the source for CT2_4650_CI is 0x3012 
and not 0x3015


any idea what to do?
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DVBSky T980C ci not working with kernel 4.x

2015-12-08 Thread Torbjorn Jansson

On 2015-12-08 04:49, Nibble Max wrote:


Does this card work with the media code from dvbsky.net from kernel 4.x?

On 2015-12-06 19:10:41, Timo_Helkiö  wrote:


Hi


Common interface in Dvbsky T980C is not working with Ubuntu 15.10 kernel
4.2.0 and vanilla kernel 4.6 and latest dvb-drivers from Linux-media
git. With Ubuntu 15.04 and kernel 3.19 it is working. I have tryid to
find differences in drivers, but my knolege of c it is not possible.
Erros message is "invalid PC-card".

I have also Tevii S470 with same PCIe bridge Conexant cx23885.

How to debug this? I can do minor changes to drivers for testing it.

   Timo Helkiö
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Best Regards,
Max



the code from dvbsky works, specificaly this one:
http://www.dvbsky.net/download/linux/media_build-bst-151028.tar.gz

i contacted dvbsky a month or two ago and complained about their old 
drivers no longer working on newer kernels, then i got the above link 
and CI works.


but, i would prefer a working solution using the official code that is 
in the kernel or the "proper" media_build.


there is several reports of this card being broken but unfortunately it 
looks like noone can fix it.
unfortunately i dont know enough to debug kernel drivers or how the 
linux kernel works.



--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


media_build broken by missing vb2.h

2015-10-25 Thread Torbjorn Jansson

Hi.

i just tried to compile media_build as of today but it doesn't work very 
well.


after a while it errors with:
media_build/v4l/vb2-trace.c:4:30: fatal error: trace/events/vb2.h: No 
such file or directory


i assume something is broken in the git repo and i just have to wait? or 
did i do something wrong?


/T
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: DVBSky T980C CI issues (kernel 4.0.x)

2015-09-11 Thread Torbjorn Jansson

On 2015-08-23 19:50, Jurgen Kramer wrote:


On Sun, 2015-07-12 at 12:38 +0200, Jurgen Kramer wrote:

I have been running a couple of DVBSky T980C's with CIs with success
using an older kernel (3.17.8) with media-build and some added patches
from the mailing list.

I thought lets try a current 4.0 kernel to see if I no longer need to be
running a custom kernel. Everything works just fine except the CAM
module. I am seeing these:

[  456.574969] dvb_ca adapter 0: Invalid PC card inserted :(
[  456.626943] dvb_ca adapter 1: Invalid PC card inserted :(
[  456.666932] dvb_ca adapter 2: Invalid PC card inserted :(

The normal 'CAM detected and initialised' messages to do show up with
4.0.8

I am not sure what changed in the recent kernels, what is needed to
debug this?

Jurgen

Retest. I've isolated one T980C on another PC with kernel 4.1.5, still the same 
'Invalid PC card inserted :(' message.
Even after installed today's media_build from git no improvement.

Any hints where to start looking would be appreciated!

cimax2.c|h do not seem to have changed. There are changes to
dvb_ca_en50221.c

Jurgen



did you get it to work?

i got a dvbsky T980C too for dvb-t2 reception and so far the only 
drivers that have worked at all is the ones from dvbsky directly.


i was very happy when i noticed that recent kernels have support for it 
built in but unfortunately only the modules and firmware loads but then 
nothing actually works.
i use mythtv and it complains a lot about the signal, running femon also 
produces lots of errors.


so i had to switch back to kernel 4.0.4 with mediabuild from dvbsky.

if there were any other dvb-t2 card with ci support that had better 
drivers i would change right away.


one problem i have with the mediabuilt from dvbsky is that at boot the 
cam never works and i have to first tune a channel, then remove and 
reinstert the cam to get it to work.

without that nothing works.

and finally a problem i ran into when i tried mediabuilt from linuxtv.org.
fedora uses kernel modules with .ko.xz extension so when you install the 
mediabuilt modulels you get one modulename.ko and one modulename.ko.xz


before a make install from mediabuild overwrote the needed modules.
any advice on how to handle this now?


--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html