jackd with hdaudio

OSS specific BSD discussion (FreeBSD/NetBSD/OpenBSD)

Moderators: hannu, dev, cesium, kodachi

jackd with hdaudio

Postby adamk » Mon Oct 20, 2008 9:17 pm

Is this possible?

Simply running 'jackd -d oss' gives me:

Code: Select all
Jackd 0.109.2
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 ..
OSS: failed to enable full duplex for /dev/dsp: oss_driver.c@566, errno=45
oss_driver: /dev/dsp : 0x10/2/48000 (4096)
oss_driver: indevbuf 4096 B, outdevbuf 4096 B
oss_driver: not using barrier mode, (single thread)
OSS: read() failed: oss_driver.c@1068, count=-1/4096, errno=13


Various options get me further, but they all bomb out as soon as a jack client tries to connect.

Here's some system info:

Code: Select all
OSS 4.0 (b1016/200810190022) BSD (C) 4Front Technologies 1996-2008
Kernel: FreeBSD 7.0-STABLE #2: Fri Aug 22 13:35:23 EDT 2008
    root@sorrow.ashke.com:/usr/obj/usr/src/sys/GENERIC


Audio devices:
0: HD Audio play pcm (OUTPUT)
1: HD Audio rec select (INPUT)
2: HD Audio play pcm (VMIX0) (DUPLEX)
3: HD Audio play pcm (VMIX0) (DUPLEX)
4: HD Audio play pcm (VMIX0) (DUPLEX)
5: HD Audio play pcm (VMIX0) (DUPLEX)

Mixers:
0: High Definition Audio STAC9200

History:
/dev/oss/hdaudio0/pcm0.00: pid 2358 cmd 'jackd' IN OUT 1 timeouts
/dev/oss/hdaudio0/pcm0.00: pid 2383 cmd 'jackd' IN OUT
/dev/oss/hdaudio0/pcm0.00: pid 2393 cmd 'artsd' OUT
/dev/oss/hdaudio0/pcm0.00: pid 2393 cmd 'artsd' OUT
/dev/oss/hdaudio0/pcm0.00: pid 2393 cmd 'artsd' OUT 36 underruns


Code: Select all
[ adamk@sorrow - ~ ]: ossinfo
Version info: OSS 4.0 (b1016/200810190022) (0x00040003) BSD
Platform: FreeBSD/i386 7.0-STABLE FreeBSD 7.0-STABLE #2: Fri Aug 22 13:35:23 EDT 2008     root@sorrow.ashke.com:/usr/obj/usr/src/sys/GENERIC (sorrow.ashke.com)

Number of audio devices:        6
Number of audio engines:        6
Number of mixer devices:        1


Device objects
0: hdaudio0 Intel HD Audio
    HD Audio controller Intel HD Audio
    Vendor ID    0x8086269a
    Subvendor ID 0x102801c1
     Codec  0: STAC9200 (0x83847690/0x102801c1)


Mixer devices
0: High Definition Audio STAC9200 (Mixer 0 of device object 0)

Audio devices
HD Audio play pcm                 /dev/oss/hdaudio0/pcm0  (device index 0)
HD Audio rec select               /dev/oss/hdaudio0/pcmin0  (device index 1)
HD Audio play pcm (VMIX0)         /dev/oss/hdaudio0/pcm1  (device index 2)
HD Audio play pcm (VMIX0)         /dev/oss/hdaudio0/pcm2  (device index 3)
HD Audio play pcm (VMIX0)         /dev/oss/hdaudio0/pcm3  (device index 4)
HD Audio play pcm (VMIX0)         /dev/oss/hdaudio0/pcm4  (device index 5)


Adam
adamk
 
Posts: 78
Joined: Fri Jun 11, 2004 1:50 pm

Postby cesium » Tue Oct 21, 2008 2:15 am

This guy managed to get jackd running on FreeBSD using the '-b' switch. Maybe this will help you too?

If that method fails for you, I have a few more ideas:
A. Set vmix0-src to OFF in ossxmix, so no sample conversion is done, and try again.
B. Try using portaudio backend, which should also work with OSS.
C. Upgrade to OSS v4.1-rc2 (or latest source from mercurial) using this guide and see if jackd works better there. There have been a few enhancements to freebsd support not in 4.0 b1016. In particular, /dev/dsp can now support multiple clients, just like the native system (This requires a FreeBSD version which is probably slightly newer than the one you're using [edit: I was referring to the functionality - not OSS itself which still supports older FreeBSD like FreeBSD 6]).
Last edited by cesium on Tue Oct 21, 2008 10:21 am, edited 1 time in total.
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby adamk » Tue Oct 21, 2008 8:42 am

I will have to give option C a try when I get a chance. Using -b didn't change anything, setting vmix0-src to off didn't either. And using the portaudio backend gave me:

Code: Select all
jackd 0.109.2
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 ..
JCA: portaudio driver version : 101
JCA: creating portaudio driver ... 1024|48000
JCA: Pa_Initialize OK
JCA: Driver name required
JCA: Number of devices = 0
JCA: Look for default driver
JCA: ERROR : default driver has not been found
An error occured while using the portaudio stream
Error number: -10000
Error message: Host error.
cannot load driver module portaudio
no message buffer overruns


EDIT: How recent of a version of FreeBSD do I need? I'd rather not upgrade to -CURRENT to make this work.

Adam
adamk
 
Posts: 78
Joined: Fri Jun 11, 2004 1:50 pm

Postby cesium » Tue Oct 21, 2008 10:14 am

Hi,

Try using the "-n" switch together with the portaudio backend: "jackd -d portaudio -n oss" or something like that.
As for newer OSS 4.1, it checks for _FreeBSD_version >= 700111 **, so FreeBSD 7-STABLE, 7.1-BETA, and the FreeBSD version used in PCBSD 7 should all be fine. That said, you do not need to upgrade to install it - it will still work on your system (or on FreeBSD 6 for that matter). Using a newer FreeBSD just enables additional functionality (multiple clients for /dev/dsp), which is not neccesarily helpful for your problem.

** This value is defined at /usr/include/sys/param.h
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby adamk » Tue Oct 21, 2008 11:12 am

'jackd -d portaudio -n oss' gives the same error as just 'jackd -d portaudio'. I should have a chance later today to try a newer version of oss. One of my machines is already at 700112, and I'm upgrading the other now since I could really use the ability to have multiple clients access /dev/dsp :-)

Adam
adamk
 
Posts: 78
Joined: Fri Jun 11, 2004 1:50 pm

Postby adamk » Tue Oct 21, 2008 12:27 pm

Unfortunately, I am unable to compile a newer version:

Code: Select all
[ root@memory - /usr/home/adamk/oss ]: make build
for n in cmd kernel os_cmd kernel/OS/FreeBSD;do (echo $n && cd $n && make ARCH=i386) || eval 'exit 1'; done
cmd
for n in ossdevlinks ossinfo ossmix ossplay osstest ossxmix savemixer vmixctl;do (echo $n && cd $n && make ARCH=i386) || eval 'exit 1'; done
ossdevlinks
cc -c -O -DOSS_LITTLE_ENDIAN  -I../../include -I../../kernel/framework/include  -I../../kernel/OS/FreeBSD  -I../../kernel/nonfree/include -I../..  -I/usr/src/uts/i386 ossdevlinks.c -o ./ossdevlinks.o
ossdevlinks.c: In function 'remove_nodes':
ossdevlinks.c:79: error: 'ENONET' undeclared (first use in this function)
ossdevlinks.c:79: error: (Each undeclared identifier is reported only once
ossdevlinks.c:79: error: for each function it appears in.)
*** Error code 1

Stop in /usr/home/adamk/oss/cmd/ossdevlinks.
*** Error code 1

Stop in /usr/home/adamk/oss/cmd.
*** Error code 1

Stop in /usr/home/adamk/oss.


Thoughts?
adamk
 
Posts: 78
Joined: Fri Jun 11, 2004 1:50 pm

Postby cesium » Tue Oct 21, 2008 12:33 pm

Drat. I didn't know that FreeBSD doesn't have that, especially since the manpage mentiones it... Just edit the file, and remove the (error != ENONET) comparison. [edit: Actually, the problem was me being an idiot and missing a spelling error]
Last edited by cesium on Wed Oct 22, 2008 2:09 am, edited 1 time in total.
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby adamk » Tue Oct 21, 2008 1:30 pm

Well it builds now :-)

Unfortunately, I still get this error when using -d oss:

OSS: read() failed: oss_driver.c@1068, count=-1/4096, errno=13

And when using portaudio:

Code: Select all
JACK compiled with System V SHM support.
loading driver ..
JCA: Driver name found oss
JCA: portaudio driver version : 101
JCA: creating portaudio driver ... 1024|48000
JCA: Pa_Initialize OK
JCA: Driver name required
JCA: Number of devices = 0
JCA: Look for default driver
JCA: ERROR : default driver has not been found
An error occured while using the portaudio stream
Error number: -10000
Error message: Host error.
cannot load driver module portaudio
no message buffer overruns


The new ossinfo:

Code: Select all
[ adamk@sorrow - ~ ]: ossinfo
Version info: OSS 4.1 (b rc2/200810211248) (0x00040090)
Hg revision: changeset: 482:2e265d9cde04, tag: tip, date: Sat Oct 18 09:44:11 2008 +0300, summary: More checks for userland to help with Ubuntu compile and misc.
Platform: FreeBSD/i386 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #3: Tue Oct 21 06:31:56 EDT 2008     root@sorrow.ashke.com:/usr/obj/usr/src/sys/GENERIC (sorrow.ashke.com)

Number of audio devices:        2
Number of audio engines:        6
Number of mixer devices:        1


Device objects
0: oss_hdaudio0 Intel HD Audio interrupts=226 (226)
    HD Audio controller Intel HD Audio
    Vendor ID    0x8086269a
    Subvendor ID 0x102801c1
     Codec  0: STAC9200 (0x83847690/0x102801c1)


Mixer devices
0: High Definition Audio STAC9200 (Mixer 0 of device object 0)

Audio devices
HD Audio play pcm                 /dev/oss/oss_hdaudio0/pcm0  (device index 0)
HD Audio rec select               /dev/oss/oss_hdaudio0/pcmin0  (device index 1)


jackd does work on another machine with an ich chipset (both with 4.0 and 4.1-rc2). Interestingly, though, the ich chipset does not allow multiple apps to access /dev/dsp, though, even with 4.1-rc2. The second mplayer instance gives me:

[AO OSS] audio_setup: Can't open audio device /dev/dsp: Device busy

And, finally, just a few general observations about 4.1-rc2... I really don't like the idea of packages installing under /usr, which is what happens when you pkg_add the results of 'make package'. And why is oss getting loaded if oss_enable is set to "NO" in /etc/rc.conf ?

Adam
adamk
 
Posts: 78
Joined: Fri Jun 11, 2004 1:50 pm

Postby cesium » Tue Oct 21, 2008 1:48 pm

adamk wrote:Well it builds now :-)

Unfortunately, I still get this error when using -d oss:

OSS: read() failed: oss_driver.c@1068, count=-1/4096, errno=13
Does recording work in general with the hdaudio machine? Also try "jackd -d oss -i 0".

adamk wrote:Interestingly, though, the ich chipset does not allow multiple apps to access /dev/dsp, though, even with 4.1-rc2.
Probably vmix is not attached to /dev/dsp for some reason? Do "vmixctl attach /dev/dsp" (as root), and it should work.

adamk wrote:And, finally, just a few general observations about 4.1-rc2... I really don't like the idea of packages installing under /usr, which is what happens when you pkg_add the results of 'make package'. And why is oss getting loaded if oss_enable is set to "NO" in /etc/rc.conf ?
The package generated by the build system isn't integrated all that well into FreeBSD (and OSSv4.0 had the same issue). You probably had the ports package "audio/oss" installed earlier which is integrated well. This is partly because most people here use Linux/Solaris and don't understand FreeBSD conventions, and partly because rather little feedback is given for OSSv4 on FreeBSD platform so stuff like ENOENT issue get through... Fixing this at least partially should be quite doable (e.g. most stuff looks in /etc/oss.conf to get base directory anyway so changing it to be under /usr/local is easy).
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby adamk » Tue Oct 21, 2008 2:27 pm

Actually, I couldn't care less about recording at the moment :-) I never realized that setting the input channels to 0 would disable recording entirely. I am, thankfully, not getting the "OSS: read() failed" error, but mplayer is hanging when trying to connect as a jack client:

Code: Select all
AO: [jack] 48000Hz 2ch floatle (4 bytes per sample)
Video: no video
Starting playback...
A:  -0.0 (unknown) of 253.0 (04:13.0) ??,?%


And it just hangs there.

Something odd is going on with the other machine (the one where vmix was giving me problems). I'm going to try a few things and if I still have problems with it, I'll start a new thread :-)

Adam
adamk
 
Posts: 78
Joined: Fri Jun 11, 2004 1:50 pm

Postby cesium » Tue Oct 21, 2008 2:48 pm

Can you test with another jack client? This will help find out if its mplayer's fault or not. Also, perhaps using "-vv" with jackd will give more output...
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby dev » Tue Oct 21, 2008 3:46 pm

Under FreeBSD you have to specify JackD with separate input and output devices since VMIX doesn't automatically handle full duplex.
dev
 
Posts: 577
Joined: Fri Sep 12, 2003 6:08 am
Location: Culver City, CA

Postby adamk » Tue Oct 21, 2008 8:32 pm

audcious, with the jack plugin, displays the same problem. Interestingly enough, it works fine with my ich chipset at work, but not this HDA chipset or an SB Live! Value that I threw in to test with. The Live! shows the exact same problem. jackd will start, but connections just hang.

EDIT: Forgot to include the verbose output from jackd:

Code: Select all
getting driver descriptor from /usr/local/lib/jack/jack_dummy.so
getting driver descriptor from /usr/local/lib/jack/jack_oss.so
getting driver descriptor from /usr/local/lib/jack/jack_portaudio.so
jackd 0.109.2
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.
server `default' registered
registered builtin port type 32 bit float mono audio
registered builtin port type 8 bit raw midi
clock source = system clock via clock_gettime
loading driver ..
new client: oss, id = 1 type 1 @ 0x811e0e0 fd = -1
new buffer size 1024
registered port system:playback_1, offset = 0
registered port system:playback_2, offset = 0
++ jack_rechain_graph():
client oss: internal client, execution_order=0.
-- jack_rechain_graph()
oss_driver: /dev/dsp : 0x10/2/48000 (4096)
oss_driver: indevbuf 0 B, outdevbuf 4096 B
oss_driver: not using barrier mode, (single thread)
2547 waiting for signals


At this point, jackd is running... When I go to connect:

Code: Select all
new client: MPlayer [2550], id = 2 type 2 @ 0x2840e000 fd = 8
registered port MPlayer [2550]:out_0, offset = 4096
registered port MPlayer [2550]:out_1, offset = 8192
++ jack_rechain_graph():
client oss: internal client, execution_order=0.
client MPlayer [2550]: start_fd=5, execution_order=0.
client MPlayer [2550]: wait_fd=6, execution_order=1 (last client).
-- jack_rechain_graph()
connect MPlayer [2550]:out_0 and system:playback_1 (output)
++ jack_rechain_graph():
client MPlayer [2550]: start_fd=5, execution_order=0.
client MPlayer [2550]: wait_fd=6, execution_order=1 (last client).
-- jack_rechain_graph()
connect MPlayer [2550]:out_1 and system:playback_2 (output)
++ jack_rechain_graph():
client oss: internal client, execution_order=0.
client MPlayer [2550]: start_fd=5, execution_order=0.
client MPlayer [2550]: wait_fd=6, execution_order=1 (last client).
-- jack_rechain_graph()
cannot read request from client (0/2100/Resource temporarily unavailable)
could not handle external client request
removing disconnected client MPlayer [2550] state = Not triggered errors = 1
removing client "MPlayer [2550]"
removing client "MPlayer [2550]" from the processing chain
DIS-connect MPlayer [2550]:out_1 and system:playback_2
++ jack_rechain_graph():
client oss: internal client, execution_order=0.
client MPlayer [2550]: start_fd=5, execution_order=0.
client MPlayer [2550]: wait_fd=6, execution_order=1 (last client).
-- jack_rechain_graph()
^Cjack main caught signal 2
DIS-connect MPlayer [2550]:out_0 and system:playback_1
++ jack_rechain_graph():
client oss: internal client, execution_order=0.
client MPlayer [2550]: start_fd=5, execution_order=0.
client MPlayer [2550]: wait_fd=6, execution_order=1 (last client).
-- jack_rechain_graph()
++ jack_rechain_graph():
client oss: internal client, execution_order=0.
-- jack_rechain_graph()
starting server engine shutdown
stopping driver
unloading driver
freeing shared port segments
stopping server thread
last xrun delay: 0.000 usecs
max delay reported by backend: 0.000 usecs
freeing engine shared memory
max usecs: 0.000, WARNING: 2 message buffer overruns!
cleaning up shared memory
cleaning up files
unregistering server `default'


You can see jackd exiting when I hit control-c.

This is with the hda sound card and the hdaudio driver.

I'm start jackd like so: 'jackd -vv -d oss -i0'

Adam
adamk
 
Posts: 78
Joined: Fri Jun 11, 2004 1:50 pm

Postby cesium » Wed Oct 22, 2008 12:35 pm

What happens if you disable vmix entirely? (Add "vmix_disabled=1" to /usr/lib/oss/conf/osscore.conf)
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby adamk » Wed Oct 22, 2008 2:05 pm

Same problem, unfortunately.
adamk
 
Posts: 78
Joined: Fri Jun 11, 2004 1:50 pm

Next

Return to BSD

Who is online

Users browsing this forum: No registered users and 3 guests