From patchwork Wed Sep 6 10:28:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Musceac X-Patchwork-Id: 810497 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.osmocom.org (client-ip=2a01:4f8:191:444b::2:7; helo=lists.osmocom.org; envelope-from=baseband-devel-bounces@lists.osmocom.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fQ9G2NSo"; dkim-atps=neutral Received: from lists.osmocom.org (lists.osmocom.org [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 3xnKbQ0M8Yz9sCZ for ; Wed, 6 Sep 2017 20:30:08 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 9A3663801B; Wed, 6 Sep 2017 10:28:48 +0000 (UTC) Authentication-Results: lists.osmocom.org; dmarc=pass header.from=gmail.com Authentication-Results: lists.osmocom.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=fQ9G2NSo X-Original-To: baseband-devel@lists.osmocom.org Delivered-To: baseband-devel@lists.osmocom.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4001:c06::22c; helo=mail-io0-x22c.google.com; envelope-from=kantooon@gmail.com; receiver=baseband-devel@lists.osmocom.org Authentication-Results: lists.osmocom.org; dmarc=pass header.from=gmail.com Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) by lists.osmocom.org (Postfix) with ESMTP id 3F3393BFF9 for ; Wed, 6 Sep 2017 10:28:45 +0000 (UTC) Received: by mail-io0-x22c.google.com with SMTP id y123so22857100iod.0 for ; Wed, 06 Sep 2017 03:28:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=fGVQW9ZLCRxrlbhyepbDC0CsHbElcMQBnz5AKvR3zBI=; b=fQ9G2NSoogCncC34pTb5Uig7c73yOJMFt/tlZOJeIeIsItRqOoDhsx2WP9WqWrRPPR 7w9v1x4wzoBxYp7j7YRRyIqXylJ1EI4IkcsErdmlYYv5N66Wi9Zv8gHGS6n1TDJUl4h3 qXZP3grwPNRb2nIPVldcRpHjoW9X18nB/FgVTCkDGPzCJ0lXjrfIelxTUf8J3Knr84IQ jSkZQkJAJUrcJuIqbQnHmSTSohe9FBZWsBAIQF6M44gXJDsd+pnQQqRLBHfmM+gSNC89 yXaJzk1nO9f1yDGymiLYdI3foj/O+PK7ZVnXiCXqDD4G0JZXhYyngpnUu83MJZR/XT0u Da8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=fGVQW9ZLCRxrlbhyepbDC0CsHbElcMQBnz5AKvR3zBI=; b=rNXsCI91/irsvNM8JgGwNdDho4POnAq02Jx9YrqJmu2YTskKtbWD9xB/O7sa4w/kV1 C1KgCY1lvLFf6lVEM+Osw/rDqDWR3XDFY4FmI1C6RzLeiq5e/qls1eSjnkR8BteGtbbN YrXvQjnPhsMvIVeqbQ7aSmA3trYp8/ccxLwOxSCAZmR0KvLuFVkXL+0xjk4llQN+mN0t xphVXffREzxXtjieSwL2l9ocZmTDuLgNpgjTrZfIbWmdS2+icy8hTtfxE5zpolNWLssi tlB3ZIFIU3TW4kD27fA1xYqwzzEudl3M94EJjPyHLZvY3bGBMBCVCnjpGna3b0AeYG+3 Hw6w== X-Gm-Message-State: AHPjjUgG7Tm1Kdu1W49wRAz04r9BNPfKpRAW+bcsDr3CpBQs+eP2herQ /Wzx00E1CKMgt6BdR3Cgk7WL/MobKrdB X-Google-Smtp-Source: AOwi7QAUVHbz1m4mqyMRMmuK2akonbJVmODkt2rxCcWExEWkF/+vJumaglKQ/0FXBi5mmVQ+GPKkSZxnCDN6cO4Ob7Q= X-Received: by 10.107.47.93 with SMTP id j90mr2071435ioo.269.1504693724873; Wed, 06 Sep 2017 03:28:44 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.33.2 with HTTP; Wed, 6 Sep 2017 03:28:44 -0700 (PDT) From: Adrian Musceac Date: Wed, 6 Sep 2017 11:28:44 +0100 Message-ID: Subject: SDR_PHY question To: baseband-devel@lists.osmocom.org X-BeenThere: baseband-devel@lists.osmocom.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: OsmocomBB - open source GSM baseband firmware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: baseband-devel-bounces@lists.osmocom.org Sender: "baseband-devel" Hello, I am interested in the sdr_phy work being done currently, and I'm trying to get it set up on my computer. I built osmo-trx from the ms branch and implemented a crude power measurement command. When running trxcon everything works fine, I get power indications for channels, and then when the mobile app is trying to sync to an ARFCN I start having issues. The FCCH bursts are decoded fine, and so are the SCH bursts (which I can also see in the osmo-trx terminal). I had to change the code of trxcon in order for SCH to work, because the bit values were inverted (0 was 1 and viceversa). I am attaching the changes at the end of the message. Unfortunately, the BCCH and CCCH bursts are not decoded: <0006> sched_lchan_sch.c:98 Received SCH: bsic=30, fn=1116799, sched_fn=1116798 <0006> sched_lchan_xcch.c:69 Data received on BCCH: fn=1116800 ts=0 bid=0 <0006> sched_lchan_xcch.c:69 Data received on BCCH: fn=1116801 ts=0 bid=1 <0006> sched_lchan_xcch.c:69 Data received on BCCH: fn=1116802 ts=0 bid=2 <0006> sched_lchan_xcch.c:69 Data received on BCCH: fn=1116803 ts=0 bid=3 <0006> sched_lchan_xcch.c:117 Received bad data frame at fn=1116800 (2/51) for BCCH with 66 errors It appears as if the deinterleaving in gsm0503_xcch_decode does not work... could be the order of bursts? I'd appreciate any help here. I'm also ready to share the changes I've made to osmo-trx/ms and trxcon. Best regards, Adrian * @@ -392,7 +397,7 @@ int trx_if_cmd_measure(struct trx_instance *trx, LOGP(DTRX, LOGL_ERROR, "ARFCN %d not defined\n", arfcn_start); return -ENOTSUP; } - + trx_ctrl_cmd(trx, 1, "RXTUNE", "%d", freq10 * 100); return trx_ctrl_cmd(trx, 1, "MEASURE", "%d", freq10 * 100); } @@ -421,6 +426,7 @@ static void trx_if_measure_rsp_cb(struct trx_instance *trx, char *resp) arfcn == trx->pm_arfcn_stop); /* Schedule a next measurement */ + usleep(50000); if (arfcn != trx->pm_arfcn_stop) trx_if_cmd_measure(trx, ++arfcn, trx->pm_arfcn_stop); } @@ -558,9 +564,9 @@ static int trx_data_rx_cb(struct osmo_fd *ofd, unsigned int what) /* Copy and convert bits {254..0} to sbits {-127..127} */ for (i = 0; i < 148; i++) { if (buf[8 + i] == 255) - bits[i] = -127; + bits[i] = 127; else - bits[i] = 127 - buf[8 + i]; + bits[i] = -127 + buf[8 + i]; } diff --git a/src/host/trxcon/trx_if.c b/src/host/trxcon/trx_if.c index 6a84af6..def571c 100644 --- a/src/host/trxcon/trx_if.c +++ b/src/host/trxcon/trx_if.c @@ -325,6 +325,11 @@ int trx_if_cmd_setslot(struct trx_instance *trx, uint8_t tn, uint8_t type) return trx_ctrl_cmd(trx, 1, "SETSLOT", "%d %d", tn, type); } +int trx_if_cmd_sync(struct trx_instance *trx, uint8_t type) +{ + return trx_ctrl_cmd(trx, 1, "SYNC", "%d", type); +} + /* * Tuning Control