PiTFT with USB audio device

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
drewbharris
 
Posts: 6
Joined: Sun Nov 23, 2014 3:56 am

PiTFT with USB audio device

Post by drewbharris »

Hello,

I have a PiTFT on my RPi model B and have noticed that after installing the PiTFT kernel extensions, my USB audio device doesn't perform well - there's pretty bad crackling, etc. If I remove these extensions, the audio is fine, but obviously I can't use my PiTFT.

Is there a solution to this problem?

Thanks!
Drew

User avatar
adafruit2
 
Posts: 22187
Joined: Fri Mar 11, 2005 7:36 pm

Re: PiTFT with USB audio device

Post by adafruit2 »

not 100% sure but it could be that the USB subsystem is being interrupted to display video but i think it's also possible its just the kernel. if you dont have the piTFT module enabled (comment it out in /etc/modules) then see it the USB audio is good. if it *is* then its the display drawing thats conflicting. if its still crackly, its the kernel itself.
not that it really solves the problem but will at least let us know whats the issue :)

User avatar
drewbharris
 
Posts: 6
Joined: Sun Nov 23, 2014 3:56 am

Re: PiTFT with USB audio device

Post by drewbharris »

adafruit2 wrote:not 100% sure but it could be that the USB subsystem is being interrupted to display video but i think it's also possible its just the kernel. if you dont have the piTFT module enabled (comment it out in /etc/modules) then see it the USB audio is good. if it *is* then its the display drawing thats conflicting. if its still crackly, its the kernel itself.
not that it really solves the problem but will at least let us know whats the issue :)
Bingo - USB audio playback is fine now. So that's too bad - I really need to use both the PiTFT and good quality audio for my project. Is there anything that can be done?

Thanks!
Drew

User avatar
adafruit2
 
Posts: 22187
Joined: Fri Mar 11, 2005 7:36 pm

Re: PiTFT with USB audio device

Post by adafruit2 »

hmm, this is a tough one, if its the drawing part, you could check to make sure your power supply is clean, and maybe try to use the USB audio device in USB 1.1 compatiblity mode (dont have a link handy, maybe google around)
don't have any other suggestions at this time. you could also use a Pi model B+ and the onboard headphone audio which greatly improved in quality!

User avatar
drewbharris
 
Posts: 6
Joined: Sun Nov 23, 2014 3:56 am

Re: PiTFT with USB audio device

Post by drewbharris »

adafruit2 wrote:hmm, this is a tough one, if its the drawing part, you could check to make sure your power supply is clean, and maybe try to use the USB audio device in USB 1.1 compatiblity mode (dont have a link handy, maybe google around)
don't have any other suggestions at this time. you could also use a Pi model B+ and the onboard headphone audio which greatly improved in quality!
Okay, I gave up on the USB audio device, but I still need my USB wifi dongle. With the kernel module commented out, I get 6% packet loss (bad, acceptable). With the kernel module enabled I get 60% packet loss (not acceptable, unusable). This is on a brand new B+, latest rpi-update, latest PiTFT packages. I've tried 3 different > 1A power supplies. The wifi chipset is RTL8192cu, though that shouldn't matter as it works [mostly] fine without the kernel modifications.

Can this information get passed to whoever worked on the kernel modifications? As it stands, the thing is not as useful as I thought it'd be. Thanks!
Drew

User avatar
adafruit2
 
Posts: 22187
Joined: Fri Mar 11, 2005 7:36 pm

Re: PiTFT with USB audio device

Post by adafruit2 »

ya that's me - you can try a USB hub, a USB wifi dongle with a longer antenna so its farther away, reducing the SPI clock frequency to the module, reducing the fps rate, etc. its the first we've heard of this particular issue so we dont know what it is. you *might* have to go w/an external HDMI monitor. can you post a photo fo your setup?

User avatar
drewbharris
 
Posts: 6
Joined: Sun Nov 23, 2014 3:56 am

Re: PiTFT with USB audio device

Post by drewbharris »

adafruit2 wrote:ya that's me - you can try a USB hub, a USB wifi dongle with a longer antenna so its farther away, reducing the SPI clock frequency to the module, reducing the fps rate, etc. its the first we've heard of this particular issue so we dont know what it is. you *might* have to go w/an external HDMI monitor. can you post a photo fo your setup?
Oh cool, thanks for getting back so quickly. Tried a USB hub, and I'll try the rest of the suggestions and get back to you.

User avatar
bbandi
 
Posts: 10
Joined: Tue Nov 25, 2014 12:40 pm

Re: PiTFT with USB audio device

Post by bbandi »

I have mostly the same problem (audio, not wifi). My setup: Raspberry Pi A; Adafruit capacitive touch screen; cheap usb hub; cheap realtek wifi (0bda:8176), cheap usb soundcard (0c76:160c, but I tried others as well). I want to build a squeezebox touch clone, so everything is essential in this setup.
The issue is that the sound stutters every time the screen refreshes. Easiest way to reproduce: play something with aplay, and display an image with fbi.
Lowering the spi clockrate slightly lowers the issue, but it doesn't solve it (and the touchscreen becomes useless around 15fps). I tried a lot of usb and fbtft kernel parameter, nothing helped. Finally, I just tried it with HDMI audio, and it has the same damn stuttering.
I suspect it's some kind of fbtft issue, but I couldn't report the issue there, since I have to use the adafruit kernel because of the touch driver.

User avatar
adafruit2
 
Posts: 22187
Joined: Fri Mar 11, 2005 7:36 pm

Re: PiTFT with USB audio device

Post by adafruit2 »

it might be the DMA driver or maybe not-DMA, i'm at the limit of what i know :/ lemme ask notro he is an expert (wrote the awesome fbtft driver we are using)

User avatar
bbandi
 
Posts: 10
Joined: Tue Nov 25, 2014 12:40 pm

Re: PiTFT with USB audio device

Post by bbandi »

Yes, I know :) https://github.com/notro/rpi-firmware/issues/9 (I wanted to use his kernel, so I could open an issue there)
I think I tried disabling dma, but I'm not 100% sure - I thought it's some bcm usb driver issue.
Anyway, thanks for the fast response.

User avatar
bbandi
 
Posts: 10
Joined: Tue Nov 25, 2014 12:40 pm

Re: PiTFT with USB audio device

Post by bbandi »

It turned out my hdmi testing was misleading: Using aplay with a local file worked fine, and even mplayer worked fine with some webradio, but squeezelite didn't. Increasing its alsa buffer solved the issue - but only for hdmi. I suspect refreshing the display via spi stops everything on usb for a short time, including the wifi, the bigger buffer is just a good workaround.

User avatar
drewbharris
 
Posts: 6
Joined: Sun Nov 23, 2014 3:56 am

Re: PiTFT with USB audio device

Post by drewbharris »

bbandi wrote:It turned out my hdmi testing was misleading: Using aplay with a local file worked fine, and even mplayer worked fine with some webradio, but squeezelite didn't. Increasing its alsa buffer solved the issue - but only for hdmi. I suspect refreshing the display via spi stops everything on usb for a short time, including the wifi, the bigger buffer is just a good workaround.
Thanks for this info - I'll play around with my ALSA buffer settings in gstreamer. Your theory would definitely explain some of the packet loss I'm experiencing.

User avatar
bbandi
 
Posts: 10
Joined: Tue Nov 25, 2014 12:40 pm

Re: PiTFT with USB audio device

Post by bbandi »

I might have found something:
https://github.com/raspberrypi/linux/co ... c1afb8e7d2
https://github.com/raspberrypi/linux/issues/575
It seems to me that this is not enabled on the adafruit kernel, but enabled on notro's and the "official" kernel. However, some comments on that issue claims that "dwc_otg.speed=1" fixes the issue (but raises other problems), but it doesn't fix the issue for me.

I have no cross-compile environment, could you guys compile a testbuild? If not, I will probably try notro's kernel in a few days.

User avatar
adafruit2
 
Posts: 22187
Joined: Fri Mar 11, 2005 7:36 pm

Re: PiTFT with USB audio device

Post by adafruit2 »

i can try doing a compile w/that flag but y'all have to manually install the kernel with like 'mv kernel.img' type stuff. if ya'll can handle that i'll make it up but you can brick your pi and there's no super-detailed tutorial

User avatar
adafruit2
 
Posts: 22187
Joined: Fri Mar 11, 2005 7:36 pm

Re: PiTFT with USB audio device

Post by adafruit2 »

hmm, i just did

Code: Select all

ladyada@ladyada-VirtualBox:~/HX/linux_3_12_26$ grep CONFIG_DMA_CMA .config
CONFIG_DMA_CMA=y
are you sure that's not in your kernel? how're you checking :)

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”