1
$\begingroup$

I'm trying to run direwolf (1.6.0) on Fedora 38. I'm using a C-Media USB audio device to interface with the radio:

Bus 003 Device 008: ID 0d8c:0014 C-Media Electronics, Inc. Audio Adapter (Unitek Y-247A)

I can successfully aplay sounds to that device without a problem (or set it up as the default audio output on my system, etc).

I have the following direwolf configuration:

ADEVICE plughw:4,0
ACHANNELS 1
ARATE 48000
CHANNEL 0
PTT RIG 2 127.0.0.1:4532

Reception works just fine, but sending seems terribly broken: direwolf is able to successfully send a single packet, but subsequent transmissions result in:

Audio output start error.
Bad address
Error preparing after bad state: Bad address
Error preparing after bad state: Bad address
Error preparing after bad state: Bad address
Error preparing after bad state: Bad address
Error preparing after bad state: Bad address
Error preparing after bad state: Bad address
Error preparing after bad state: Bad address
Error preparing after bad state: Bad address
Error preparing after bad state: Bad address
Error preparing after bad state: Bad address
Audio write error retry count exceeded.

And once these errors show up, it's no longer possible to transmit anything; every attempt results in the same error message.

I'm hoping someone here can help identify the source of the problem. Thanks!

$\endgroup$

2 Answers 2

2
$\begingroup$

So...I have a solution, but not an explanation. The original configuration was specifying the sound card as plughw:4,0. As I mentioned in the question, this worked fine for reception but caused problems when transmitting.

Unrelated to this problem, I set up udev rules to give the card a consistent name:

SUBSYSTEM=="sound", ATTRS{idVendor}=="0d8c", ATTRS{idProduct}=="013c", ATTR{id}="RADIO_DIGIRIG"

With this rule in place, I instead of using the plughw specified, I can instead use:

ADEVICE sysdefault:CARD=RADIO_DIGIRIG

This has completely resolved the problem, and direwolf is now able to both receive and transmit.

$\endgroup$
1
  • $\begingroup$ Weird, but alright. It's definitely better to have consistent names than to rely on the auto-assigned indices anyway :) $\endgroup$ Commented Aug 30, 2023 at 22:04
0
$\begingroup$

Generally this means that you have an RFI problem. When you transmit, the RF you generate causes a large number of errors on the USB connection to the sound card, which causes the device to reconnect, and direwolf's "handle" to it to no longer be valid. Usually it will reconnect on its own, sometimes it needs to be unplugged and plugged in again. Either way direwolf needs to be restarted before it will work again.

The solution lies in hardware, not software. Try adding common-mode chokes on any cables that might be picking up signals (i.e. the audio interface cable, the antenna feedline, and power cords), adding shielding (if this is a Raspberry Pi, putting it and the USB dongle inside of a metal project box can help a lot; if it's a full-size PC then it's not so easy), relocating the antenna further away from the electronics, or simply reducing transmit power.

$\endgroup$
2
  • $\begingroup$ This is not an RFI problem. The problem is independent of whether or not there's actually a radio connected to the sound card. The errors come from Linux kernel sound api calls (the specific error message I'm seeing shows up here). $\endgroup$
    – larsks
    Commented Aug 7, 2023 at 1:21
  • $\begingroup$ @larsks that specific error message is sadly not very specific. The condition that generates it is "I thought the device should be in playback state, but it isn't". Does anything come up in dmesg? If so, could you provide that info in the question? $\endgroup$ Commented Aug 7, 2023 at 1:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .