Skip to contentSkip to conversation

strace and ALSA ioctls

DISCUSSION Lee Revell 2 participants 4 messages May 18, 2006

lore
Share & tools
lore

Lee Revell

author
#0 lore raw

I have never seen strace correctly identify a single ALSA ioctl. This makes debugging a serious PITA. Is it fixable?

ioctl(3, USBDEVFS_CONTROL, 0xbfe13958)  = 0
ioctl(3, UI_DEV_CREATE, 0xbfe13a70)     = 0
close(3)                                = 0
stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644,
st_size=7501, ...}) = 0
open("/dev/snd/controlC0", O_RDONLY)    = 3
close(3)                                = 0
open("/dev/snd/controlC0", O_RDWR)      = 3
ioctl(3, USBDEVFS_CONTROL, 0xbfe138f8)  = 0
fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK)  = 0

ioctl(3, USBDEVFS_RELEASEINTERFACE, 0xbfe139e4) = 0 ioctl(3, USBDEVFS_RELEASEINTERFACE, 0xbfe139e4) = 0 ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13250) = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13250) = 0

etc

Lee

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#1 lore raw

At Thu, 18 May 2006 11:41:48 -0400,

Quoted 3 lines · Lee Revell

I have never seen strace correctly identify a single ALSA ioctl. This makes debugging a serious PITA. Is it fixable?

Quite unlikely. Some ioctl commands are indeed identical with these USBDEVFS_*. This happened since we didn't care about the collision and found it too late.

In the kernel side this is no problem because the ioctl cmd is bound to each driver's ioctl op. But, from user-space, there is no way to distinguish properly.

Takashi

Quoted 33 lines
ioctl(3, USBDEVFS_CONTROL, 0xbfe13958)  = 0
ioctl(3, UI_DEV_CREATE, 0xbfe13a70)     = 0
close(3)                                = 0
stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644,
st_size=7501, ...}) = 0
open("/dev/snd/controlC0", O_RDONLY)    = 3
close(3)                                = 0
open("/dev/snd/controlC0", O_RDWR)      = 3
ioctl(3, USBDEVFS_CONTROL, 0xbfe138f8)  = 0
fcntl64(3, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(3, F_SETFL, O_RDWR|O_NONBLOCK)  = 0

ioctl(3, USBDEVFS_RELEASEINTERFACE, 0xbfe139e4) = 0 ioctl(3, USBDEVFS_RELEASEINTERFACE, 0xbfe139e4) = 0 ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13250) = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13230) = 0
ioctl(3, USBDEVFS_CONNECTINFO, 0xbfe136d0) = 0
ioctl(3, USBDEVFS_IOCTL, 0xbfe13250) = 0

etc

Lee

Quoted 10 lines

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

author
#2 lore raw
Quoted 6 lines · Takashi Iwai

At Thu, 18 May 2006 11:41:48 -0400,

Quoted 3 lines · Lee Revell

I have never seen strace correctly identify a single ALSA ioctl. This makes debugging a serious PITA. Is it fixable?

Quoted 8 lines

Quite unlikely. Some ioctl commands are indeed identical with these USBDEVFS_*. This happened since we didn't care about the collision and found it too late.

In the kernel side this is no problem because the ioctl cmd is bound to each driver's ioctl op. But, from user-space, there is no way to distinguish properly.

But for some ioctls it says:

ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0

So it seems that strace is aware of some of the collisions but not others?

Lee

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

#3 lore raw

At Thu, 18 May 2006 12:12:06 -0400,

Quoted 19 lines · Lee Revell
Quoted 6 lines · Takashi Iwai

At Thu, 18 May 2006 11:41:48 -0400,

Quoted 3 lines · Lee Revell

I have never seen strace correctly identify a single ALSA ioctl. This makes debugging a serious PITA. Is it fixable?

Quoted 8 lines

Quite unlikely. Some ioctl commands are indeed identical with these USBDEVFS_*. This happened since we didn't care about the collision and found it too late.

In the kernel side this is no problem because the ioctl cmd is bound to each driver's ioctl op. But, from user-space, there is no way to distinguish properly.

But for some ioctls it says:

Quoted 7 lines

ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0

So it seems that strace is aware of some of the collisions but not others?

Maybe depends on the strace version. strace has a string table for each ioctl entry.

Hm, looking at the source, the script included there doesn't handle ioctls defined via enum correctly. Too bad.

Takashi

-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642