Date: Mon, 30 Mar 2020 23:52:50 +0000 From: bugzilla-noreply@freebsd.org To: gnome@FreeBSD.org Subject: [Bug 245156] audio/pulseaudio: parse /dev/sndstat correctly to get device name Message-ID: <bug-245156-6497-GCqmHu6X1o@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-245156-6497@https.bugs.freebsd.org/bugzilla/> References: <bug-245156-6497@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D245156 lightside <lightside@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212854|0 |1 is obsolete| | Attachment #212854|maintainer-approval?(gnome@ | Flags|FreeBSD.org) | Attachment #212855|maintainer-approval?(gnome@ | Flags|FreeBSD.org) | Attachment #212855|0 |1 is obsolete| | Attachment #212875|text/x-csrc |text/plain mime type| | --- Comment #7 from lightside <lightside@gmx.com> --- Created attachment 212875 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D212875&action= =3Dedit Testcase (In reply to comment #5) Attached another (more correct) test case. The parsing is based on the following source code: https://github.com/freebsd/freebsd/blob/ad355b0a9dbd6a8aabe7c081a731d24904a= 0f2c1/sys/dev/sound/pcm/sndstat.c#L362-L367 https://github.com/DragonFlyBSD/DragonFlyBSD/blob/b809e1148793bbe33af2adb09= af395668a8dae22/sys/dev/sound/pcm/sndstat.c#L390-L407 If I'm not wrong, there are other possible audio device types, other than "pcm", such as "midi" and "sequencer":=20 https://github.com/freebsd/freebsd/blob/ad355b0a9dbd6a8aabe7c081a731d24904a= 0f2c1/sys/dev/sound/pcm/sndstat.c#L243-L257 https://github.com/freebsd/freebsd/blob/ad355b0a9dbd6a8aabe7c081a731d24904a= 0f2c1/sys/dev/sound/pci/hda/hdaa.c#L7151-L7152 https://github.com/freebsd/freebsd/blob/1537078d8f2e62e82de3c08bdcae0fd79dc= 35a4a/sys/dev/sound/pci/emu10kx-midi.c#L247-L248 https://github.com/freebsd/freebsd/blob/ad355b0a9dbd6a8aabe7c081a731d24904a= 0f2c1/sys/dev/sound/midi/sequencer.c#L110-L118 https://github.com/DragonFlyBSD/DragonFlyBSD/blob/b809e1148793bbe33af2adb09= af395668a8dae22/sys/dev/sound/pcm/sndstat.c#L289-L303 https://github.com/DragonFlyBSD/DragonFlyBSD/blob/ed183f8c2f9bb14cbccb8377f= 3cdd29e0971d8a0/sys/dev/sound/pci/hda/hdaa.c#L7177-L7178 https://github.com/DragonFlyBSD/DragonFlyBSD/blob/17975de10935ff2c43fe8eb64= 1c048974acb07c0/sys/dev/sound/pci/emu10kx-midi.c#L243-L244 https://github.com/DragonFlyBSD/DragonFlyBSD/blob/d147c94391cf5cc415970d2b8= 85fcc931026c34e/sys/dev/sound/midi/sequencer.c#L108-L109 Therefore, I also added some format specifiers for sscanf function: https://www.cplusplus.com/reference/cstdio/sscanf/ https://www.cplusplus.com/reference/cstdio/scanf/ --=20 You are receiving this mail because: You are the assignee for the bug. You are on the CC list for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-245156-6497-GCqmHu6X1o>