Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GQRX freezes with hackRF 2021.03.1 driver #959

Closed
Potomac opened this issue Apr 24, 2021 · 6 comments
Closed

GQRX freezes with hackRF 2021.03.1 driver #959

Potomac opened this issue Apr 24, 2021 · 6 comments
Labels

Comments

@Potomac
Copy link

Potomac commented Apr 24, 2021

Hello,
I use archlinux, recently they have updated hackRF driver 2018 to 2021.03.1 version :
https://archlinux.org/packages/community/x86_64/hackrf/

With 2021.3.1 hackrf driver version I notice that GQRX 2.14.4 freezes randomly when I switch several times frequency mode option in the GUI (for example AM to FM, FM to LSB), randomly (30% of the time) GQRX freezes and then I hear no sound from hackRF (a 2014 PCB version),

if I downgrade hackrf driver to 2018 version then all is OK, no random freezes from GQRX when changing frequency mode (AM, FM, LSB etc...), I use 2021-03 firmware.

Thanks.

@Potomac Potomac changed the title GQRX freezes with hackRF 2021-0 GQRX freezes with hackRF 2021.03.1 driver Apr 24, 2021
@Potomac
Copy link
Author

Potomac commented Apr 25, 2021

If I use the official appimage of Gqrx (last version, same as archlinux package : 2.14.4) then there is no freeze, no bug with hackRF 2021-03-1 driver :
https://github.com/csete/gqrx/releases

The bug occurs with the archlinux package of Gqrx.
https://archlinux.org/packages/community/x86_64/gqrx/

@Potomac
Copy link
Author

Potomac commented Apr 25, 2021

But the appimage can also contain hackRF lib in 2018-01 version, that can explain why there is no freeze.

@Potomac
Copy link
Author

Potomac commented Apr 28, 2021

I made a git bisect and I found the faulty commit in the hackrf lib :

1442014a80b5ce33f16ef665538c2881b37d3a68 is the first bad commit
commit 1442014a80b5ce33f16ef665538c2881b37d3a68
Author: Matioupi <[email protected]>
Date:   Wed Oct 16 12:03:08 2019 +0200

    Modified hackrf_stop_tx and hackrf_stop_rx to first join the transfer thread
    before setting the receiver to OFF mode (cf. issue #650)

 host/libhackrf/src/hackrf.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

greatscottgadgets/hackrf@1442014

This faulty commit triggers crash on GQRX when using a recent hackRF chinese model (bought in april 2021), and for the moment only GQRX is affected.

Reverting this commit should fix the problem.

Full git bisect log :

git bisect start
# good: [cc7f599677e222a19a2ba4336a23e1fb507cf9f6] Pin OS X builds to Xcode 7.3 for now
git bisect good cc7f599677e222a19a2ba4336a23e1fb507cf9f6
# bad: [e6eb4ba29bbe5dc2fcd092e394188bc10a8bad54] Merge pull request #848 from mossmann/pre-release
git bisect bad e6eb4ba29bbe5dc2fcd092e394188bc10a8bad54
# good: [56b3bd0bed544cf40c9287c6d2b1c811608eda57] Merge pull request #546 from dominicgs/operacake_gpio
git bisect good 56b3bd0bed544cf40c9287c6d2b1c811608eda57
# good: [1c7bf39bda81accb67d04c46aa08808d863180b8] Merge branch 'develop'
git bisect good 1c7bf39bda81accb67d04c46aa08808d863180b8
# bad: [92ee1447143aed8d6b7e291e98e4139190206aac] Merge pull request #699 from miek/ui_disable
git bisect bad 92ee1447143aed8d6b7e291e98e4139190206aac
# good: [923f9fe617c9dcf00c97c18f5aa79e51720b9e59] Merge remote-tracking branch 'mossmann/master'
git bisect good 923f9fe617c9dcf00c97c18f5aa79e51720b9e59
# bad: [058276d010d437486c4e0ee4e0b7fe3f3e52f836] Merge pull request #671 from yhetti/acrylic_case
git bisect bad 058276d010d437486c4e0ee4e0b7fe3f3e52f836
# good: [1569737109283ef944c3ae4d803bbcbb3a523fbf] Merge pull request #607 from dominicgs/portapack_ui_opera_cake_coexistence
git bisect good 1569737109283ef944c3ae4d803bbcbb3a523fbf
# bad: [8ff56c615fa8835e8a0db36ed754e2793ada9a9b] Merge pull request #661 from mgesteiro/hackrf_transfer-fix
git bisect bad 8ff56c615fa8835e8a0db36ed754e2793ada9a9b
# bad: [1442014a80b5ce33f16ef665538c2881b37d3a68] Modified hackrf_stop_tx and hackrf_stop_rx to first join the transfer thread before setting the receiver to OFF mode (cf. issue #650)
git bisect bad 1442014a80b5ce33f16ef665538c2881b37d3a68
# good: [208fae75389e1888c6118f12b79c4ac7522fe372] Merge pull request #645 from jboone/master
git bisect good 208fae75389e1888c6118f12b79c4ac7522fe372
# first bad commit: [1442014a80b5ce33f16ef665538c2881b37d3a68] Modified hackrf_stop_tx and hackrf_stop_rx to first join the transfer thread before setting the receiver to OFF mode (cf. issue #650)

@Potomac
Copy link
Author

Potomac commented Apr 29, 2021

Sadly reverting this commit from hackrf is not enough for solving freezes in Gqrx, as recent commits in hackrf change also start/stop rx, tx functions,
1442014 is just the first bad commit, the problem may be more deep, related to thread management, usb transfert, it will need more debugging for solving this bug.

@argilo argilo added the bug label Oct 4, 2021
@Potomac
Copy link
Author

Potomac commented Feb 4, 2022

The bug is fixed by these commits made by Martinling :
greatscottgadgets/hackrf#1029

The bug was due to a race condition triggered by 2021.3 driver and firmware version of hackRF.

@argilo
Copy link
Member

argilo commented Apr 30, 2023

Closing, as the issue appears to have been resolved upstream.

@argilo argilo closed this as completed Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants