Skip to content

Audio distorted with USB IEC958 SPDIF Input #351

Closed

Description

@HansBorjes

See Hexxeh/rpi-firmware#23

When using ESI U24XL audio interface with IEC958 SPDIF (48kHz, 24 bit, 2 channels) input it worked with the original firmware (as shipped) with some crackles from time to time.

After upgrading the firmware the recorded audio signal (via alsa driver) is completely distorted. The audio signal in the wav editor show missing samples in even spaced intervals.

Unfortunately the downgrade feature for firmware does not work: the tarball path returns error 404 not found.

Please help.

Activity

  1. ghost assigned on Aug 5, 2013
  2. P33M commented on Aug 5, 2013

    @P33M
    Contributor

    This is a known issue with fiq_split. Can you try with dwc_otg.fiq_split_enable=0 on the command line?

    Edit: this will not "fix" the issue but should revert your large chunks of missing data back to the occasional crackle.

  3. HansBorjes commented on Aug 6, 2013

    @HansBorjes
    Author

    Yes, thanks. It resolves the issue with regular missing data. Apart from that I have not observed the occasional crackle yet (up to a recorded file length of 9'42").

  4. HansBorjes commented on Aug 6, 2013

    @HansBorjes
    Author

    Okay, the crackles are still there as I found doing more recordings. Is that likely to be resolved in the future? The theoretical USB throughput should fit this stream. The CPU load by the sox recording process is less than 10%.

  5. P33M commented on Aug 6, 2013

    @P33M
    Contributor

    The problem is that, especially for your bitrate, we must do multiple split transactions to complete a single frame's worth (1ms) of audio data. fiq_split currently doesn't support doing multi-packet IN (record) transactions.

    There have been a few minor tweaks to the driver to prevent a couple of the more common things that screw this up from happening - so now the driver doesn't try to do anything bad.

    The thing that corrupts the data still is the fact that we must perform this transaction perfectly, with each of the packets slotting in the right place, each and every time. The primary mechanisms that drives anything to do with USB are interrupts - we need to do 3 just for a single split transaction, your recording bandwidth requires that we do 3 + gap + 3 + 3 = 9. If something in the kernel holds off interrupts for more than ~100uS then there's a high risk that we will miss a slot. Hubs will either drop a microframe's worth of data or just drop all of the remainder in this case.

    This problem becomes a lot worse if you start intensively using certain Pi drivers - SD card, Ethernet, USB mass storage - these will necessarily hold off interrupts to do some processing which increases the likelihood of mucking up the USB transaction.

    It's being worked on. The FIQ will eventually support doing the entirety of a split transaction by itself, without the kernel having to babysit the hardware.

  6. HansBorjes commented on Aug 6, 2013

    @HansBorjes
    Author

    Thanks for your explanation. Of course I am writing a wav file to the SD card and there is a WiFi adapter running on the USB. There are tutorials on how to minimize the audio latency, which is somewhat the opposite from what I am doing. Would it be possible to manipulate the kernel in order to give this one USB device priority over everything else?

  7. P33M commented on Mar 19, 2014

    @P33M
    Contributor

    USB audio recording/input should now work correctly with BRANCH=next firmware (at least for most sane bitrates, 24bit 48k stereo should be manageable).

    Please test and report back.

  8. P33M commented on May 2, 2014

    @P33M
    Contributor

    No response from OP - other reports are positive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions