StevenP wrote:Has anyone used this USB JMTek, LLC. soundcard successfully on the PI/Raspbian distribution? Any ideas what to try next? Thanks!
Hi Steven,
I'm listening to music through this exact device, via mpd, on my pi right now.
I'm using raspberrypi 3.2.27+ #244 PREEMPT Sat Oct 6 17:26:38 BST 2012 armv6l GNU/Linux.
I didn't actually change anything in /etc/asound.conf to get it to work. When I booted up, the card showed up in lsusb, and in "aplay -l" just like yours. The only difference was that mine shows up as "card 1". I have the device plugged directly into the pi. I don't have a keyboard / mouse attached right now (just using ssh), and the pi seems to be OK with the the power load (I'm using the 5.25V 1A power supply from Adafruit, ID: 501).
All I did to make it work with mpd was to edit /etc/mpd.conf. I changed the audio_output configuration:
Code: Select all
audio_output {
type "alsa"
name "My ALSA Device"
# device "hw:0,0" # original
device "hw:1,0" # point to JMTek USB card
format "44100:16:2" # optional
mixer_device "default" # optional
mixer_control "PCM" # optional
mixer_index "0" # optional
}
I switched it to "hw:1,0" because my JMTek shows up as "card 1" in "aplay -l". If yours is showing up as card 0, then I expect you'd want to leave it at "hw:0,0".
At that point mpd was working - sound was coming out of the analog out. Unfortunately, when playing music through mpd, the pi became quite slow, and the music playback would crash after a while (mpd would become unresponsive). When I had a keyboard attached, I started having problems typing (it would lose keystrokes!) I did some digging around and noticed that the "rsyslogd" process was chewing up cycles at an alarming rate. There was a lot (like 41,000 lines) of this being dumped into /var/log/syslog:
Code: Select all
Nov 9 16:48:38 raspberrypi kernel: [ 1624.632885] delay: estimated 0, actual 144
Nov 9 16:48:38 raspberrypi kernel: [ 1624.640881] delay: estimated 0, actual 144
...
I found this thread
http://www.raspberrypi.org/phpBB3/viewt ... 28&t=15204 titled 'MPD filling kern.log with "delay: estimated 0, actual xxx"' that suggested to change the "nrpacks" option for the snd-usb-audio driver by adding:
This setting limits how many packets the driver will send to the device during an interrupt. After rebooting, it seemed much better / stable and the syslog messages stopped. Even so, the load average was still high. I assumed that the more packets it can send in an interrupt, the more efficient it would be, so I tried bumping nrpacks up a bit. It seems to work OK if I increase it to 3, but when I try 4 I get the delay messages again. I can't say for sure if raising it to 3 had any positive effect, but at least it hasn't had a negative effect, so I'm leaving it there for now. The mpd process is hovering around 30% CPU in top, and the load average is about 1.40, but everything seems stable / responsive. I'm pulling my music files over a SMB/CIFS mount, so I'm sure that adds to the work it has to do.
I haven't tried to get any audio input functions to work at this point. If you have any questions, I'd be happy to post any of the config files - but I assure you, they're essentially the stock raspbian files.
Russ
(HanlonsRazor)