Skip to Content

No sound thru USB port

18 replies [Last post]
thfox
Offline
Joined: 04/17/2010

I've got Hydrogen 0.9.4 i386 package installed in Ubuntu 9.0.4. Works great except no sound thru USB port. I can easily get all my other sound applications to play through USB. What do I have to do to get this working ? Thanx

gabriel
Offline
Joined: 04/17/2010

What driver are you using? And what card? If you start Hydrogen from a console, what error messages do you see.

IIRC, Hydrogen only outputs 16-bit to ALSA. Some recording sound cards don't support this (e.g. the M-Audio Delta PCI cards). The workaround is to use JACK or PortAudio for your H2 audio driver.

thfox
Offline
Joined: 04/17/2010

Hi, Drivers : I have options to use : Auto, ALSA, JACK, OSS (all listed in H2). PortAudio is "not compiled". Card : Conexant HD Audio
I don't start H2 from a console &
I couldn't find "USB device" listed in JACK while it was connected & woking w/ H2. Anything I've not answered clearly or correctly, let me know. Thanx

gabriel
Offline
Joined: 04/17/2010

Sorry for the late response... the RSS feed for this forum appears to be unreliable. :-/

Use the JACK driver and select "Connect to Default Output Pair."

However, if your USB sound card isn't the "first" on your system, you'll have to use something like QJackCtl to connect it to your sound card.

thfox
Offline
Joined: 04/17/2010

I did as U suggested, still NG. Any other suggestions ?

gabriel
Offline
Joined: 04/17/2010

Start Hydrogen from a console and post the error messages.

thfox
Offline
Joined: 04/17/2010

OK :
Hydrogen 0.9.4 [Sep 16 2009] [http://www.hydrogen-music.org]
Copyright 2002-2008 Alessandro Cominu

Hydrogen comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions. See the file COPYING for details

no message buffer overruns
jackd 0.116.1
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

JACK compiled with System V SHM support.
loading driver ..
creating alsa driver ... hw:0|hw:0|1024|2|48000|0|0|nomon|swmeter|-|32bit
control device hw:0
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 32bit integer little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 32bit integer little-endian
ALSA: use 2 periods for playback

**** alsa_pcm: xrun of at least 14.062 msecs

**** alsa_pcm: xrun of at least 0.364 msecs

**** alsa_pcm: xrun of at least 0.108 msecs

gabriel
Offline
Joined: 04/17/2010

OK, so Hydrogen is using JACK... and that appears normal.

Go back to the console and enter this command:

$ cat /dev/sndstat

And post the results. JACK is using hw:0. I'll bet that's your on-board sound card, and your USB is hw:1. But we can see for sure by looking at /dev/sndstat.

thfox
Offline
Joined: 04/17/2010

OK :
Sound Driver:3.8.1a-980706 (ALSA v1.0.18rc3 emulation code)
Kernel: Linux Me-laptop 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2009 i686
Config options: 0

Installed drivers:
Type 10: ALSA emulation

Card config:
HDA NVidia at 0xb0000000 irq 18

Audio devices:
0: CONEXANT Analog (DUPLEX)

Synth devices: NOT ENABLED IN CONFIG

Midi devices: NOT ENABLED IN CONFIG

Timers:
31: system timer

Mixers:
0: Conexant CX20549 (Venice)

gabriel
Offline
Joined: 04/17/2010

This only shows one audio device... a Conexant CX20549. This looks like an on-board audio device -- not a USB.

Is that actually your USB device? If not, your problem is that the USB audio device isn't connected to ALSA. What kind of USB interface do you have?

thfox
Offline
Joined: 04/17/2010

The USB device was not plugged in !
Now it is :
Sound Driver:3.8.1a-980706 (ALSA v1.0.18rc3 emulation code)
Kernel: Linux Me-laptop 2.6.28-13-generic #45-Ubuntu SMP Tue Jun 30 19:49:51 UTC 2009 i686
Config options: 0

Installed drivers:
Type 10: ALSA emulation

Card config:
HDA NVidia at 0xb0000000 irq 18
Burr-Brown from TI USB Audio CODEC at usb-0000:00:0b.0-2, full s

Audio devices:
0: CONEXANT Analog (DUPLEX)
1: USB Audio (DUPLEX)

Synth devices: NOT ENABLED IN CONFIG

Midi devices: NOT ENABLED IN CONFIG

Timers:
31: system timer

Mixers:
0: Conexant CX20549 (Venice)
1: USB Mixer

gabriel
Offline
Joined: 04/17/2010

Configure JACK to use hw:1 (your USB device). You can either do this with QJackCtrl, or you can do it from a console like this:

$ jackd -R -d alsa -d hw:1 -r 48000 -p 1024 -n 2

Then start Hydrogen. Hydrogen should auto-connect to your output ports. If not, connect them using QJackCtrl.

thfox
Offline
Joined: 04/17/2010

Here's what happened when I entered that command :

no message buffer overruns
jackd 0.116.1
Copyright 2001-2005 Paul Davis and others.
jackd comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details

JACK compiled with System V SHM support.
cannot use real-time scheduling (FIFO at priority 10) [for thread -1210927424, from thread -1210927424] (1: Operation not permitted)
cannot create engine

I do have other USB devices. Does this (above) indicate it did not like the device (Behringer UCA-202), or could not even perform the operation ?
Also this v. of jack is the one preceding the current one. Would it help to install the latest ?

gabriel
Offline
Joined: 04/17/2010

Nah... just remove the "-R" from the jackd command.

The "-R" is for "realtime scheduling" -- which you apparently do not have set up for yourself. But that's a whole 'nother thread. So for now, just remove the "-R" and get on down the load.

thfox
Offline
Joined: 04/17/2010

Hi Gabriel,
Well I got it working, however I'm getting dropouts & stumbling & intermittent slow playback. Buffer is set at 1024, so it couldn't be that. What now my friend ?

gabriel
Offline
Joined: 04/17/2010

1. Change -n 2 to -n 4 or -n 8 or as high as you can.

2. Set up your system to allow for real-time scheduling (-R). It varies by OS, but usually it will work to add this to /etc/security/limits.conf

@audio - rtprio 99
@audio - memlock 2000000
@audio - nice -10

Then make sure you are in the 'audio' group. Log off and log back in.

wolke
wolke's picture
Offline
Joined: 03/30/2010

hi, remove the -r option! this try to enable realtime mode.
your user have no rights to do that.
use this.
jackd -R -d alsa -d hw:1 48000 -p 1024 -n 4
here we have disable raltime (-r) and use 4 buffer periods instead of 2 (-n 4) periods

a easy way to configure your jack server, and make conection is qjackctl.

also, you can do the following thinks to get realtime access and maybe better audio performance.
i see in your prev post that you get a lot messages like this.
**** alsa_pcm: xrun of at least 14.062 msecs
this is not so good :)

if you can work with an console editor forget step 1 and 2 and use your preferred console editor.
1. open a console and type
xhost +
2. type as kde user:
sudo kwrite /etc/security/limits.conf
or as gnome user:
sudo gedit /etc/security/limits.conf
3. scroll down to the end of limits.conf.
here you see # End of file.

attach following lines just before the end of file line.
@audio - rtprio 99
@audio - nice -10
@audio memlock 3088539

memlock is depending from your ram. my system have 4gig and i use this value.

4. save the file
5. type
sudo kwrite or gedit /etc/group

search a line begins with
audio:x:
if you find this groupname just attach your username here.
like this:
audio:x:29:your_user_name
or:
audio:x:29:user_a,user_b,and_here_your_username

if group audio not exist, attach just a line like this:
audio:x:29:your_user_name
the 29 is the group id in this example.
use an not used id.

save the file.
after this you must logout your session an login to a new session.

now its possible to use the jack -r (realtime) flag.
notice. full realtime needs a special realtime kernel.

edit:
ohh, hi gabriel. just the same idea.
greetings :)

thfox
Offline
Joined: 04/17/2010

Yo gabriel !

Thanx ! That worked, I just used n8 & that corrected the playback issues.
Thanx also wolke !

When I'm feeling more adventurous, I'll try your recommendations.

One other thing; Will I always have to start Jack from console to get this setup ?

gabriel
Offline
Joined: 04/17/2010

@Wolke: :-)

@thfox: No. If you put the command in the file ~/.jackrc, then it will use those settings every time. However, starting JACK using QJackCtl is how most people do it... and it remembers your settings, too.